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 Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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:
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.
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?
Changing Variable Folder Names To Php Variable
Let me just show you quickly what I mean: The site url: http://www.nothing.com/vr/ will then redirect to http://www.nothing.com/index.php?sec=vr I'm just wondering if this is possible. The folder after the domain isn't an actual folder, but rather a pseudo one, which is then used in a varible. Another example: http://www.nothing.com/test/ -> http://www.nothing.com/index.php?sec=45&desc=test The "folder" has to be variable and so cannot be an actual folder.
Pass Through Variable
I'm trying to create an image gallery, with (of course) for every picture the same javascript-pop-up. Because i use the same javascript, i only want to tell it the number of the image... Below is what i have, and it works: <?php $pic="01";list($width, $height, $type, $attr) = getimagesize("./pix/$pic.jpg"); echo "<a href="javascript:MM_openBrWindow('foto.php?naam=$pic&pic=./pix/$pic.jpg','dames3','width=$width,height=$height') "><img src="./tmb/$pic.gif" height="90" width="90" alt="$pic" /></a>"; ?> But when i copy it, and change $pic="01" to $pic="02", i get an error. (Which makes sense) But how can i tell the same script to take another number.. The best would be something like <?php $pic="01"; print $script; $pic="02"; print $script; etc... ?> $script would be everything of the earlier mentioned coding except for '$pic = "..."' So you'd have to include it, but i can't even get that to work.. (I can't find a way to include php-script by calling it: echo $script)
How To Pass A Variable ?
I use PHP with WML. After a simple form (login & password) I check if they are correct (with MySQL) and if yes: echo ("<card ontimer="lesson.wml">n"); echo ("<timer value="30"/>n"); echo ("<p> Password ".$pass." accepted for login ".$find." </p>n"); what I want is to the next page lesson.wml the variable $find to exist with the value it had here. Meaning I want to keep the login name to the next page. How can I do that??
Pass A Variable?
I have two php scripts. I need to communicate with each other. I am an Action Script developer so i AM php RETARDED. This is my first one that takes my flash variables creates the right directory then write a text doc to it. Next the user is uploading a file. I want that image file to save to the same directory as the text doc wrote too. The only copmplicted part of this is that the user names the directory Code:
Changing Session Variable
I hope this is a simple question...... I need to be able to change a session variable when a wondow closes. Does anyone have any idea how this could be accomplished?
Changing Variable Values
On my server, I have a vars.php file, the contents of this file are: $indexbox = "1"; That indexbox variable will only ever be "1" or "0" What I want to do is change that value depending on a form input.... I know how to use the form variable stuff to get my 1 or 0 value, but I can't write that value to the vars.php file!
Variable Without Changing Site
Is there a way that I can pass a variable to another php script through a button and have that script do some work with that variable while staying at the original page?
Changing Db Within Page
I have a php page that flips between dbs and sometimes it works and sometimes it doesn't... e.g. the first query runs from this db, the second query runs from a different db and then the third query runs from the first db again... the first query will run, the second query will run, but then the third query will not. Each time that I switch to a query that calls a different db, I used include_once "db_whatever"; before the query, thinking that, that would work, but it doesn't... Is there something I need to do to kill the previous db connection prior to moving onto another one?
Need To Pass Variable To Another Window
I have a dropdown on my intranet that list all of our referral partners so when I enter a client I can select who referred them to us. Well, things have been going well and this dropdown now has 200 entries to select from. It is getting tedious to go through all of these, so I was thinking of a way to search them by poping up another window for the search and when the partner is selected it will go in a text field or something similar. However, I have no idea how to pass the variable in the popup window to the regular browser window. Anyone have any ideas on how to do this?
Pass A File To A Variable
if i have template.html, how do i get it so that $whatever = "template.html"; i tried $whatever = file("template.html", "r"); then when i say print ($whatever); it just sez Array.
How Do I Pass A Variable Outside A Function?
I'm building a form with php validation, and I'm quite pleased with what I have thus far, but I have a problem - I can't get it to stop! When there are errors in the form it works beautifully, highlighting the missed fields while retaining the info in the filled-in fields. But if there aren't any errors, I can't get it to take the next step and insert the values into MySQL database. PHP Code:
How To Pass A Php Variable To Exec()
I am trying to do the following : exec ("echo $mail_body | /usr/sbin/sendmail - v achandak@cse.buffalo.edu"); where $mail_body is my php variable...But this only sends out a blank message. The contents of $mail_body are not appended to the message.If i am not wrong, i think we can pass a php variable to exec(). But maybe i am not doing it in the correct manner?
How Do U Pass Variable Between Pages?
I am using windows nt and trying to enter data in a form on one page and then send it to another page to be displayed. The problem is Page one works (entering the data into the forms and sending it) but when it gets to page 2 the data does not display. I am using 'method=get' and the data i entered on the form appears on the url but not on the page. For example, the name entered in page 1 is stored in YourName and should be displayed when i use the following code: Hi <?php print $YourName; ?> . However all that is displayed is "Hi ." Does this sound like a common problem or not/ Any ideas how to fix it?
Pass Variable To Another Script
I need to pass a variable from script1.php to script2.php. The problem is that these scripts use frames and therefore I am able to pass the variable through the URL. It also does not use forms to set this variable, so i cannot pass it this way either. So to simplify I have : script1.php <?php $var1 = value; echo '<href="script2.php">link to script2</a>' ?> script2.php <?php echo $var1; ?> How can script2 find this value?
Declare Variable To Pass To Php
I have a check box on page 1 of an html page with no submit button. There is a list of links that call a php display page from page 1. I want to check the status of the check box from the display page but I haven't found a way to pass the value without a submit function.
Pass Variable To Xpath?
I am trying to find out if there is a way to pass a variable $fquote to xpath ...[qtnum="help"] $fquote would be derived from a form. <?php $s = simplexml_load_file('fishquotes.xml'); $fquote = "245"; $findquote = $s->xpath('/fishingquotes/quote[qtnum="260"]'); ....?> <?xml version="1.0"?> <fishingquotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <quote> <qtnum>101</qtnum> <title>Small Fish</title> <copy>Govern a family as you would</copy> <copy> cook a small fish; </copy> <copy>very gently.</copy> <author> Chinese Proverb</author> <comment>None</comment> </quote> <!--and 450 more quotes--> </fishingquotes>
Changing A Variable Based On Time Of Day
I want to set a value of a variabel $var based on the time of day eg if time is between 10:00pm and 9:00 am set $var = "foo" if time is between 9:00 am and 7.00pm set $var = "bar" if time is between 7.00pm and 10.00pm set $var to "foobar" how do i do this with the timestamp function?
Sessions::Changing Variable Values Within?
Well my site is using a session that contains user info from the log in page. I have in the URL two vars that are used to navigate and to have a multi-language site. The url looks like this: mypage.php?lang=e&group=200&SIDjksdhjsgh34sjh343xxw At any page, the user can click any language and the same exact page reloades. I did this by fetching the URI and using preg_replace() to replace the "lang=e" to "lang=whatever" I would like to put that $lang var into the session (SID). I know how to put it in and all but my problem is this: To integrate this into the session, I'd have to be able to, at anytime, update the $lang variable (in the session) and reload the page. And since the session's $lang var has been updated the user will see his/her language in the following pages. How do I do this? I was thinking of putting the session into cookies but then anyone could copy the cookies and see private forms etc... So with that in mind, should I just leave it as it is now and just make a button that would create a cookie with only the language preference? But I'd love to know how to update a var in a session because now I know is to create the session, add the vars, use them elsewhere, and destroy the session..
Changing Variable Names In A DO Loop
I am having a problem coming up with an idea on how to change a variable name while in a do loop. Example, I have variables $v1 through $v15. Instead of having 15 'if' statements to process each variable, it would be nice to 'bump' the variable name in a loop. PHP Code:
Randomly Changing Variable Values
I have a function which outputs an image to a filename which is specified by a combination of a variable inputted into the function, and a hard-coded location. The variable is being inputted to the function correctly - i placed an echo command the line before the function is called and that value is correct..... however an echo command within the function seems to show a different value. It is this changed value which is being used as the location, not the correct one which is being sent to the function 8081_B12345_53444900_10 becomes 8081_B12345_53444900_14 8081_B12345_53444900_U99 becomes 8081_B12345_53444900_V03 8081_B12345_53444900_aa becomes 8081_B12345_53444900_ae Any idea what is causing this? It shouldn't be my coding as between the two echo commands all that happens is the value is passed to the function.
Changing Password From Web Page
I have a need to allow a 'email only' user to change their password on the system from my home page. Normally the user does not log in. 1) need them to login to confirm user/pass 2) enable them to change pass using the _passwd_ file. Since Apache runs as nobody I need a funtion or two to do the above. NOT using a sql database but just the usual _passwd_ file. using Linix - RH6.0 - Apache with php3_mod I don't mind doing the reading if I know what to read!
Changing Title Of Page
does anyone know how to use PHP to change the title of a page? Let's say my title is currently "GOGOGO" , but I want to add a string "$x" to it so it says "GOGOGO $x", using PHP does anyone know how to do that?
Pass A String Variable Available To Other Pages ?
how do i keep a string variable available, one that is taken from index.php?ref=232 and pass it to page2.php and page3.php so that when they reach page3.php, i can call out this value ? i dont want to use cookies for this as cookies may be disabled /turned off from the browsers. anyone can show me how to do this ?
Pass A Php Script To A Template Variable
I have this: $tpl->assign(TITLE => "king kong"); So, how can i do to assign a php script to TITLE instead text? I was told that it can be done with buffering...What's that?
Pass The Declare Variable Through The Header's
I'm quite new in PHP, just wonder's is it possible to declare and pass the variable through the html header's? Recently one of my client pass me this php code and expecting me to extract the variable from the html header's. Code....
Pass A Variable From An Email Link
I have a set of pages that use a redirect if the user is not logged in. It will send them to the login page, once logged in it returns them to the page they were trying to access. Code:
Pass Variable In Http Address
I'm trying to write a fairly simple php script which looks at a csv text file in the same directory for its data based on a variable that is passed in the address but am really struggling on this.. An example of what the address could be is: http://www.something.com/script.php?field1=1234 The database.txt file will contain something like this: 1234,yes,yes,yes 4567,no,yes,yes 8901,yes,no,no When field1 is 1234, it should then look at the next three fields to determine what result to display. For example, yes,yes,yes should give a result of "I work" no,yes,yes should result "I am disabled" yes,no,no should be "I am done"
Changing Variable String Value On A Link Click
Hi... I'm trying to change the value of my $cat variable when someone clicks on a link that consists of an image and some next I'm not sure how to do this... but I think I need some javascript as well so if $cat="Main" and a certain link is clicked I want $cat="Something else"
Changing Stuff In A Form Field To A Variable
I want to be able to change stuff typed into some form fields into a value so I can upload to a mysql table, then have it displayed on another page. I'm just not sure how to transport the form text.
How To Pass An Array From On Php Page To Another
i want to send an array from one age to another... i am not using a form....so cant use php-trace-vars.. i have variables...in an array and i want these array elements to be visible on next page too...without posting them..how is this possible.
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:
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:
How To Pass The Object Between Page?
I've create a Class Cube which is a object that contain 6 faces in a cube and got functions to turn the cubes in all directions. Here is the code of cube.obj : PHP Code:
Changing Text On Page Via Dropdown Box.
I have a webpage that draws various text decriptions from a mySql database. The description displayed on the page is controlled via a dropdown box. Currently I am using Javascript with a dropdown box (onChange handler) to change the value of a textbox. Can anybody think of a way that I don't have to use a textbox(with its' scrollbars and background)? How can I change the value of a php variable by changing the selected index of a dropdown box?
Changing A More Link Into Page Numbers
I have the following code which I've tried to edit to fit some examples others have posted on here, with no luck. I have a page that displays More and Prev links but not the page numbers. How can I change this code to have page numbers instead of the More Prev? PHP Code:
Access A Secure Page By Changing The Url
how can i stop people getting into a secure logged in page by just typing www.somesite.co.uk/admin/index.php. theres a login set up, but i can bypass it by just entering the url location, this is a major security issue that i need to solve relatively quickly before i publish the pages. what i need/want is if someone isn't logged in it just goes to a page saying "you must be logged in to access this page" then prompts them to login.php.
Changing Titles Per Page With Inc Files.
The way my script is set up now, I have an index.php which calls on inc files. The problem is that each page (inc file) is using the title set in the php.index. My goal is to have a title for each page. I've looked and looked but can't find anything.
Changing An If Statement To Html Page
How do I change the following code from my process page to a new page with the detials on it. I made a html page cut and pasted it into this spot but it did not work. What do I need to change in order for it to be a html page is shows. Code:
Trying To Pass A Variable Inside Square Brackets
I am trying to return the field name in a repeating table section. The field name is $Question_ID If I echo the $Question_ID I get the right answer for the repeating table section, but when I try to a string compaire using the $Question_ID varible I don't get any results. PHP Code:
|