HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
PHP hyperlinks/links scripting: How to?
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
xdefconx



Joined: 22 Mar 2006
Posts: 38

PostPosted: Mon Apr 23, 2007 3:37 am     PHP hyperlinks/links scripting: How to? Reply with quote

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

PostPosted: Tue Apr 24, 2007 2:56 pm     Reply with quote

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.

PostPosted: Tue Apr 24, 2007 3:20 pm     Reply with quote

Its using one of PHP's global arrays...

Code:
$_GET['varName'];


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

PostPosted: Tue Apr 24, 2007 11:12 pm     Reply with quote

Keikura wrote:
Its using one of PHP's global arrays...

Code:
$_GET['varName'];


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

PostPosted: Wed Apr 25, 2007 8:59 am     Reply with quote

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

PostPosted: Wed Apr 25, 2007 10:41 am     Reply with quote

~*still blurry*~ huhuhuh
Keikura



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

PostPosted: Wed Apr 25, 2007 12:50 pm     Reply with quote

This may explain it better...

$_GET and $_POST are what your most interested in ATM.

http://uk3.php.net/manual/en/reserved.variables.php
Pattons3rd



Joined: 28 Dec 2006
Posts: 1212
Location: Colorado

PostPosted: Wed Apr 25, 2007 1:50 pm     Reply with quote

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

PostPosted: Thu Apr 26, 2007 2:40 am     Reply with quote

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

PostPosted: Thu Apr 26, 2007 10:04 am     Reply with quote

No problem! Very Happy
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial