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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Variables Not Passed From Url Or Form To Page
I use a Mac at home running OSX 10.2, and use the Apache PHP MySQL trio for developing and testing sites. I've had very good experiences with this setup and have had no major problems till now. I noticed recently that variables added to the end of the url (the get method, ...url/page.php?var=value) are not passed to the script within the page. Forms using either the get or post method have the same problem. For example, a page named "foobar.php" containing this: Code:
Ebay Listings Using Front Page
Anyone know the best way to get page created in front page 2002 in an ebay listing. I've created a page but a lot of the format and graphics are missing when viewed in ebay
Variables Passed Between Functions
I have a function that fills the value field of a form with 2 possible variables but they are not getting set so when you view source you just see value="" I also try echoing these variables to see if they are getting set but they are not. Is it becuase they need to be set to global? Code:
Passed Variables In Included Files
I'm looking for a guide on how variables are handled in included files. A pitfall I've run into is that if I define a variable, then include a file, the variable can be displayed on the included file. But if I try to call that same variables on the included page within a function, the variable is undefined. Example: PHP Code:
"Paging" (First/Previous/Next/Last To Limit # Of Listings Per Page)
I'm trying to get a handle on the best way to handle setting up my listings so that I display groups of about 25 records per page. I currently have a page that returns over 1,000 names/addresses, which is obviously not very efficient. Does anyone have any suggestions on the best way to approach this, or recommendations on what pitfalls to avoid? I'm assuming that I need to be able to count the total number of records that match the search criteria, possibly at the top of the page before any HTML output, then find some way to identify/track the first record, next record, etc...? I know I should replace my existing query with something that limits it to about 25 records at a time, right? <?php include('dbconnect.php'); echo "<TABLE width="100%" align="center" border="0" cellpadding="0" cellspacing="0">"; $query="SELECT * from artists WHERE mentor=Ɔ' ORDER BY country DESC, state ASC, city ASC, lastname ASC"; $result=mysql_query($query) or die(mysql_error("Could not execute query.")); while($row = mysql_fetch_array($result)) { $artistID = $row['artistID']; $firstname = (ucwords(strtolower($row['firstname']))); $lastname = (ucwords(strtolower($row['lastname']))); $mentor= $row['mentor']; $city= (ucwords(strtolower($row['city']))); $state= (strtoupper($row['state'])); $country= (strtoupper($row['country'])); //....etc.... echo " <TD align="left" valign="top" width="50%"><FONT size="2" face="Arial, Helvetica, sans-serif"> <A HREF="javascript:;" onClick="openProfile('artist.php?artistID=".$artistID. "','Artist','resizable=yes,width=750,height=400')">".$firstname." ".$lastname."</A></FONT></TD> //....etc....
PHP Not Populating Form Variables Passed Through POST Or GET
I"m running: Windows Xp SP2 Apache2 PHP5 MySQL4 Everything seems fine and dandy, and I can do scripting on server side, but for some reason I cannot get data from a form to be put into a variable. I have a simple form in an html page which submits, and in the php script that handles the input, none of the data in the form is going into the variables. My php.ini file does have all the GPC's in place(ie variable_order, the way they get processed).
Showing A Different Page When A Variable Is Passed
this is the code i have just now <? include 'code.php' ?> //where variables are kept <? $welcome = $_REQUEST['welcome']; $leave = $_REQUEST['leave']; if ( $welcome ) echo $page['welcome']; if ( $leave ) { echo $page['leave']; { } else { echo $page['redirect']; }?> what i want to do is, if the variable passed is "welome" i want it to show a welcome page and if "leave" is passed i want it to show a leave page, and when no variable is passed i want it to redirect to a totally different page like this: index.php?welcome Show welcome page index.php?leave show leaving page index.php redirect to a different page
Encrypting Variable Values Passed Thru A Link In A Web Page
I am working on a project in PHP / Mysql on linux platform. The project has a login page where any registered user is supposed to login before he/she can have access to some major functionalities in the project. Since I need to check the authenticity of the user in other secured pages, I have to carry forward the username with which he/she has logged. As I am doing so, the username is appearing in the url. This of course is a major security lapse.
Eliminating Frames
I have a html thing with a frame. The top has buttons controlling the site and the bottom has info. I get the redirection working but don't know how to get rid of the bottom frame. What happens is that the top frame gets stuffed with the second pages stuff an dhte bottom frame stays static. If I could eliminate the second frame when I redirect, it would work perfectly.
Pulldowns (eliminating Doubles)
I have one table with (amongst others) SUBJECTS. Now every user has subjects so there are doubles (user 1 has NEWS, user 2 had NEWS). On 1 page I want a pulldown that lists these subjects and currently I'm using this: $q = "select onderwerp from mailupdate;"; $r = mysql_query($q); echo "<select name="onderwerp">"; for($i=0;$i<mysql_num_rows($r);++$i) { $arr = mysql_fetch_row($r); echo "<option value="".$arr[0]."">".$arr [0]."</option>"; } echo "</select>"; But I want to eliminate the doubles (just one timme NEWS and not every time it appears in the table.
Eliminating File Extensions
I would like all of my webpages to stop displaying the ".php" or ".html" extensions. How do I do this without rewriting the URLs?
Eliminating Spammers From Adding Records?
I have a website that allows users to add records for their events. Recently I've had a bunch of spammers coming in. Do you have any tips on how to keep them from entering bogus information. I have started checking for any "http" in some of the fields but I want to make it even harder for them. Is there a way to check what the referring page is and if it is not the right one to produce an error?
Listings In Alphabetical, What About Numbers And Other?
I'm using PHP and mysql so when you click on a link that says A, you get all the titles that start with A. However, how would I do this with numbers and anything else that’s not in the alphabet? I tried doing 1,2,3,4, etc but It caused errors. What SQL code should I use?
Sorting Directory Listings With Php - Doable?
Curious to see what I can do with php in terms of getting a directory listing and sorting by name, size, and date modified. I looked at a few functions on php.net, but nothing struck me as what I needed. Note, there are several hundred files in the target directory... loading filenames, sizes, ect into arrays may not be a good solution here.
PHP Nightmare.....Integration Into EbaY Listings
I've been searching all day for a method on how to integrate the listings off ebaY onto my website, but I have had no joy whatsoever. I want to be able to open a listing based on the the item number, which I can do simply by using, $ITEMNUMER = ("blah"); http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=$ITEMNUMER but, I cannot use include(); to achieve what I want to do, because a) it is having trouble including external webpages b) the ebaY listing is generated upon arrival, so theres no way it could interperate it. I've been trying all kinds of fopen(); techniques, but nothing seems to be able to open the page, because (I assume) it doesn't exist till an actual browser visits it, and it calls it values from the ebaY database. So, I tied using the ebaY API, but I'll need to pay a hellish amount to use it, so it seems out the question. What I really want to do is have a script check a listing for some text. But, as I cannot get PHP to open the file, I'm stuck ! If anyone knows a way how I can strip some information out of an external web page using PHP -
Newbie: If Then Statement And Expiring Listings
I've tried a couple of variations of coding this but i still haven't gotten it down. basically my query pulls all the tables within a certian search criteria. When it shows the listings it shows a space like: Name Address city, state zip phone: <blank space> url right now this is the code i have:
Sending Multiple Variables Via URL
Hi, to send a variable in the url, I would use this syntax: address.com?variable=data What syntax do I need to use to send several variables through using the URL address?
Passing Multiple Variables Using GET
I have a problem where I need to pass two variables using GET from a form I have, to solve a page selection problem I have. The code is written that if a new visitor arrives at the front page of the site, because the page id is null, PHP loads the default design. But when I execute one of my other pages which has a form on it, because I cannot pass back the id of the page that the form is on (the "submit" GET's the desired page id only), instead of calling the new page, it executes the "null" part of the script again. Despite the GET having a different id (track), it refuses to execute because the page == null code. The variable of the page needed to be displayed is GET'ed (it's in the browser URL, and an echo statement in the PHP confirms the value GET'ed, and lack of the original page id. How can I get the code to pass both the page id and the data of the selected form item at the same time? The PHP <? if ($_GET['page'] == NULL) { echo $_GET['track']; //value passed from the HTML form echo $_GET['page']; //value of the page id include ("index2.php"); } elseif ($_GET['page'] == index) { header ("Location: /index.php"); } elseif ($_GET['page'] != index) { include ("html/".$_GET['page'].".shtml"); } elseif ($_GET['track'] == a01-t01) { include ("html/lyrics/".$_GET['track'].".htm"); } ?> The form HTML <FORM method="GET" action="../../index.php" name="myform01"> <select name="track"> <option value="a01-t01" SELECTED>Track 01</option> <option value="a01-t02">Track 02</option> <option value="a01-t03">Track 03</option> <option value="a01-t04">Track 04</option> </select> <BR><BR> <input type="submit" value="Go get the lyrics"> </FORM>
Multiple Variables To Array
I have a problem where I need to add a number of variables (the number varies, but all the variables have a similar name - e.g. $rm2, $rm56, $rm6783 (they all start with 'rm' followed by a number)) to a single array. In other words, I need to add all the variables that start with 'rm' and followed by a number (e.g. $rm2, $rm56, $rm6783) to a single array.
Session Variables Across Multiple Pages
I'm busy fiddling with sessions under PHP5, and very quickly learned what I would have found out even sooner in the PHP manual - declaring your session variable on page1.php makes it available on page2.php (assuming that's the next page you load) but doesn't then make it available on page3.php unless you respecify it on page2.php. I'm sure there's a very good reason for it, and I know I can get around it by using a database and the session ID, but I would really like to know: why? I've already searched, but can't find any more information on the issue.
Reading Multiple Variables From One Cell
I'm currently using a text file to store some variables: $var1 = "value1"; $var2 = "value2"; $var3 = "value3"; I was thinking of writing these to a single mysql cell instead, i.e. a table contains a field called 'vars' and all the variables are written to the single mysql cell: $var1="value1"; $var2="value2"; $var3="value3"; Tricky part, how do I read the individual variables? I can read the field 'vars' as a variable, but I want the individual variables inside the 'vars' field.
Multiple Variables Set In A Cookie? NEWBIE
here is my situation; We have a form that gathers some information from a user ( name, email, street address), plus some samples of our product. what i would like to do is set a cookie that will store name, email, and what sample type they choose ( they can choose from one of three ). My plan is that when the customer returns to the site, the product specials will vary based on sample selections. I had a couple of ideas of how to do this but would like some feedback/advice from some pros. 1. A cookie sets name, email ( for list removal purposes), and sample type choosesn, I tried this a couple times and couldnt' get multiple variables, set to the cookie. 2. A mysql Database houses the customer data and a cookie sets the ID for the customer ( which is automatically set from the db), when the client returns the site reads the cookie of the customer entry, and recalls any data that the site needs.
Selected Item To Use For Multiple Variables
I've got a list of 'items' and those 'items' have unique 'categories'. I have 1 table for 'categories' that contains a list of category_ids and their 'category_names'. The other table is the 'item' list. And here's where I'm running into difficulty, I'd like to have the 'item' table contain the category_id from my 'categories' table as a Foreign Key and that category_id's 'category_name' in a 'category' field. I'm getting the Foreign Key, but I can't seem to grab the 'category_name' and assign it to my $category variable in the 'item' table. I've got a page to insert items and a page to update these items. I was working with the update first. And I'm able to grab the list of categories and select the correct one, but I'm not seeing where to assign the category_name to the $category variable. Here's dropdown list: Code:
Multiple Variables Eregi Check.....
This is an easy one I think but I just can't do it for some reson - I want to check more than one variable on the same line, not just address, but can't work out the syntax to do this... ie. So this code........ $crack=eregi("(to:)|(from:)|(cc:)|(bcc:)",$address); does this........ $crack=eregi("(to:)|(from:)|(cc:)|(bcc:)",$address and another variable); I want it so that if any of the variables meet the criteria set in the eregi function then $crack will be true (or 1).
Error In Page When Checking Http_get_vars("myvar") And "myvar" Was Not Passed In URL String
PHP, coming from ASP coding if (HTTP_GET_VARS['b']==1){ print "Yes"; }else{ print "No"; } when "b" is not passed via (http://www.mydomain.com?b=1 an error occurs and the "NO" is printed but an error is printed too. How can I check for the value of "b" so that no error occurs if b is not passed?? example http=www.mydomain.com $myvar=HTTP_GET_VARS['b'] causes an error because "b" does not exist (ie. its not passed in the URL string. $myvar maybe evaluated as NULL or Empty but the error is printed in the page, anyway.
Searching A Mysql Column Against Multiple Variables
I have an array of zipcodes which I am trying to check against a mysql table. I want to search in the column "zipcode" in a table of a bunch of entries. I want to search each rown to see if the value of the zipcode column is listed within my array. This could be said vis vera, that I want to check the mysql table to see if any of the rows have one of the values from the array inside the zipcode column. I've tried the statement "select * from table where zipcode IN ('$zipsearch')", but it seems to return an odd sequence of data. It doesn't seem thurow enough. similarly the entire statement is : select * from table where description like "%$trimmed%" OR title like "%$trimmed%" AND zipcode IN ('$zipsearch') order by date" I can't seem to get the statemtent to break up my requests right so that the logistics of teh statement are : select from table where (descriptions like variable or title like variable) AND <zipcode search problem>
Carrying Over Variables From A Form To Multiple Pages...
I have some data from text fields that are being passed over through a form that I am displaying with the $_POST superglobal. Once i have echo'd out this data onto the next page, i'd like to continue to use it on the next page. I haven't figured out how to do this properly just yet, but I'm guessing it has something to do with sessions. I have MANY variables being passed (over 100) and I'm hoping i don't have to register each one of these manually with $_SESSION[]. example. //first page (index.html) <form action="form.php" method="post"> <select name="color"><option value="blue">blue</option><option value="red">red</option> <input name="submit" type="submit"> //new page (form.php) <?php echo "Bill's favorite color is {$_POST['color']}"; ?> //// Now say I want to use this $_POST['color'] value on another page that the form.php takes you to next.....how do i continue to use this value across multiple pages? I'm assuming this is a trivial question, but i can't seem to figure it out!
Parsing Multiple Checkbox Variables Into A Database
I'm creating a page that includes check boxes that are pulled from a MySQL database. the user should then select which boxes they want, and then the values should be wrote back to the DB. however when the check boxes are returned they are all returned as the same value name, choice =1&22&choice=3%22 and so on. how can I parse this so that I can store the choices in the DB?
Insert Multiple Variables Into A Database Quickly
I've just started using PHP and have written a small script to insert 10 variables into my database, e.g: $query = "insert into items values ('".$q1."', '".$q2."', '".$q3."', '".$q4."', '".$q5."','".$q6."', '".$q7."', '".$q8."', '".$q9."', '".$q10."')"; The problem is, I will eventually need 300 questions so I don't want to list them all individually. How can change this snippet of code so that it says something along the lines of "please insert all the variables q1-q300 into the database"?
Multiple Query Variables Based On Str_word_count
I am attempting to split an input string using the str_word_count function to return multiple single word query variables. I can create an array based on $search=(str_word_count($search, 1, ?')); (I want words and/or numbers). I can extract named variables from the resulting array via $search=extract($search, EXTR_PREFIX_ALL, search); and then call each variable by $search_0 $search_1 $search_2, etc. Several issues that I am having: Since the size of the array is determined by user input. I can't hardcode $search_x, $search_y, etc. because I don't know what x, y, etc. will be. How can I produce $search_x... et al. and then hand it/them to a query string? I can echo desired output using for or while loops, (i.e. the *value* of $search_x...et al. but I can't figure out how to get them into query strings. I want my query strings to contain something like $q=" SELECT * FROM * WHERE table1.row1 LIKE '%$search_x%' OR LIKE '%$search_y%' etc..."
Posting Multiple Variables To $_POST Using HTML Forms
This is my code : <FORM ACTION="php_steptwo001.php" METHOD="POST"> <INPUT TYPE="HIDDEN" NAME="duration" VALUE=3> <INPUT TYPE="HIDDEN" NAME="banner" VALUE="test"> <INPUT TYPE="SUBMIT" VALUE"3 DAYS"> </FORM> Only the 1st Variable 'duration' gets passed!
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?
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!'>" ;
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.
Variables From Another Page
I am working on something and was wondering if the following is possible... ( I have tried it and am getting a blank instead of the value required). Do I have to declare the name variable in Page1... or is there a way to go around it?.. One solution could be sessions...but Is there another solution? Code:
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.
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:
Transfer Variables To Another Page
I have a script that on the first page is a form for users to fill out, when they choose to submit the form it goes to another page that actually processes the form to my MySQL database. ATM I use statements like this to carry over those values: $article_author = $_POST['news_author']; Is there a better or more effecient way to do this? It's not too bad on a short form, but typing out all those lines for a long form is tedious.
|