Page 1 of 1

How can I send a data whit Post but whithout a form ?

Posted: Wed Aug 16, 2006 11:26 am
by nasix
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi, 

I want to know how can I send a data to an php script with post method, but I don't want to use it in form, 
for example, I want to send the date with the data of the form,  without appairing in form

example code : 
[u]index.php[/u]
[syntax="html"]
<form method=post action='show.php'>
     <input type=text name=name>
     <input type= submit name=ok value=ok>
</form>
show.php[/syntax]

Code: Select all

<?php
    echo $_POST['name'];
    // I want to have an other data named 'date' in POST array
?>
thank you[/u]


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Aug 16, 2006 11:37 am
by GeXus
You want to use a form to submit data to another page, but not use $_POST to get the data?

Posted: Wed Aug 16, 2006 11:47 am
by nasix
no, not this !

I want to send the data with post but not using a form

I hope you understand me

Posted: Wed Aug 16, 2006 11:49 am
by feyd
PHP cannot help you there. Ajax, maybe. What is supposed to happen if someone has Javascript disabled?

Posted: Wed Aug 16, 2006 11:55 am
by nasix
there is no object called POST or some thing like this in which I can make a data before sending ?

Posted: Wed Aug 16, 2006 11:59 am
by feyd
PHP is processed on the server only (right now.)

Posted: Wed Aug 16, 2006 12:10 pm
by nasix
Ok thank you.