Generating Multiple Output On One Page
I'm building a website in PHP and Javascript. The registration
portion is divided into 2 sections:
1. In one, I get info about the visitor. This is sent via POST to a php
script which is section 2.
2. In the second section, I get some specific information about their
pets and make suggestions. I'm having problems with section 2, and I
hope y'all can help.
The core of the PHP script in Section 2 consists of the following:
<?php
for ($n=1; $n <= $num; $n++) {
print "Please enter age of pet #$n:" ;
print "<INPUT type='text' name='petage'     " ;
$div = $n . "ajaxDiv" . ";";
$_ENV['div'] = $div;
print "DIV IS: $div<br><br>";
print "<INPUT TYPE='button' onClick='ajaxFunction()' NAME='$age'
VALUE='Done!'>" ;
print "<INPUT TYPE='reset' NAME='Clear' VALUE='Reset form'>
<br><br>" ;
print "<div id='$div'></div><br><br>" ;
}
ajaxfunction() looks like:
if(ajaxRequest.readyState == 4){
var div = "<?php echo $_ENV['div']; ?>";
if (div = "") {
div = "1ajaxDiv";
}
var ajaxDisplay = document.getElementById('div');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
// Get pet stores based on zipcode
var zipcode = "<?php echo $zip; ?>"
var querystring = "?zipcode=" + zipcode;
ajaxRequest.open("GET", "getstores.php" + querystring, true);
ajaxRequest.send(null);
The idea is that the user fills in the age of their pet, I look in my
DB and spew out the names and addresses of vets and pet stores in the
area. Thanks to ajaxfunction(), I can do this through:
print "<INPUT TYPE='button' onClick='ajaxFunction()' NAME='$age'
VALUE='Done!'>" ;
The function calls another PHP script and outputs the data in the same
HTML file.
So here is my issue. This code works fine when there is only one pet.
If there are more than one, then clicking on the second button results
in no output at all.
I was thinking of enclosing it in a form like so:
<form method="post" action="/cgi-bin/samescript.php">
loop to output buttons
</form>
Meaning call the same script after clicking the first button, second
button and so on.
But I would then need to change:
print "<INPUT TYPE='button' onClick='ajaxFunction()' NAME='$age'
VALUE='Done!'>" ;
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Generating Multiple PHP Pages W/ Different Quries On Each Page
I'm writing a guestbook. So far, so good, except now I need multiple pages. How would I write my scrpt to automatically generate multiple pages (or the same page, just changing query variables on it)? For example, if I limit a page to 10 posts and the page exceeds 10 posts, and I press "Next page", I want it to display the next 10 posts.
Generating Multiple Fields Through A Loop
Is it possible to create a form where the fields are generated through a loop?Example: My database has 20 columns, I create a PHP form and use a loop to define the number of rows. The loop generates a table of 20 columns and 50 rows. After entering the data into these fields, I click add and another loop enters all of the data into the DB.I do know that this is possible by defining each variable in each field. But, it would take quite some time to define 50 or 100 fields. So a loop looks to be the easiest way in generating the 20 columns and 50 rows.How do I go about coding this?
Generating Multiple Files Using Templates.
I'm trying to develop a doorway page maker script, what I've done is that I've setup the script to parse a keyword.txt file into specific SE optimized templates, I have done this initial part with the script below Code:
Generating Code With PHP Printing To Multiple Lines
I'm trying to add several lines to a Javascript portion of a php that look like this: filecal13.addDisabledDates("9-12-2007 ","9-13-2007 ");(with different dates, of course) When I echo the code to a viewable part of the page using $cname . '.addDisabledDates("' . $array[$i] . '","' . $array[$i+1] . '");it prints correctly, but using the same code in a Javascript section of the source gives me cal14.addDisabledDates("9-12-2007 ","9-13-2007 "); on multiple lines, and of course my javascript doesn't like that. I've been screwing with it for a while now and can't seem to figure it out. Any ideas?
Generating Page Preview
I'm currently working on a management type of interface for a website. It's a PHP site with a MySQL backend. What I'd like to do is have a text box for editing text on the site, as well as a few other things, and then be able to generate a preview of the site. The preview is where I'm lost. I'm not even sure if it's possible, but what I'd like is either an image generated from the URL or a way to quickly and easily render the page but on a much smaller scale. Is this possible? If so, how would I go about it?
Generating Page Break ?
I am doing a CARBASE for some dealer, to update his cars on sale online. Within the admin function he wants to be able to print out a list of all cars in the database, but only two per page. Now I have two questions: 1. Can I access the printer dialog of the browser from PHP? 2. Can I add page breaks after two records to get the printout right?
Generating A Page In Time-delayed Chunks?
Is there anyway of getting these 'sleeps' and 'echos' up to the client, so that a page is generated in timed stages. The code below might give a better idea of what I mean.. Rather than have the whole lot run on the server (sleeps and all) followed by a single http header with a big lump of HTML, I would like each chunk to be sent up seperately in a time delayed manner and appended to the current content in the browser. My (feeble) guess is that I need to send an http header with each one, but what do I put in it? <?php if($whatever){ $total = ($one + $two); echo "<br><br><b>I'm having a snooze</b><br>"; for($i=0;$i<5;$i++){ echo "<br>$i<br>"; sleep (1);} echo "<br><br><b><i>Total of $one and $two is $tot</b></i>";}?>
Multiple Column Output
I want to display a prod catalog wid prodname, color, image etc as 2col x 3 rows, like: prod1 | prod2 | colr1 | color2 | prod3 | prod4 | color3 | color4 | and so on... I have this code, which gives the desired results, but all columns in one line.. i.e. prod 1 | prod2 | prod3 | prod4 | color1 | color2 | color3 | color4|.. and so on i want two columns for each two products, and then rest of two down.. adn so on PHP Code:
Generating Multiple Alternating Columns And/or Tables Within Tables
I am having a little bit of trouble generating the code for a table with 2 columns. The columns contain tables within themselves. Not sure why as that part was an existing design. Here is the output so far and it is correct but not how i want it to be (i'll explain) Code:
Need Output On Same Page?
I was using a header.php before which had on it the search box. The search submit button called the sitesearch.php file and displayed the results. The header.php was included and was always shown...That worked great... I know have decided that i want the search box on the top of my index page and would like the results to display on the same page without using or calling another page. I want the search box on the right in it's own cell and the results to display on the left portion of the screen...
Processing And Page Output Order
I have been using php for some time now and have got the hang of fairly high level processing including dynamic images from mysql output that leads me to the point of needing to better understand the processing /logic order of the php engine so i can increase the speed of my scripts. Code:
Output Page As Script Is Running
How can I get my php script to output to the browser before it is done executing? I am running a perl script in the middle of my php script and I would like for the information like "Working..." to be displayed as the perl script is running.
HOWTO: Output A Picture In The Middle Of A Page
I want to generate a web page using PHP, and in the middle generate a graphic I read from another server. So the graphic is in $picture. So I can either write $picture to a temp file and then use an ordinary <img src=filename> to get the browser to display it, or output it by itself in a new page, because then I have a chance to output the correct header so I don't just get garbage on the screen. Evidently first approach is poor because I have to write a local file, and second approach is not what I want anyway. Is there a way to do this? That is, I have $picture that contains an image, and I want to output it here and now in this HTML page I am in the middle of creating, and have it show as a picture.
How To Limit Output Lines Per Page Using A Flat Txt Database
I searched the boards for some direction in limiting the output to so many lines like "Back 1 2 3 Next". However, everything is pointing to mysql databases. Has any one did it with a flat text file? This is a sample of how I print to the screen How can I modify this? PHP Code:
Multiple Forms In 1 Page
im having a bit of trouble with my form, its for an invoice system I have 2 tables: Invoices - invoice_id*, cust_id and date invoice_items - invoice_item_id*, invoices_invoice_id(links to invoice_id in invoices table) item_item_id(links to item_id in item table) description, weight, price I am trying to create the form for the page so that all the information can be entered at once, but i dont think its possible, because an invoice must be created first then invoice_items added using that invoice id. how can i get my form to do this? i need it to insert the invoice into the database then take that invoice_id and add it to the item details on the page? this is what ive written so far but now im stuck on the invoice_id bit Code:
Are Multiple GD Generated Images Possible On One Page?
I've been experimenting with generating PNG files via PHP and GD. All was going fine, until I tried to put more than one image on a single page. <img src="draw.php?text=Picture1"><br> <img src="draw.php?text=Picture2"><br> <img src="draw.php?text=Picture3"><br> The example above produced 3 images, but they all have 'Picture3' on them. Seems like theres only 1 temp storage area for the images?
Create Web Page In Multiple Language
i want to craete site which shows the contents as per the langauge i choose. so can anyone give me idea that how this is possible. i know tha problem but i don't have any idea about soultion. so pls reply me if u know
Update Multiple Records From One Page
Recently, I had a request to create a page in our database web interface where we can update multiple customer records from one page. Here's the flow of what we want to do: 1. Search for a customer by name. 2. Bring up a list of the matching customers and the data that is to be changed in text boxes in a table - one customer per row with 6 fields for each that can be modified (6 text boxes). 3. People can update the appropriate fields and click submit button. (** this is done to this point **) We may be returning as many as 250 records per search, so efficiency would be pretty important. I am not sure where to go from here. I would guess I should build and array of keys and values from the HTTP_POST_VARS that are submitted and then loop through them to UPDATE the database to the new values. I don't know how to do this, though.
Multiple Page Gallery Without Database
I have 20 images and 20 thumbs. same filenames but in different folders. I have 20 thumbs per page, but if i want to have more, there has to be a link to 2nd page, which shows thumbs from 021.jpg till xxx.jpg. If possible also third and fourth pages. I dont want to use a database. The questions is how to achieve this?
Multiple Submit Buttons On One Page
i have a table created through echo's which display data from the database. The database has multiple items in the thing, so i have lots of rows. Each row has a submit button on it with a different hidden ID, which is $row[0], which is the ID of the items that are being displayed. Displaying all the data and having the submit buttons isnt the problem. The problem is clicking the button. I'm not sure how to manage the data at the end. At the moment I have: Code:
Multiple Forms, Different PHP Documents, Same Page?
In a PHP file 'main.php' I have <?php include 'header.php'; include 'login.php'; include 'body.php'; include 'footer.php';?> Login.php has a form on it to allow the user to log in to the site. Body.php has a form on it to allow a user to post a message. What I'm finding is that the 'submit' button on 'body.php' actually calls the form from 'login.php'. Does PHP have issues when there are 2 separate forms doing 2 saperate things displayed on the same page - is there anything I need to look out for?
Multiple Tables Print To One Page
Is it possible to print information from multiple databases on one page/form. For example, I want to print information that is in three databases, and I want to be able to print a few related fields on one page. Is that possible?
Multiple Page Link Exchange
I am in need of a PHP Link Exchange script (preferably free) that is not for single pages. The use of this script will be for having 4 pages on the website - the home page with paid links for $1, and then 3 other pages for free link exchange (Free Links Page 1, ...2... and so on) If you know of a script out there then please post a link to it here. It would be a huge help to me and I greatly appreciate it. I saw one almost a year ago on the HotScripts Most Poplar page, but cannot remmeber it nor find it in HotScripts now.
Refreshing Page Making Multiple Entries
I have a form which accepts input from the user and then inserts data into mysql. The problem is, after user inputs data and a new page is loaded; if the user again presses "refresh" button, the same entries are re-entered into database.
Updating Multiple Rows With One .html Page
I am trying to create a form to update multiple entries in a mysql databse. This code below is rough, but it is working to the point wher it pulls the data, displays it in the text areas (but it does not go past the first white space in displaying, that needs to be fixed), and then I can alter the text fields, check a box, and hit submit, and it will update the fields, but the new value is size=20. I also can't update more than one record at a time, which defeats the purpose. Code:
Multiple Page Generation Based On Post-length
Ok, first I'd like to apologize if this has been covered before, but I couldn't find it via the search options and it's been a long time since I've been here. I'll give you a summary of what I'm trying to do, and you all can point me in the best direction on how to go about it! I'm trying to design an online article posting section, where the members can post articles about things. The problem that arises imediately, is post length. What if someone posts a "3 page" article by word-processing-program standards, and then outputted this to the website? It would be a really long page and if the page was setup with a specific UI size design in mind, it would blow this apart. I'm sure you can understand what I mean. So, I need to be able to get the post's length, figure out how many pages I'll need to break that length up, then break it apart for output to the screen in segments with links for next page continuing the article. Now, the post's length isn't hard, (strlen) and figuring out how many pages isn't that hard, dividing the post's length by the desired amount of characters wanted in the UI. The part I'm stumped on is breaking apart the post into many peices that break at 'spaces' not in the middle of words, and that continue where the last one left off, not leaving any words out. If this has already been covered, or someone knows of another site that has it, please post it! If someone knows of a really simple way to do this, by all means, dazzle me!
Preventing Multiple Data Insertion On Page Reload
I am developing a PHP-mysql database. It is noted that when the browser window is refreshed the data is inserted again in the database. unfortunately there is no unique keys that I can use to verify the existance of the data, so as to prevent the multiple insertion. Is there any other way to prevent it otherthan introducing another field for this purpose and verifying its existance?
Eliminating Passed URL Variables For Multiple Listings On A Page
I have a page with a list of several users, each hyperlinked to another page of 'more info' about that user. The hyperlink contains the UserNumber, UserRegion, and UserStatus, and the receiving page picks up the data in the passed URL. This works well, but I'd like to eliminate the passing of these variables in the URL. One way is to make a graphic ('More Info') that can be clicked to submit a form. Each 'More info' graphic from the dynamically created page could hold the UserNumber, but how can I pass several variables with a single click? On some pages, there can be 100+ users, and I hate to have 100+ separate forms and hidden fields. I thought of using session variables, how can I know which user was clicked to set the session variables?
Multiple Object Oriented Forms Within The Same Page Layout ?
I am looking for a php class and page layout framework allowing smooth object oriented insertion of several, possibly different, forms within the same page layout. All of that while retaining the very desirable properties of a great php class : - self contained - auto validation - contextual error messages - build in input types - etc. I looked at hundreds of form classes and frameworks on the web, but couldn't find any that would fit all of these simple requirements. Does such a framework exists somewhere ? May I point out that I am definitely NOT looking for multi page forms, the kind used to make wizards or assistants.
Multiple Navigation Tables On One Page (master - Slave)
I just wanted to refresh only part of the page, i.e., table2 on my php page. here is my javascript code which performs the refresh it works fine and my php file display all the records. the only problem is: I have got two tables on the same page and i only want to refresh the second table when i click the a row of my first table rows. Code:
Making Gmdate Output Equal Date Output
gmdate('F j, Y, g:i a',0) returns January 1, 1970, 12:00 am. How do I add to the second parameter of the date function to make it always return that same date, regardless of the time zone? Intuitively, it seems like date('F j, Y, g:i a',0 - date('Z')) should do it, but on my system, that's an hour off. Here's some sample code: <? echo gmdate('F j, Y, g:i a',0).'<br />' echo date('F j, Y, g:i a',0 - date('Z')).'<br />' echo date('F j, Y, g:i a',0 - date('Z') + 60*60); ?> And here's the output on my system: January 1, 1970, 12:00 am December 31, 1969, 11:00 pm January 1, 1970, 12:00 am Will the last echo always return the same thing as the first echo, regardless of the time zone? If so, why? It seems that the second one is the one that should do it - not the first one.
Dynamic Form Fields/multiple Page Form?
It is for a friends out of print booksite, where visitors can request multiple books to be searched by adding one at a time to a cart (javascript), then once all added they submit to another form where they enter their personal details and all is sent through. The problem is at the moment they cannot change whats in the cart without refreshing the browser window and losing everything. 1) present for asking how many books they want to search for 2) display multiple rows of the same input fields depending on how many books they say they want to have searched for?i.e title|author|publisher|etc title|author|publisher|etc title|author|publisher|etc 3) when these are submitted they could see these above the next part of the form where they enter their details with the option to go back and delete/amend. 4) send all the info to my colleague. if so has anyone seen a similar script that I could take a look @ to see if I can hack it to suit my needs?
About Generating URL.
Like I mentioned earlier I am learning PHP. I am trying to automaticanny generate a unique and permanent link string for each "submit" of a form. I could generate manually new URL/URI using GET attribute. And Post can generate a string for me but it wont be a permanent one.I dont know how to gererante it automatically when a user submit the form.
Generating .pdf Documents On The Fly...
Does anyone know if it's possible to generate pdf documents from content held in a database? The idea is to use a template to dynamically generate pdf documents on the fly based on what the data a user has selected on a site. Is this possible with PHP/ ASP?
Generating Pages On The Fly
i have a db lthat i want to publish. it''s full of articles and i want it to work this way: there are ten categories (sex, health,....)once you click one of this category you go to a page where there are some articles (about sex, about health,...). at this point is my problem. i'd like to find a way to click an article and have the code generating a new page for me with that article. is this possible? to eplain: this is sexuology.php with these: article 1 article 2 article 3 once i click a new page is generated on the fly to let me read the whole article how can i do.
Need Help In Generating PDF Files
I have a problem in Converting HTML data into PDF I an able to push Image file in PDF HTML Data comes from MySql database , I want to add it in PDF File with Images So can anybody send me PHP Class or code so i can able to convert HTML data into PDF.
Generating Proper XML With PHP
I wrote a simple php script that generates an XML file based on a DB query. The problem is that some of the db entries may contain tabs, gt/lt signs, and other XML-unfriendly characters. Is there a stock function for replacing these with their proper XML escape sequences? I suppose I could do it with regex, but it seems this would be so common that it's silly to write it over again.
Generating Path?
im trying to generate a path from a url. url is like test.php?f1=bong&f2=dong $secure = "c: ralalasomething"; $fo1 = 1; $t = 2; for($i = 1;$i <= $t; $fo1++, $i++) { $fo2 = $fo2 . "$f$fo1";} echo $secure . $fo2; this prints out c:ralalasomething$f1$f2 but i want it to print c:ralalasomethingongdong
Generating Tables
I have a section of a web site that is for downloads of photography. There are seven different subject to view and I have these subjects and the corresponding URL's where their photos are stored in a mySQL database. I have no problems using the database to tell me how many photos are in the database, how many by subject, and even there names. I have been able to call them up and display them with no problems. The problem I do have is I want to generate a table, 6 columns wide (736 pixel width as well) and have php add the photos to it - generating new rows of the table on the fly with the found set of photos it pulls from the database. I just do not know how to format the code to put in my while statements that when it fetchs all the rows in the found set to insert them into the cool table that I need. My database name is Tphotos and the table is photos. I have defined the following fields as well - subject, photoname, alttext, lowressource, highressource. I pull the low res in first with alt tect and the link to the highres and open it in a different window.
Generating Image
I want to generate images depending upon the data entered by the user on HTML form. How can i use image from PHP. I am new to PHP so don't know how to do it. help me out.
Generating Pages?
I have a website that allows users to submit information on Halloween attractions (like haunted houses) to a mysql database and I'm trying to find a way to make the attractions automatically added to a list of attractions without me have to go in and plug them into a html file and add the link to the list of attractions. I've bought several books on php and mysql and none of them cover this. They all tell how to output the data in an array but I'm not really looking to make the data a table. I want it to be a list of attractions and users can click on the name of an attraction and it take them to a page on that attraction. Code:
Problem With RTF Generating
I'm trying to use RTF files to generate my word documents instead of COM, due to it being faster and more compatible with other systems. However I haven't been able to get any kind of style to work in the document, it just displays everything including all the tags. Code:
Generating Number...
I have a script where I am trying to generate a random number that is between two numbers... but it gets more complicated. Lets say the numbers are: 14.1 and 16 The numbers between these would be like this: 14.1, 14.2, 14.3, 15, 15.1, 15.2, 15.3, 16 Notice how the number never gets past 3 tenths, it skips up to the next whole number, then the pattern continues. So if the numbers are 14.1 and 16, I would like it to randomly choose between the numbers listed above. The numbers are always different, so I need a script that will be able to do this no matter what the two starting numbers are. Code:
Generating Poll Results
I am trying to generate poll results like the polls on this forum or poll modules like Php-nuke, using a script then generating the options like: Yes, No, Maybe, etc. Then following that generating the result is a bar. So far the script has been unsuccessful in generating the proper results for one instance the script doesn't display the other options such as No, Maybe. It only generates, Yes. Secondly the bars width doesn't correspond to the statistics. If you need a live demonstration you may find it at : http://phpnetzero.sourceforge.net/i...ollresults&id=1 This is the following script I'm using If you could help me fix it or specify a new way of producing the results I'm open to suggestions. PHP Code:
Generating Random String
Wrote this to generate random strings for resetting passwords, and it's meant to return a 10 character string - but for some reason it sometimes returns less than 10 characters. PHP Code:
|