| View previous topic :: View next topic |
| Author |
Message |
xdefconx
Joined: 22 Mar 2006 Posts: 38
|
Posted: Mon Apr 23, 2007 3:37 am PHP hyperlinks/links scripting: How to? |
|
|
|
Hye again!
I got some basic PHP scripting here. Let say like this on normal HTML scripting code is like this:
<a href="clikme.php">ClickMe!</a>
But on PHP how i can do with some "longer url/ID" let say like this:
<a href="index.php?whatever=whatever">clickMe!</a>
Our senario is, both of script above is hyperlink with a same file.
Thanxs |
|
Pattons3rd

Joined: 28 Dec 2006 Posts: 1212 Location: Colorado
|
Posted: Tue Apr 24, 2007 2:56 pm |
|
|
|
| I think that is either using CGI and databases to make a unique URL or the PHP $_GET[''] function. |
|
Keikura

Joined: 24 Mar 2007 Posts: 167 Location: U.K.
|
Posted: Tue Apr 24, 2007 3:20 pm |
|
|
|
Its using one of PHP's global arrays...
Eg.
fileName.php?var1=joe&var2=blogs
You'd use this to print out the values...
| Code: |
echo $_GET['var1']; // prints joe
echo $_GET['var2']; // prints blogs |
|
|
xdefconx
Joined: 22 Mar 2006 Posts: 38
|
Posted: Tue Apr 24, 2007 11:12 pm |
|
|
|
| Keikura wrote: |
Its using one of PHP's global arrays...
Eg.
fileName.php?var1=joe&var2=blogs
You'd use this to print out the values...
| Code: |
echo $_GET['var1']; // prints joe
echo $_GET['var2']; // prints blogs |
|
Hye Keikura, thanxs for ur help. I really appreciate it. However can someone explain more detail for a stupid newbies like me huhuhu |
|
Pattons3rd

Joined: 28 Dec 2006 Posts: 1212 Location: Colorado
|
Posted: Wed Apr 25, 2007 8:59 am |
|
|
|
| Keikura wrote: |
| Code: |
| fileName.php?var1=joe&var2=blogs |
|
This is saying that the form was submitted with var1(presumably a textbox) having the value of "joe" and that var2 was submitted with the value of "blogs".
Another way to submit information is to use the <form action="post"> instead of <form action="get"> .
That way it won't show anything in the URL.
But the get is useful if you have a search databse or if you want to have a URL that always goes to the same page. |
|
xdefconx
Joined: 22 Mar 2006 Posts: 38
|
Posted: Wed Apr 25, 2007 10:41 am |
|
|
|
| ~*still blurry*~ huhuhuh |
|
Keikura

Joined: 24 Mar 2007 Posts: 167 Location: U.K.
|
|
Pattons3rd

Joined: 28 Dec 2006 Posts: 1212 Location: Colorado
|
Posted: Wed Apr 25, 2007 1:50 pm |
|
|
|
You might want to at least skim the W3Schools tutorial on this.
$_GET and $_POST are basically 2 different ways of doing the same thing. |
|
xdefconx
Joined: 22 Mar 2006 Posts: 38
|
Posted: Thu Apr 26, 2007 2:40 am |
|
|
|
| Pattons3rd wrote: |
You might want to at least skim the W3Schools tutorial on this.
$_GET and $_POST are basically 2 different ways of doing the same thing. |
Ahaa..thanxs for that link i will look forward once i got something to ask i will ask here again.thanxs |
|
Pattons3rd

Joined: 28 Dec 2006 Posts: 1212 Location: Colorado
|
Posted: Thu Apr 26, 2007 10:04 am |
|
|
|
No problem!  |
|
|