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

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
User avatar
nasix
Forum Newbie
Posts: 6
Joined: Wed Aug 16, 2006 11:16 am

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

Post 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]
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

You want to use a form to submit data to another page, but not use $_POST to get the data?
User avatar
nasix
Forum Newbie
Posts: 6
Joined: Wed Aug 16, 2006 11:16 am

Post by nasix »

no, not this !

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

I hope you understand me
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP cannot help you there. Ajax, maybe. What is supposed to happen if someone has Javascript disabled?
User avatar
nasix
Forum Newbie
Posts: 6
Joined: Wed Aug 16, 2006 11:16 am

Post by nasix »

there is no object called POST or some thing like this in which I can make a data before sending ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP is processed on the server only (right now.)
User avatar
nasix
Forum Newbie
Posts: 6
Joined: Wed Aug 16, 2006 11:16 am

Post by nasix »

Ok thank you.
Post Reply