Jump to content

mysql update/php include


joline

Recommended Posts

Hi!

 

I have an html form that calls a page which updates a database with the form data.  That same page has an include line in it.

 

Through an awful lot of time spent removing each line from the page and trying it one step at a time, I've figured out that the page works perfectly if the include statement is removed.  If the include statement is there, the data is not updated.

 

Below is an abbreviated version of the code.

 

If anyone has any suggestions, I could really use it.  I can't figure out why the include statement would effect the update statement.

Thanks,

Joline

 

<html>

<form name = "Training" method ="POST" action ="TrainingQuestions.php">

//form stuff here

</form>

</html>

 

TrainingQuestions.php

<?php

session_start();

if(isset($_SESSION["theid"]))

{

//this is on every page - it is just making sure the user is registered.

 

$user_id = $_SESSION["theid"];

include ('***_config.php');

//this is my database config file - it works fine on other pages.

 

$design = addslashes(trim($_POST['design']));

//(rest of the vars here)

$start_value = addslashes(trim($_POST['start_value']));

 

$query=("UPDATE Interview_Answers SET design = '$design', what = '$what', whent = '$whent', barriers = '$barriers', barriersc = '$barriersc', discussion = '$discussion', nature = '$nature'WHERE user_id = '$user_id'");

$result =mysql_query($query);

 

if ($start_value == "PI")

{

include ("PI_FeedbackQuestions.html");

}

if ($start_value == "NSF")

{

include ("NSF_FeedbackQuestions.html");

}

if ($start_value == "SPA")

{

include ("SPA_FeedbackQuestions.html");

}

}

 

else

{

global $message;

$message = "Wrong user name or password.  Please try again!";

include ('Home.html');

}

?>

 

Link to comment
https://forums.phpfreaks.com/topic/106838-mysql-updatephp-include/
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.