How to pass the URL via GET method?
Moderator: General Moderators
-
charoo1983
- Forum Newbie
- Posts: 4
- Joined: Sun May 24, 2009 11:57 pm
How to pass the URL via GET method?
Hello !
Plz hep me out. What will be the procedure to pass the URL via GET method.
Like-
If I make a form of Name & Email address and Submit button.When the user fills name, email and click submit button the next page should be of Thankyou page which will take the user directly to my offer page.
Looking fwd for earliest reply.
Thanks & Regards,
Charoo
Plz hep me out. What will be the procedure to pass the URL via GET method.
Like-
If I make a form of Name & Email address and Submit button.When the user fills name, email and click submit button the next page should be of Thankyou page which will take the user directly to my offer page.
Looking fwd for earliest reply.
Thanks & Regards,
Charoo
Re: How to pass the URL via GET method?
Hi Charoo,
I'm not sure what you mean by the first question.
Page 1:
This will page all variables across to 'page2.php' which are accessible via GET...
Page 2:
Hope this helps.
Mike
I'm not sure what you mean by the first question.
But I can help you with the later.Plz hep me out. What will be the procedure to pass the URL via GET method.
Page 1:
Code: Select all
<form action="page2.php" method="get">
<label for="name">Name</label>
<input type="text" name="name" id="name" />
<label for="email">Email</label>
<input type="text" name="email" id="email" />
<button type="submit">Continue</button>
</form>
Page 2:
Code: Select all
<?PHP
echo 'Thanks, '.$_GET['name'].' for registering with the email address: '.$_GET['email'].'.';
?>Mike
Last edited by Benjamin on Tue May 26, 2009 10:33 am, edited 1 time in total.
Reason: Changed code type from text to php.
Reason: Changed code type from text to php.
-
charoo1983
- Forum Newbie
- Posts: 4
- Joined: Sun May 24, 2009 11:57 pm
Re: How to pass the URL via GET method?
Thanks Mike
for the earliest reply. Well I just want to know there is some procedure from which website address can be made passed...
Re: How to pass the URL via GET method?
Again I'm not 100% sure what you're after.
If you want the full website address (http://www.example.com/page.html?this=is&a=query) then here is a function you may find useful.
If you want the full website address (http://www.example.com/page.html?this=is&a=query) then here is a function you may find useful.
Code: Select all
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
}
Last edited by Benjamin on Tue May 26, 2009 10:33 am, edited 1 time in total.
Reason: Changed code type from text to php.
Reason: Changed code type from text to php.
-
charoo1983
- Forum Newbie
- Posts: 4
- Joined: Sun May 24, 2009 11:57 pm
Re: How to pass the URL via GET method?
Mike I just want to connect my website through GET method...
Re: How to pass the URL via GET method?
You're going to have to explain exactly what you're trying to do, you've asked for 3 different things now and I've given you good, thorough answers to each of them - explain exactly what you mean and what you're trying to do. To me 'connecting to my website through get' means using sockets to grab a webpage using GET - but I doubt that's what you're after if you're on about registration forms 
-
charoo1983
- Forum Newbie
- Posts: 4
- Joined: Sun May 24, 2009 11:57 pm
Re: How to pass the URL via GET method?
Do you have skype ID?
Re: How to pass the URL via GET method?
I'm afraid not no. I'm behind all sorts of anti-freedom devices (firewall, etc) too so it wouldn't work even if I did.
Just post here so that others can help too.
Just post here so that others can help too.