Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

babug_prg's scratchpad

by babug_prg (Friar)
on Sep 28, 2006 at 13:51 UTC ( #575354=scratchpad: print w/ replies, xml ) Need Help??

<!DOCTYPE html> <html> <head> <script type="text/javascript"> function validateForm() { var a=document.forms["reg"]["fname"].value; var b=document.forms["reg"]["lname"].value; var c=document.forms["reg"]["mname"].value; var d=document.forms["reg"]["address"].value; var e=document.forms["reg"]["contact"].value; var f=document.forms["reg"]["pic"].value; var g=document.forms["reg"]["pic"].value; var h=document.forms["reg"]["pic"].value; if ((a==null || a=="") && (b==null || b=="") && (c==null || c=="") + && (d==null || d=="") && (e==null || e=="") && (f==null || f=="")) { alert("All Field must be filled out"); return false; } if (a==null || a=="") { alert("First name must be filled out"); return false; } if (b==null || b=="") { alert("Last name must be filled out"); return false; } if (c==null || c=="") { alert("Gender name must be filled out"); return false; } if (d==null || d=="") { alert("address must be filled out"); return false; } if (e==null || e=="") { alert("contact must be filled out"); return false; } if (f==null || f=="") { alert("picture must be filled out"); return false; } if (g==null || g=="") { alert("username must be filled out"); return false; } if (h==null || h=="") { alert("password must be filled out"); return false; } } </script> <link href="style.css" rel="stylesheet" type="text/css" media="screen" + /> </head> <body> <section> <div id="wrapper"> <div id="header"> <div id="menu"> <ul> <li class="current_page_item"><a href="#">Home</a></li +> <li><a href="Smaple/index.php">Images</a></li> <li><a href="upload.html">Videos</a></li> <li><a href="about.php">About</a></li> <li><a href="contact.php">Contact</a></li> </ul> </div> <!-- end #menu --> <div id="search"> <form method="get" action=""> <fieldset> <input type="text" name="s" id="search-text" size="15" + /> <input type="submit" id="search-submit" value="Search" + /> </fieldset> </form> </div> <!-- end #search --> </div> <!-- end #header --> <div id="logo"> <!--<h1><a href="#">Blogging </a></h1> <p><em> template design by Free CSS Templates</em></p>--> </div> <hr /> <!-- end #logo --> <!-- end #header-wrapper --> <div id="page"> <div id="content"> <div class="post"> <h2 class="title">Image Upload</h2> <div class="entry"> <form enctype="multipart/form-data" action="upload.php +" method="POST"> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> </div> </div> <div class="post"> <h2 class="title">content</h2> <div class="entry"> <p>Vijay</p> <p>Vijay</p> <p>Vijay</p> </div> </div> <div class="post"> <h2 class="title">Lorem ipsum sed aliquam</h2> <div class="entry"> <p>Vijay</p> <p>Vijay</p> <p>Vijay</p> </div> </div> </div> <!-- end #content --> <div id="sidebar"> <h2>Registration form</h2> <form name="reg" action="Register.php" onsubmit="return validateFo +rm()" method="post"> <table width="274" border="0" align="center" cellpadding="2" cells +pacing="0"> <tr> <td colspan="2"> <div align="center"> <?php $remarks=$_GET['remarks']; if ($remarks==null and $remarks=="") { echo 'Register Here'; } if ($remarks=='success') { echo 'Registration Success'; } ?> </div> </td> </tr> <tr> <td><div align="right">First Name:</div></td> <td><input type="text" name="fname" /></td> </tr> <tr> <td><div align="right">Mail Address:</div></td> <td><input type="text" name="address" /></td> </tr> <tr> <td><div align="right">Contact No.:</div></td> <td><input type="text" name="contact" /></td> </tr> <tr> <td><div align="right">Gender:</div></td> <td><input type="text" name="mname" /></td> </tr> <tr> <td><div align="right">Age:</div></td> <td><input type="text" name="age" /></td> </tr> <tr> <td><div align="right"></div></td> <td><input name="submit" type="submit" value="Submit" /></td> </tr> </table> </form> <ul style="margin-top:17pt"> <li id="calendar"> <h2>Calendar</h2> <div id="calendar_wrap"> <?php require_once("calendar.php"); $cal = new activeCalendar(); echo $cal->showMonth(); ?> </div> </li> </ul> </div> <!-- end #sidebar --> <div style="clear: both;">&nbsp;</div> </div> <!-- end #page --> <div id="footer"> <p>Copyright (c) 2013 vijay.com. All rights reserved. Design by.</ +p> </div> <!-- end #footer --> </div> <div> </div> </section> </body> </html> upload.php =========== <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used + instead // of $_FILES. $uploaddir = '/home/Vijay/Desktop/vijay/php/uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) +{ echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?> Register.php <?php session_start(); include('connection.php'); $fname=$_POST['fname']; $address=$_POST['address']; $contact=$_POST['contact']; $mname=$_POST['mname']; $age=$_POST['age']; mysql_query("INSERT INTO members(fname,address,contact,mname,age) +VALUES('$fname','$address','$contact','$mname','$age')"); header("location: Vijay.php?remarks=success"); mysql_close($con); ?> connection.php ============== <?php $mysql_hostname = "localhost"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "vijay"; $prefix = ""; $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) + or die("Could not connect database"); mysql_select_db($mysql_database, $bd) or die("Could not select dat +abase"); ?> index.php ========= <!DOCTYPE html> <html> <head> <script type="text/javascript"> function validateForm() { var a=document.forms["reg"]["fname"].value; var b=document.forms["reg"]["address"].value; var c=document.forms["reg"]["contact"].value; var d=document.forms["reg"]["mname"].value; if ((a==null || a=="") && (b==null || b=="") && (c==null || c=="") + && (d==null || d=="")) { alert("All Field must be filled out"); return false; } if (a==null || a=="") { alert("First name must be filled out"); return false; } if (b==null || b=="") { alert("Mail address must be filled out"); return false; } if (c==null || c=="") { alert("Contact No must be filled out"); return false; } if (d==null || d=="") { alert("Gender must be filled out"); return false; } } </script> <style type="text/css"> body{ box-shadow:0px 1px 4px 0px rgba(0,0,0,0.2); margin:2%; height: 800px; padding:0px 0px 200px 0px font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 13px; color: #837669; } </style> </head> <body> <section> <div> <form name="reg" action="Insertdata.php" onsubmit="return validate +Form()" method="post"> <table width="350" border="0" style="margin-left:18pt" cellpadding +="4" cellspacing="2"> <tr> <td colspan="2"> <div align="center"> <?php $remarks=$_GET['remarks']; if ($remarks==null and $remarks=="") { echo 'Register Here'; } if ($remarks=='success') { echo 'Registration Success'; } ?> </div></td> </tr> <tr> <td><div align="right">First Name:</div></td> <td><input type="text" name="fname" /></td> </tr> <tr> <td><div align="right">Mail Address:</div></td> <td><input type="text" name="address" /></td> </tr> <tr> <td><div align="right">Contact No.:</div></td> <td><input type="text" name="contact" /></td> </tr> <tr> <td><div align="right">Gender:</div></td> <td><input type="text" name="mname" /></td> </tr> <tr> <td><div align="right">Age:</div></td> <td><input type="text" name="age" /></td> </tr> <tr> <td><div align="right"></div></td> <td><input name="submit" type="submit" value="Submit" /></td> </tr> </table> </form> </div> </body> </html>
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2015-01-31 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (261 votes), past polls