Simple button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dave_c00
Forum Commoner
Posts: 37
Joined: Wed May 28, 2003 6:08 am

Simple button

Post by dave_c00 »

Hello,

Please excuse my noviceness, but i have a simple page with a variable in php called $worksord. I would simply like to submit that value into the next page at the click of a button.

I cannot seem to pass it across to the next page?

Thanks

Dave
zenabi
Forum Commoner
Posts: 84
Joined: Mon Sep 08, 2003 5:26 am
Location: UK

Post by zenabi »

Use something like this:

Code: Select all

<a href="www.yourdomain.com/nextpage.php?var=$worksord">Next Page</a>
On nextpage.php retrieve the variable by using:

Code: Select all

$_GET&#1111;var];
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

zenabi wrote:

Code: Select all

$_GET&#1111;var];
Actually, retrieve it like this

Code: Select all

$_GET['worksord']
Please read Array do's and don'ts - Why is $foo[bar] wrong? for explanation.

Mark
dave_c00
Forum Commoner
Posts: 37
Joined: Wed May 28, 2003 6:08 am

Post by dave_c00 »

My variable $worksord has a value but when i do this the it goes across as $worksord... Do i put speech marks around it??
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

zenabi's first code line was intended to be inside an echo of sorts..

Code: Select all

echo '<a href="www.yourdomain.com/nextpage.php?var='.$worksord.'">Next Page</a>';
dave_c00
Forum Commoner
Posts: 37
Joined: Wed May 28, 2003 6:08 am

Post by dave_c00 »

thanks!!
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Bech100 wrote:
zenabi wrote:

Code: Select all

$_GET&#1111;var];
Actually, retrieve it like this

Code: Select all

$_GET['worksord']
Please read Array do's and don'ts - Why is $foo[bar] wrong? for explanation.

Mark
I didn't know they were adding "worksord" to the predefined constants soon, thats good to know. ;) jk
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

LiLpunkSkateR wrote:I didn't know they were adding "worksord" to the predefined constants soon, thats good to know. ;) jk
Eh? :?
Post Reply