4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 pass variables to a php script via a link
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
domuk
WebHelper
WebHelper


Joined: 15 Jan 2004
Posts: 91

PostPosted: Sat Jun 12, 2004 4:27 pm (13 years, 4 months ago) Reply with QuoteBack to Top

Hi, I am looking for a tutorial, but I am not sure what to search for.

What I want to do is understand how to pass variables to a php script via a link sent to someone in an email.

I am trying to write an email validation script and I think this is a possible way to do it.

An example of this taken from this phpbb is:

http://www.4webhelp.net/forums/posting.php?mode=newtopic&f=5

I am not sure what is happening after the “?” I assume that the data after is assessed by the php script “posting.php”.

If I wanted to pass a variable $age=2 and $sex=”m” to the script would I use:

http://www.4webhelp.net/forums/posting.php?$age=2&$sex=m

or am I totally wrong?

I need help with this.

Thanks,

Dom.
OfflineView User's ProfileFind all posts by domukSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Jun 12, 2004 5:41 pm (13 years, 4 months ago) Reply with QuoteBack to Top

Hi Dom,

The name of a variable does not include "$": when used, the $ sign is to identify the name which follows as a variable name.

To set $age = 2, simply call up the URL "script.php?age=2".

To set $age = 2 and $sex = "m" call up the URL "script.php?age=2&sex=m".

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
domuk
WebHelper
WebHelper


Joined: 15 Jan 2004
Posts: 91

PostPosted: Fri Jul 02, 2004 3:02 pm (13 years, 3 months ago) Reply with QuoteBack to Top

thanks Daniel.. Wink
OfflineView User's ProfileFind all posts by domukSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.048854 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme