Passing values through POST Method

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
namitjung
Forum Commoner
Posts: 42
Joined: Mon Jun 20, 2005 3:17 am

Passing values through POST Method

Post by namitjung »

Hi all,

Is it possible to pass values using post method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank Youand it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.
ght way please let me know.

Thank You method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this vaalue from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank Yout value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank Youthod to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank You if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to ac Is it possible to pass values using post method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Iso pass values using post method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value becand now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank Youwe can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank You file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access thatthod is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by wh Is it possible to pass values using post method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank Yous values using post method.I mean we can pass values if form method is set to post.but what if we have to pass value from a url.For example we have a hyper link and it got some id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first poe id and now we want to pass this value to another file.

file that has link

Code: Select all

<a href='a.php?id=3'>Click here </a>
a.php

Code: Select all

$a=$_GET['id']
Here we are using get method to access that value because get method is used.Is there any way by which we can pass this value using post method.

This is my second post. Pratikg has warned in my first post that i should use those tags while posting the code.If this is not the right way please let me know.

Thank You
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

no you cant pass post through url because that is get. i think there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extent]
$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);


or somthing to that extentink there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extenthink its nessicary. why don't you just do

[php:1:0bc6fdthink there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extentw its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
[/phpnor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
[/php:1:0bc6ost through url because that is get. i think there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extentecause that is get. i think there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extentST['id'] : $_GET['id']);


or somthing to that extent (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);


or somthing to that extent be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extentid'] : $_GET['id']);


or somthing to that extent do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST&#111ost through url because that is get. i think there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST&#1111;'id']) ? $_POST&#1111;'id'] : $_GET&#1111;'id']);
or somthing to that extente that is get. i think there might be some crazy cURL method to do this but i don't know how its done nor do I think its nessicary. why don't you just do

Code: Select all

$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
or somthing to that extent
$a = (isset($_POST['id']) ? $_POST['id'] : $_GET['id']);


or somthing to that extent
namitjung
Forum Commoner
Posts: 42
Joined: Mon Jun 20, 2005 3:17 am

Thanks but

Post by namitjung »

Thank you for your reply.

But my requirement is that passed value should not be visible in the url.So i want to use post method

Thank you
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

whats wrong with it being in the url? you can always use somthing like urlencode() so its not the same or whatnot
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Post by harrisonad »

I think you two are refering to the same thing. There's nothing to argue about. Just a misunderstanding.
Post Reply