Jump to content

PHP Noob Question :P


Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/119701-php-noob-question-p/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.