i have a page first.php in this i have 7 veriables like $1, $2, $3, $4, $5, $6, $7. i have another page second.php i want to pass some variables from first.php to second.php.
with out using the form submission.
is there anyway.
i have a page first.php in this i have 7 veriables like $1, $2, $3, $4, $5, $6, $7. i have another page second.php i want to pass some variables from first.php to second.php.
with out using the form submission.
is there anyway.
You'r best bet would be to use either sessions, cookies, or by using the GET method (second.php?1=$1&2=$2...). If you were to use sessions, you could do something like the following:
first.php
Code:<?php session_start(); $_SESSION['1'] = 'variable 1'; $_SESSION['2'] = 'variable 2'; //rest of code ?>Hope this helps.Code:<?php session_start(); echo $_SESSION['1']; echo '<br><br>'; echo $_SESSION['2']; //rest of code ?>
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
thanks.
i have link in first.php
<a href="second.php?id=<?php echo $1; ?>">CLICK HERE </a>
by this i can get the $1 variable in second.php
like this.
<a href="second.php?id=<?php echo $1; ?>&two=<?php echo $2; ?>& ">CLICK HERE </a>
am i rite....
plz reply me the exact code for that GET method.
That is how you would send the variables to the second php page, yes. Then in the second php page; in order to extract those variables, you would want to do something like this:
Hope this helps.Code:<?php $1 = $_GET['id']; $2 = $_GET['two']; //and so on ?>
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
thank you
$1 is invalid, by the way. Must start with a letter. (Or, system variables use the reserved _ start, like $_GET.)
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks