Jump to content

Recommended Posts

It's a form but whatever you enter into the fields comes up blank in the database. Thanks in advance


<?php
$link = mysql_connect(-----------);
if (!$link) {
  die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$database = mysql_select_db('cs');

print_r($_POST);
$name = $_POST['textfield'];
$specialty = $_POST['specialty'];
$company = $_POST['company'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$licensure = $_POST['licensure'];
$certifications = $_POST['certification'];
$addcertifications = $_POST['addcertification'];
$addcomments = $_POST['addcomment'];
print($name);

/*echo("$name");
echo('\n');
$sql  = "INSERT INTO `Resume`  VALUES('','" . $name . "'," . $specialty . ",'$company','$address','$city','$state','$zip','$telephone','$email','$licensure','$certifications','$addcertifications','$addcomments')";
echo($sql);
$error = mysql_query($sql);

if ($error == TRUE)
echo('\nfucking shit worked');
else
echo(mysql_error());
*/
mysql_close($link);
?>


<form name="form1" method="post" action="thankyou.php">
            <table width="100%" height="278" border="0" cellpadding="0" cellspacing="0" class="tablespace">
              <tr>
                <td width="33%" height="278" valign="top" class="topform"><p>Registration
                    <span class="style13">- Join our team of  professionals
                    and find the right job for you</span><br>
                    <br>
                </p>
                  <p><img src="images/groupdoc.gif" width="178" height="123"></p></td>
                <td width="67%" align="left" valign="top"><table width="100%" height="424" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="38%" height="28" align="right" valign="bottom" class="form">Name</td>
                    <td width="62%" align="left" valign="bottom" class="inputspace"><input name="name" type="text"></td>
                  </tr>
                  <tr>
                    <td height="28" align="right" valign="bottom">Specialty</td>
                    <td align="left" valign="bottom" class="inputspace"><select name="specialty">
                      <option value="Allergist">Allergist</option>
                      <option value="Anesthesiology">Anesthesiology</option>
                      <option value="Cardiology">Cardiology</option>
                      <option value="Critical Care">Critical Care</option>
                      <option value="CRNA">CRNA</option>
                      <option value="Dermatology">Dermatology</option>
                      <option value="Emergency Medicine">Emergency Medicine</option>
                      <option value="Endocrinology">Endocrinology</option>
                      <option value="ENT">ENT</option>
                      <option value="Family Practice">Family Practice</option>
                      <option value="General Practice">General Practice</option>
                      <option value="General Surgery">General Surgery</option>
                      <option value="GI">GI</option>
                      <option value="Hematology/Oncology">Hematology/Oncology</option>
                      <option value="Hospitalist">Hospitalist</option>
                      <option value="Infectious Disease">Infectious Disease</option>
                      <option value="Internal Medicine">Internal Medicine</option>
                      <option value="Medical Oncology">Medical Oncology</option>
                      <option value="Neonatology">Neonatology</option>
                      <option value="Nephrology">Nephrology</option>
                      <option value="Neurology">Neurology</option>
                      <option value="NeuroSurgery">NeuroSurgery</option>
                      <option value="Nuclear Medicine">Nuclear Medicine</option>
                      <option value="Nurse Practitioner">Nurse Practitioner</option>
                      <option value="OB/GYN">OB/GYN</option>
                      <option value="Occupational Medicine">Occupational Medicine</option>
                      <option value="Oncology">Oncology</option>
                      <option value="Opthalmology">Opthalmology</option>
                      <option value="Ortho Surgery">Ortho Surgery</option>
                      <option value="Pathology">Pathology</option>
                      <option value="Pediatrics">Pediatrics</option>
                      <option value="Perinatology">Perinatology</option>
                      <option value="Physiatry">Physiatry</option>
                      <option value="Primary Care">Primary Care</option>
                      <option value="Psychiatry">Psychiatry</option>
                      <option value="Psychology">Psychology</option>
                      <option value="Pulmonary">Pulmonary</option>
                      <option value="Radiation Oncology">Radiation Oncology</option>
                      <option value="Radiation Therapy Technician">Radiation
                      Therapy Technician</option>
                      <option value="Radiology">Radiology</option>
                      <option value="Rheumatology">Rheumatology</option>
                      <option value="Thoracic Surgery">Thoracic Surgery</option>
                      <option value="Urology">Urology</option>
                    </select>
                    </td>
                  </tr>
                  <tr>
                    <td height="27" align="right" valign="bottom">Company Name </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="company"></td>
                  </tr>
                  <tr>
                    <td height="27" align="right" valign="bottom">Address</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="address"></td>
                  </tr>
                  <tr>
                    <td height="27" align="right" valign="bottom">City</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="city"></td>
                  </tr>
                  <tr>
                    <td height="29" align="right" valign="bottom">State</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="state"></td>
                  </tr>
                  <tr>
                    <td height="28" align="right" valign="bottom">Zip</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="zip"></td>
                  </tr>
                  <tr>
                    <td height="30" align="right" valign="bottom">Telephone</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="telephone"></td>
                  </tr>
                  <tr>
                    <td height="28" align="right" valign="bottom">Email</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="email"></td>
                  </tr>
                  <tr>
                    <td height="32" align="right" valign="bottom">States of Licensure </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="licensure"></td>
                  </tr>
                  <tr>
                    <td height="29" align="right" valign="bottom">Board of Certifications Status </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="certification"></td>
                  </tr>
                  <tr>
                    <td height="30" align="right" valign="bottom">Additional Certifications </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="addcertification"></td>
                  </tr>
                  <tr>
                    <td height="43" align="right" valign="bottom">Additonal Comments </td>
                    <td align="left" valign="bottom" class="inputspace"><textarea name="addcomment"></textarea></td>
                  </tr>
                  <tr>
                    <td height="38" align="right" valign="bottom">&nbsp;</td>
                    <td align="left" valign="bottom" class="inputspace"><input name="Submit" type="submit" class="inputspace" value="Submit"></td>
                  </tr>
                </table></td>
              </tr>
            </table>
          </form>

Link to comment
https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/
Share on other sites

haven't looked at all your code yet but first test your database selection. I had the same problem and found my code was good but my priviliges were bad. MySQL will deny priviliges if your host and or db and table privs aren't specific. there are other ones that will load first. ie. annonymous. especially if there are more than one account with the same name.
Link to comment
https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63750
Share on other sites

[quote author=Mantis_61 link=topic=101860.msg403553#msg403553 date=1153874543]
haven't looked at all your code yet but first test your database selection. I had the same problem and found my code was good but my priviliges were bad. MySQL will deny priviliges if your host and or db and table privs aren't specific. there are other ones that will load first. ie. annonymous. especially if there are more than one account with the same name.
[/quote]

Thanks, ill check that tomorrow and reply.
Link to comment
https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63788
Share on other sites

why have  you commented all this out?

/*echo("$name");
echo('\n');
$sql  = "INSERT INTO `Resume`  VALUES('','" . $name . "'," . $specialty . ",'$company','$address','$city','$state','$zip','$telephone','$email','$licensure','$certifications','$addcertifications','$addcomments')";
echo($sql);
$error = mysql_query($sql);

if ($error == TRUE)
  echo('\nfucking shit worked');
else
  echo(mysql_error());
  */

How is your query going to work when you've commented the code out?

AndyB got it straight away but you don't seem to have realised....
Link to comment
https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63893
Share on other sites

[code]
/*
In php when we want to echo a lot about the code we work on
we use the fowardslash and astrack and then when finshed the long
echoed message we use astrack  then backslash to finish our long
echoed message.

This message is in the php format for an example remeber no code will
exicute in this php format.
*\
[/code]
Link to comment
https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63896
Share on other sites

OK, then post the current code you have running on your server.  If nothing is going into the database then it sure looks like there's a database error of some sort.  If I encounter that type of problem, I echo the query then try exactly the same query in phpMyAdmin.

Might sound stupid, but you have uploaded the modified files to the right folder on your server, etc. haven't you?
Link to comment
https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-64187
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.