VERIFIEZ LA DISPONIBILITE DE VOTRE NOM DE DOMAINE :
DE PETITES ANNONCES GRATUITES |
| PASSER UNE ANNONCE GRATUITEMENT |
| CONSULTEZ LES ANNONCES |
Question-Réponse :
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
REPONSES CONNEXES POUVANT CORRESPONDRE A VOTRE RECHERCHE :
Scripts - Sécurité - Script - Script php codes sources - Script php gratuit - Scripts - Scripts asp - Scripts perl - Scripts php - Sondage - Sources - Statistiques - Stats - Script ANNONCES - Script gratuit - sans base - safelist - software - Script PHP - Standards - Sources - Source - Simple - Sessions - Scripts php - Scripts - Script -
Vous pouvez également consulter le guide pratique script php qui vous proposera de nombreuses autres informations pratique concernant votre recherche surscript php
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
Script Masters : Script Javascript, Php, MySQL pour Webmasters
Des dizaines de ressources javascripts, dhtml et php pour tous les webmasters. Divers services gratuits pour votre site. Et bien sér toutes les astuces pour dynamiser votre site.
The Zati Script, script français pour mIRC
Une nouvelle version mineure de mIRC est sortie. Elle corrige quelques bugs. Le package d'installation est d'ores et déjà mis à jour.
The Zati Script, script français pour mIRC
Ce script supporte les thèmes au format MTS 1.1. Qu'est-ce que le format MTS? C'est une initiative visant à créer un standard commun de thème pour chaque script.
Sébastien Guillon - Script PHP pour déchiffrer les chaînes User ...
Développeur web PHP/MySQL, Sébastien Guillon est spécialisé dans le développement web sémantique et standard.
lancer un script php : Langage (standard, programmation)
Bonjour Mon hebergeur propose un plannificateur de taches qui permet de lancer une page php à tout moment (pour fabriquer un sitemap.xml par exemple, ou ...
Utiliser PHP en ligne de commande
Cependant, il y a une autre méthode pour utiliser PHP en script shell. Vous pouvez aussi utiliser la ligne #!/usr/bin/PHP en tout début de votre script, suivi de code PHP ...
PHP/Premier script - Wikiversité
Voici quelques explications sur ce html" target="_blank">script. html" target="_blank">Pour définir un html" target="_blank">script html" target="_blank">php parmi une page html, on doit entourer le code par les balises suivantes :
Script PHP Galerie Photo et Images - STADTAUS.com
Un simple script PHP pour créer automatiquement une galerie d'images depuis un répertoire. Uploadez simplement le répertoire avec images et vignettes sur votre serveur via FTP.
Script PHP - Forums - mini-forum en php
mini script en php qui vous permettra de créer en moins de 5 minutes un multi-forum qui pèse ... Je laisse un 6 au vu des commentaires précédents pour éviter que la moyenne baisse
Todoomasters, Script php gratuit à telecharger
L'annuaire de site internet pour webmaster, depuis 2001 nous vous proposons un classement de site pour webmaster d'une valeur d'ajouté. Les meilleurs site internet pour webmaster ...
Vous pouvez également consulter le guide pratique script php qui vous proposera de nombreuses autres informations pratique concernant votre recherche surscript php