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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.