SchweppesAle Posted August 14, 2008 Share Posted August 14, 2008 Yea, so most of my experience thus far has been geared towards Java. I only just started working with "proper" html(CSS), PHP & MySQL. I'm trying to create an HTML form which forwards the information given to a php method via $_Post. here's the code: <?php include("Jobs.php"); ?> DBConnect(); mysql_select_db("Jobs"); <form action="Jobs.php" method="post"> Name: <input type="text" name="Name" /> <br/> Number: <input type="text" name="Number" /> <br/> Resume: <input type = "text" name = "Resume" /> <br/> <Font size = -1>Maximum of 500 characters</Font> <br/> <input type="submit" Value= "Submit Resume" ONCLICK = "<?php insert($_Post['Name'], $_Post['Number'], $_Post['Resume']) ?> " > </form> The insert and DBConnect method are included within Jobs.php. here's the code for that as well: DBConnect method function DBConnect(){ $user = "root"; $password = "ucfreeb12"; $con = mysql_connect('localhost', $user, $password) or die("User/Password invalid"); echo ($con); } insert method function insert($Name, $Number, $Resume ){ mysql_query("INSERT INTO AvailableJobs (Name, Number, Resume) VALUES('$Name', '$Number', '$Resume') ") or die(mysql_error()); echo("Data Inserted"); } for some reason if I click on the submit button it doesn't return "Data Inserted". Any ideas? Quote Link to comment Share on other sites More sharing options...
SchweppesAle Posted August 14, 2008 Author Share Posted August 14, 2008 blah. should have put this in PHP help. sry about that-anyway an admin can move this for me? Quote Link to comment Share on other sites More sharing options...
gs Posted August 18, 2008 Share Posted August 18, 2008 What is the PHP INCLUDE for? If you used post, why dont you just get the variables via $_POST['Number']; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.