PHP Forms
You can view the result at : http://198.27.105.229/example_test004.phpCode:<html> <body> Hello <?php echo $_POST["firstName"]; ?>, your email, <?php echo $_POST["email"]; ?>, has now been added. </body> </html>
PHP Forms
You can view the result at : http://198.27.105.229/example_test004.phpCode:<html> <body> Hello <?php echo $_POST["firstName"]; ?>, your email, <?php echo $_POST["email"]; ?>, has now been added. </body> </html>
For this to work, you need a HTML form page like
Code:<html> <body> <form action="example_test004.php" method="post"> <div> Enter your name: <input type="text" name="firstName"> </div> <div> Email: <input type="text" name="email"> </div> <button type="submit">Add Me</button> </form> </body> </html>
Save it as
example_test004.html
Become PHP Expert in 30 days
FreeMarriage.com - Free Online Matrimonial
FlashWebHost.com - Professional Web Hosting, Designing.
For this to work, you need a HTML form page like
Code:<html> <body> <form action="example_test004.php" method="post"> <div> Enter your name: <input type="text" name="firstName"> </div> <div> Email: <input type="text" name="email"> </div> <button type="submit">Add Me</button> </form> </body> </html>
Save it as
example_test004.html
Become PHP Expert in 30 days
FreeMarriage.com - Free Online Matrimonial
FlashWebHost.com - Professional Web Hosting, Designing.
Introductory programming and scripting tutorials, our first example will print "Hello World"
Code:<HTML> <HEAD> <TITLE> Hello World in PHP </TITLE> </HEAD> <BODY> <? // Hello world in PHP print("Hello World"); ?> </BODY> </HTML>
You can view the result at : http://198.27.105.229/example_test007.php
This is same as
http://forums.bizhat.com/showthread.php/134951
PHP Uploading Files
upload.html
Save following asCode:<html> <head> <title>File Upload Form</title> </head> <body> This form allows you to upload a file to the server.<br> <form action="upload.php" method="post"><br> Type (or select) Filename: <input type="file" name="uploadFile"> <input type="submit" value="Upload File"> </form> </body> </html>
upload.php
Create a directory "uploads" in current folder.Code:<html> <head> <title>Process Uploaded File</title> </head> <body> <?php move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "./uploads/{$_FILES['uploadFile'] ['name']}") ?> </body> </html>
Note: This script is insecure. Do not upload to public server and keep it there. Anyone can upload files to your web server. For example, they upload a movie or a PHP Shell (hacked tool) or spam mail too and sent mail. There can be lot of abuse if such a script is made available on a public server.
Bookmarks