Pass The Variable From 1st Page And Read It With Other Name On 2nd Page
I am new to this and learning slowly, but I was hoping someone could give me some quick advice on how to create a variable on one page and have it passed to another to be read as an ID for a mySQL database.
I want to pass the variable "varRevID" from one page and have it read as "reviews_id" on the other.
My database is pulling from just the first record and I would liek to designate from the pointing page which record to pull from.
View Complete Forum Thread with Replies
Related Forum Messages:
How Can I Pass Variable To Next Page?
I have a search page to search the database, the input from user are include 4 items: keywords country catalog date the results are divided into pages by date desc, so there are PREV10 1 2 3 ... NEXT10 to indicate the page number. Then, How can I pass the 4 items and the page number to next page? I don't wont to use urlencode() and urldecode() because there will be long url in IE's address. I try to set the $HTTP_POST_VARS as cookie, so my code:
View Replies !
Pass Variable To Another Page
i know i can pass a variable with POST or GET. but i want to do the following: a user enters wrong login credentials, so i redirect the user to error.php. but i also want to pass the message "login credentials not found!". I could do this with: header("location:index?php?page=error&err=wrong login credentials"); but i don't want the error string to be visible. can i do this another way? POST doesn't seem an option to me as there isn't a form involved.
View Replies !
Pass A Variable In The Url To The Next Page
i am trying to pass a variable in the url to the next page: http://www.xxx.com/xxx.php?at=$price then, on the xxx.php page i would just use the following command to retrieve the variable: $test = $_GET['at']; wouldn't this be correct?
View Replies !
Pass A Variable To A Second Php Page?
I am working on my first multi-page php project, and was wondering how this works. On the very first page I have: <select name="itemtype"> which is given a value of 1, 2, or 3 and passed to the next page by: $itemtype = $_POST['itemtype']; where the value of itemtype is used in a switch statement. I want to use the itemtype variable again, and add it to my database, so the page can remember if the item is a dvd or cd or book. $itemtype = $_POST['itemtype']; Doesn't seem to be working again is there a way to pass this variable?
View Replies !
Pass The Variable Through To Another Page
I am trying to do: Email form gets sent to email.php and then on to thank_you.html. So ... the trouble is ... I lose the variable $green along the way. And what I mean is this: form.html says this: <INPUT NAME="green"> then email.php sends an email and goes here: $redirect_url = 'thank_you.html' But what I want to do is ... IF green is equal to a certain value - I want to display certain text on the thank_you.html page. But, I seem to not have access to $green once I get to thank_you.html. Code:
View Replies !
Changing The Variable As You Pass It Through To The 2nd Page
I am using a form to push variables through to another page. In the form, (a drop down), the code is: <select name="1"><option>L</option><option>P</option></select> Now on the second page I could display the P or the L by saying <?php echo $1 ?> which is fine. What I want is, if someone selects P then it prints 1 on the next page and if they select L then it prints 2. Is this possible?
View Replies !
Session To Pass A Variable From One Page To The Next
I am using a session to pass a variable from one page to the next. The user makes a selection in the first page and that variable is passed from one page to the next via the session. Once they make their selection on the form on the index page and click submit, they are sent to the homepage where the following code is run: <?php session_start(); $pcode = $promocode; session_register("pcode"); if ($pcode == 'tree'){ $text = 'this is stuff I wanna say' }else if ($pcode == ''){ header('location:blank.php'); }else if ($pcode !== 'tree'){ header('location:invalid.php'); } ?> What I am trying to do is prevent the user from having to reenter the variable when they return to the home page. Right now, it is forcing them to the blank page and asking that they reenter the promocode variable.
View Replies !
How To Pass A Variable For PHP To Retrive From The Page Before?
I was doing some mysql database stuff and I wanted to have a pop up window with some other forms on it. The problem I'm having is that I have no clue how to pass a variable for PHP to retrive from the page before. I know I can do a "GET" method to put the variables in the URL but I don't think you can get that variable with PHP.
View Replies !
Read Page To Variable
I have tried tons of functions but none works the way I want. I have a page foo.php. Then in that I set a couple of variables. Now, if I include foo.inc.php that file can use all of these variables. Code:
View Replies !
How To Pass Variable To Another Page Into A Hidden Field In The Form.
I have a script to tell whether a domain name is available or not. The code redirects to the php script and displays the results in a template file called "whois.html". Then on the page that displays the results, I want to have a link to go to the next page. I want to pass the variable that contains the selected domain name called $domain.$ext. I need to know how to pass that variable to another page into a hidden field in the form.
View Replies !
Pass An Email Variable From A Signup Form To A Second Page
I am trying to pass an email variable from a signup form to a second page, before finally posting the output to an order form. The first form will look like this: <head> <title>Form</title> </head> <body> <form action="signup2.php" method="post" target="_self"> email: <input name="email" id="email" type="text"><br /> <input type="submit"> </form> </body> </html> There is a second form submission on "signup2.php" that points to a particular header redirect. I don't understand how to get the email variable from a text box on the form that posted to "signup2.php" into the header redirects as shown in the code below......
View Replies !
Read Txt File And Pass Each Line As Variable In A Function
I'm designing a website that is update several times a week with a new gallery of images. Each set of images is stored in it's own directory with a page that generates a gallery and textually describes the images in the directory. I want to create a page that reads from a list of the image directories and dynamically generates a link to each gallerey, 10 to a page. something like this: directorylist.txt index.php reads directorylist.txt, places the first gallery listed at the top of the page, then 9 more links to the next 9 galleries. At the bottom of this page, links to the pages that contain galleries 11-20, 21-30, etc. I have already created functions that take the gallery ID and generate the links, I just can't seem to figure out how to read from the text file, then generate the links in my main pages.
View Replies !
Set The Session Variable To Read The Session Variable In The Next Page.
I have a PHP web app, that runs with Register global off. It sets $_SESSION variables that are used in other pages. The script works fine on my server that runs Apache2 and PHP 5.0.1. But when I move the scrip to my hosting company that runs , IIS and PHP5.0.2, they don't work. It seems that its not able to set the session variable to read the session variable in the next page. cvWhat should I be checking ? Has anybody faces this situation before ?
View Replies !
Pass A Value From One Page To Another
I am currently migrating from an asp environment to php and need assistance converting my scripts. I am trying to pass a value from one page to another. with asp, i use the following: First page: <form name="form1" method="post" action="XXX.asp"> <select name="ABC" id="ABC"> <option value="na">a</option> <option value="b">b</option> <option value="c">c</option> <option value="d">d</option> </select> <input type="submit" name="Submit" value="Go"> </form> Second page: named XXX.asp code: <a href="http://www.example.net/click-123-456?SID=<%=request.form("ABC")%>" target="_blank">DEF </a> What PHP code will place the value of the selection (A,B,C, or D) in the <%=request.form("ABC")%>" spot?
View Replies !
How To Pass Session Id To Another Page?
I have a script for loggin to a site. My problem is that I want to pass the session Id to another page but I dont know how to do this. what is the correct way to pass another page the session id for security issues? my another page is: pagina_entrada.htm in this page I have the script for checking if it is the real session id if not it is refused the page This is the script in each page belong to site. All pages has this script first. Is tthis correct? Code:
View Replies !
How Do I Pass An Object To Another Page?
I have 1 page with products on it which users add to a shopping cart using a shopping cart class. The class stores the users products into sessions which works great but I need to be able to display the cart contents on my checkout page using my display cart function. Do I need to pass the shopping cart object and if so how do I do it? PHP Code:
View Replies !
Pass An $id Value From One Php Page To A Form
At the moment i am trying to pass an $id value from one php page to a form which then gets inserted into the database. The problem is that the value inserted into the database does not equal the value that it should, it always equals "0". Here's what i've got so far. On the php page that sends the variable to the edit.php page i have the following script: PHP Code:
View Replies !
Trying To Pass An Identification From One Php Page To Another
I am trying to figure out how to pass an identification number that is generated before the user logs into the system (as they select a job that they are applying for) but is needed after to fulfil their initial request. They can search for jobs but they can't apply for them until they log into the system - thus the identification number of the job they are applying for needs to be passed onto the next page as they either log in or register. I need this identification number (originally retreived from a MySQL database) to be passed through possibly upto 3 pages before it reaches its destination. i also need to be able to send it back to the database on the final page. Is this possible? or is there a better way of doing it? if so how would i go about undertaking it?
View Replies !
Pass XID Via A Session Along Each And Every Page
the user sets up the account and adds each subuser as part of his "group". they share an XID inside the database. so user XID = 001 and subuser XID=001 so i know they belong to the same group. I want to be able to pass this XID via a session along each and every page. So one of my functions in my application would be to list all submembers with this XID. when the main user signs in, how can he carry this XID over every single page he visits? (There is no telling when the main user wants to perform the function above) So login would include username and password, but in the background i want the XID to be passed along somehow after login. So obviously the username password and XID would be in the same table. Would i pass information in an array? how does the script know to hit this one table. I guess im having trouble putting 2 and 2 together.
View Replies !
Pass Array To Same Page
im using the followig code where $e is an array: <a href="admincourse.php?addall=addall&month=$month&year=$year&courseid=$courseid&d=$e"> but its not being passed as an array its being passed as some text "array", what is the correct way to sort this?
View Replies !
Pass An Array From One Page To Another
I'm trying to pass an array from one page to another and display it's contents on the next page. This is the code I am using $var1 = $_GET["name"]; foreach($var1 as $value) echo $value; I keep getting this error "Warning: Invalid argument supplied for foreach()in..........."
View Replies !
Pass Variables To Another Page
I have the following line in one of the pages I made: echo("<A HREF=$PHP_SELF?deleterecord=$recordid>" ."Delete this record</A>"."</li>"[smilestopper]); ($recordid is the unique id of a record i have in a mysql table) When I load the page and choose to delete from one of the links the page reloads but the record is not deleted as it should be from the code I have at the beginning of the page. The whole problem, i think, is that the value is not passed when the page is reloaded, which i have seen by adding at the beginning the command echo($deleterecord);.
View Replies !
Is It Possible To Read ASP.NET Web Page In PHP?
Is it possible to read another web page in PHP? If is ASP.NET, the code would be ------------ WebRequest req=WebRequest.Create("http://www.microsoft.com"); WebResponse res=req.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream()); String Output=sr.ReadToEnd(); Response.Write("The content is : " + Output); --------
View Replies !
Read A Web Page
i want to store(read) the contents of a "web page" into a file. how can i do it in PHP. Please help me. The web page contains a table. i want to fetch & store the contents of that table into a file.
View Replies !
Pass An Array To The Next Page In A Form
I have an eccomerce site that has a shared secure server this causes problems with my sessions because as soon as you go to the secure server it obviously starts a new session because it is on a different server. Firstly is there a way to stop this. Secondly if not can I easily pass an array to the next page in a form, I don't think this is possible don't all items have to be displayed in the form, each item in the array needs a form field (hidden) in order to pas sit to the next page.
View Replies !
Pass Upload Page Variables
As I sure will become obvious with the asking of this question, I am new to programing.... I have copied and pasted my way to a successful file upload page and have built some rather ugly if elseif loops that read the file and extract the needed data from it. While the data is being parsed from the uploaded file a string variable is being built that holds some details of the process. All of this happens when the user clicks the upload button on the form. Now when all this code is finished running, I ASSUME the page reloads, because my string variable seems to be empty. So, my question is how do I keep this variable so that I can print it to the form when the process is finished?
View Replies !
PHP/SQL Pass Value To Field On Linked Page
I have setup an sql table containing project data (job no, description, date and auto-number id) which displays in rows on my main page. Next to each project is a link which a user can click to submit their details to show interest in that particular project. When they click this link they are taken to another page with a contact form, but I need to automatically show the job no of the project they selected in this form. I have successfully got the job no for the 1st record in the table into the field but need to make it dynamic.
View Replies !
How To Pass Data To Linked Page ?
when a user clicks on a hyperlink i want to pass data to linked page. but what i want is that this data should not be visible to user. i mean is there any way that i can pass data except get method when user click on hyper link?
View Replies !
How To Combine And Pass Data In One Page?
I didn't know what to use as a title for this. Here is the scenario: I have a op.reqedit.php page. This page a form where you input data. In this page I have split a MySQL field. It is called MachineTypeOfWork and is split into Replace, Adjusted, REbuild, Inspected and Repair. These all become check boxes for the user. The form submits to op.reqadd.php. In this page I first have a hidden box where I combine all of the above into Type (this works fine, I have unhidden the box to see it). Then I have $MachineTypeofWork = $_GET['Type']; $sql_query = mysql_query("UPDATE results SET (a bunch of fields) MachineTypeOfWork='$MachineTypeofWork' WHERE WorkOrder = '$wo'") or die (mysql_error()); My problem is that it updates all of the fields it should except the MachineTypeOfWork field in MySQL. It actually overwrites what is already there with nothing. What I do not know (I am new) is can I combine the field and pass it to the database in the same page or do I need another page in the background for this?
View Replies !
Pass The Session Variables To A Second Page.
Ive got a problem with our server. I checked it and i cant login to our webmail(horde) and all other sites that requires logging in. So far i think it has something to do with session variables not being written or not being able to pass the session variables to a second page. Error messages: Undefined index: uid Undefined index: sid Here's our server specs: Linux Dedicated server Fedora Core 3 Plesk 7.5.4 PHP 4.3.11 Im not that well versed with handling servers to i dont know were to start.
View Replies !
Radio Button - Pass It To The Next Page
I have a radio buttons form on a page and when I pass it to the next page I want the code below to be able to detrmine which one has been chosen. So if "Currently In Place" has been chosen I want the screen to echo "X" but not the others. if($_POST['myradio'] = "Currently In Place") { $s= "X"; } if($_POST['myradio'] = "Required Essential") { $t = "Y"; } if($_POST['myradio'] = "Required-Recommended") { $u= "Z"; } echo $s,$t,$u;
View Replies !
Pass Variables From One Page To Another Without Using Sessions?
How would I pass variables from one page to another without using sessions? I already have it set up in a very innefficient way, I make a form with hidden variables be submitted and pass the data on, then retrieved with $_POST. However, I want to get away from this messy solution. Is there a way to pass the variables on and be able to recover them in the next page?
View Replies !
How To Get Rec Id And Use Header() To Open New Page And Pass Rec Id
1. After the record is inserted I would like to open page_add.php and pass the record id (there is an auto_increment field in the table called ID) to the new page "page_add.php". I was thinking of using header() to open the new page and passing the id as parameter (i.e. page_add.php?rec_id=what ever) is there a better way to do this? 2. how would I get the record id after I store the new record? 3. Also not sure how to write header() with a variable in it? Code:
View Replies !
How Do I Pass The Users Name To Another Php Page And To The Sql Query?
i have this simple project of member directory in which user enters the detainls like name address age email etc. through a html page then the details are displayed through a php page. now in this page when one clicks on a user name i have to show the details of that user only. how do i pass the users name to another php page and to the sql query?
View Replies !
Pass Variables To Included Page
I have 7 div boxes in my index.php #searchbox inside #leftbox contains a searchform. When a search is submited, index.php reloads and variables are passed. (I checked, this step works) If the search was initiated the reloaded index.php then includes a Search_and_display_script.php in #contentbox But the variables is not passed (or available) to the included Search_and_display_script.php file, thus no results are displayed. I know that The Search_and_display_script.php works fine independently, but not when included in index.php.
View Replies !
Read A Web Page And Then Display
I'd like to read a webpage, the parse it and display a small part of it. Here is what I've tired. It isn't working. <?php $handle = fopen("http://www.yahoo.com/", "r"); $contents = fread($handle, filesize($filename)); echo $contents; ?>
View Replies !
|