Submitting Values without Using a Form in PHP
How To Submit Values without Using a Form in PHP?
If you know the values you want to submit, you can code the values in a hyper link at the end of the URL. The additional values provided at the end of a URL is called query string. There are two suggestions on how to use query strings to submit values to the receiving script page:
Here is a simple script page that shows you two hyper links with query strings in different formats:
<?php print("<html>"); print("<p>Please click the links below" ." to submit comments about FYICenter.com:</p>"); print("<p>" .'<a href="processing_forms.php?name=Guest&comment=Excellent">' ."It's an excellent site!</a></p>"); print("<p>" .'<a href="processing_forms.php?Visitor,Average">' ."It's an average site.</a></p>"); print("</html>"); ?>
If you copy this script as submit_comments.php to your Web server, and click the first link, you will get:
Number of values: 2 name = Guest comment = Excellent
If you click the second link, the current processing_forms.php will not pick up input values from $_REQUEST properly as shown below:
Number of values: 1 Visitor,Average =
2016-11-08, 857👍, 0💬
What Is an HTML "em" Tag/Element? An "em" element is an inline element that you can use to specify t...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
Where to find tutorials on how to use PHP built-in functions to manage arrays? A collection of tutor...
How To Get the Total Number of Values in an Array in PHP? You can get the total number of values in ...
How To Find a Specific Value in an Array in PHP? There are two functions can be used to test if a va...