VERIFIEZ LA DISPONIBILITE DE VOTRE NOM DE DOMAINE :
DE PETITES ANNONCES GRATUITES |
| PASSER UNE ANNONCE GRATUITEMENT |
| CONSULTEZ LES ANNONCES |
PHP method Post - how to simulate input by hardcoding the url? I need to compile an URL that will work with a php script. The idea is to create something like: http://www.mysite.com/script.php?user=00?
that will pass the data to script.php same as post form.
Hello,
If you want to deal with POST you need to use the $_POST variable in PHP to deal with that. But if you want to deal with the URL you posted you need the GET request method since hte variables are naked to the eye not hidden.
The following example will help you do what you want:
script.php?user=0001&data=something
===============
// Check if user presses submit
if( isset( $_GET['submit'] ) )
{
// Grab the POST variables
$user = $_GET['user'];
$data = $_GET['data'];
// Print them to the screen
echo 'USER=> ', $user, '
DATA => ', $data;
}
else
{
// set the Action for the form to script.php
// set the Request for the form to GET
$output = '<form action="script.php" method="get">';
$output .= '<input name="user" type="text" />';
$output .= '<textarea name="data"></textarea>';
$output .= '<<input name="submit" type="submit" />';
$output .= '</form>';
echo $output;
}
=============
The above will first print the form to the screen, if you pressed submit, it will check if that variable exists ( by using isset), if that variable "submit" (which is the name of the input submit), it means the form has been submitted to script.php using the GET request method!
Then you can manipulate the data from there.
Good Luck
=========
EDIT:
======================================?
As you stated a web-enabled hardware device, if you are sure the request comes from a POST, then you cannot send the request with http://mysite.com/script.php?user=001& data=whatever , in whatever language your using, you will need to place the POST variables in the header for that request.
But if you want to send a GET request similar to the one you provided, your PHP page should have the following:
============
// Check the request has user and data as a GET req method
if( isset( $_GET['user']) && isset( $_GET['data'] ) )
{
// Grab the POST variables
$user = $_GET['user'];
$data = $_GET['data'];
echo 'USER=> ', $user, 'DATA => ', $data;
}
else
{
echo 'Request is empty';
}
============
I assume your doing an asynchronous call, and your doing something which is similar to REST Services, your web -enabled device will grab what is echoed.
I hope that solves your problem
PHPScripts - Scripts PHP / MySQL - Galeries / Images
Scripts PHP et MySQL, articles et tutorials sur PHP/MySQL, forum, liens, docs... à ... Script permettant de gérer un album photo, utilise un formulaire de recherche pour ...
PHPScripts - Scripts PHP / MySQL - Authentification
Scripts PHP et MySQL, articles et tutorials sur PHP/MySQL, forum, liens, docs... à ... par login et mot de passe et de déterminer une redirection personnalisée pour chaque ...
PHP: Links
Pour tout savoir sur le PHP, en français. Vous trouverez un tutorial, des exemples ... Section of an Italian site that provides tutorials about PHP, hundreds of scripts ...
PHP Bugs: #7996: CGI
Apache est configuré correctement pour autoriser l'exécution des cgi ds le répertoire (les scripts perl ds le même rép s'exécutent) Le script php est bien en 755 tout ...
PHP: declare - Manual
En PHP 6.0, la directive encoding sera utilisée pour dire au scanner dans quel encodage le ... alive or not, very usefull for some kind of scripts to decrease serverload PHP
Turing number ← PHP scripts ← MPAM Rebooted
... php : creates the picture - l_form.php : form script - GNUGPL.txt : The GNU General Public License :) Required : php and MySQL Based on : IMAGE CRYPTÉE DE PROTECTION POUR ...
Zubrag.com :: Free PHP scripts, tools, and articles for ...
PHP: virtual - Manual
Pour exécuter une sous-requête, tous les tampons sont arrêtés et ... I then wanted to add a Perl script to that header file (header.php) via the virtual() command.
Scriptaty.net - ASP NET Scripts : Calendar Scripts : Active Data ...
Perl Scripts: PHP Scripts: Python Scripts: Remotely Hosted Scripts ... Description: Active Data Online GroupCalendar is a ... 22334 14 Black Compression "12 Cup Coffee Carafe for Pour O ...
PHP Scripts - STADTAUS.com
Tell A Friend Script. Invite a friend to this site, if you ... Forum de Dépannage » E-mail du site à un ami Votez pour le Script ... PHP Resource Index
INDEX /TAG :
Vous pouvez également consulter le guide pratique script php qui vous proposera de nombreuses autres informations pratique concernant votre recherche surscript php