Jump to content

PHP Update mysql db Form - randomly not working!!! Bad day :(


ballvicki

Recommended Posts

Many apologies if this is the wrong forum to be posting this on!

 

I am having a bit of a bash head against a wall problem in that I have designed a delegate management system for a client, that delegates to check and update they're details in a mysql database. Its basically a dynamically created form that pulls any information that might exist in the db into the form fields. The delegate checks it and hopefully presses submit, and that then passes it to a seperate PHP script which updates the database, and spits out a thank you message.

 

The problem I am having is that say 5 out of the 100 delegates are saying they are entering all the information, pressing submit, and instead of calling the script, the form seems to be just refreshing itself, and updating anything.

 

Problem is that it is very difficult to get any of the delegates to say what browser or operating system they are on - agggggghhhhh! I have a suspision it maybe IE6 - but this is just guess work really. I am pasting the code below - sorry if its long winded:

 

<?php

session_name('YourVisitID');

session_start(); // Start the session

 

// If no session is present, redirect the user

if(!isset($_SESSION['username'])){

header ("Location: http://www.xxxxx.com/xxxxxx.php");

exit();

}

include ('templates/bda_header.inc'); // Include the HTML footer.

require_once ('../mysql_connect.php'); // Connect to the database.

 

$delegateid=($_SESSION['companyid']);

 

echo    "<p class=\"Error\"><strong>Please review your Company Profile Information below.</strong> You may find some portions of this page already completed with information supplied on your booking form. If so, please review, complete any blank boxes and ensure that all information is correct before pressing submit. Please note that you will only be able to fill this form in once. The information you enter will only be viewed by registered delegates attending the event.</p>";

 

$query = "SELECT * FROM ArcInt_buyers_profile WHERE comp_id = $delegateid";

$result = @mysql_query ($query);

 

if (!$result) {

die('Query failed: ' . mysql_error());

}

 

while($row = mysql_fetch_row($result))  {

 

echo    "<form enctype=\"multipart/form-data\" action=\"del_log_buy_profup.php\" method=\"post\">

              <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ProfileQuest\">

                <tr align=\"left\" valign=\"middle\">";

 

echo    "<td class=\"Body\"><strong>Q1.</strong> Number of Earning Architects and Designers in North America?</td>

                  <td width=\"60\"><input name=\"q1\" type=\"text\" class=\"LatNewsTextFieldSmall\" id=\"q1\" value=\"$row[2]\" size=\"10\" maxlength=\"8\"></td></tr><tr align=\"left\" valign=\"middle\">";

 

echo    "<td class=\"Body\"><strong>Q2.</strong> Number of Earning Architects and Designers Worldwide?</td><td><input name=\"q2\" type=\"text\" class=\"LatNewsTextFieldSmall\" id=\"q2\" value=\"$row[3]\" size=\"10\" maxlength=\"8\"></td></tr><tr align=\"left\" valign=\"middle\">";

                 

echo    "<td class=\"Body\"><strong>Q3. </strong>Total (sq.ft) of current projects in North America</td>

                  <td><input name=\"q3\" type=\"text\" class=\"LatNewsTextFieldSmall\" id=\"q3\" value=\"$row[4]\" size=\"20\" maxlength=\"8\"></td></tr><tr align=\"left\" valign=\"middle\">";

 

echo    "<td class=\"Body\"><strong>Q4. </strong>Total (sq.ft) of current projects Worldwide</td><td><input name=\"q4\" type=\"text\" class=\"LatNewsTextFieldSmall\" id=\"q4\" value=\"$row[5]\" size=\"20\" maxlength=\"8\"></td></tr>";

 

                 

echo    "</table>";

 

echo    "<p class=\"Body\"><br><strong>Company Overview:</strong> (Max 150 words)<br>

                <textarea name=\"description\" rows=\"10\" class=\"LatNewsMultiText\" id=\"description\">$row[6]</textarea></p>";

 

echo    "<p class=\"Body\"><strong>What types of projects are you involved in?</strong><br> (For Example - Academic, Civil, Commercial, Healthcare, Hospitality, Mixed use, Residential, Planning, Retail, Science, Sports, Transportation) (Max 50

    words)<br><textarea name=\"detail1\" rows=\"2\" class=\"LatNewsMTSmaller\" id=\"detail1\">$row[7]</textarea></p>";

 

echo    "<p class=\"Body\"><strong>Delegate Bio - How would you describe your roles and responsibilities?</strong> (Max 50 words)<br>

                <textarea name=\"detail2\" rows=\"2\" class=\"LatNewsMTSmaller\" id=\"detail2\">$row[8]</textarea></p>";

 

echo    "<p class=\"Title\">What are your current major projects?</p>";

 

$build=$row[9];

$newhotelgroup = explode("|", $build);

 

for($i=0;$i<=9;$i++){

$newhotelname=$newhotelgroup[$i];

$newhotel = explode("~", $newhotelname);

echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ProfileQuest2\"><tr>

                  <td width=\"25%\" class=\"Body\">Project Name</td><td width=\"25%\" class=\"Body\">Location</td>

                  <td width=\"25%\" class=\"Body\">Size (sq.ft)</td><td width=\"25%\" class=\"Body\">Completion Date (MM/YY)</td></tr><tr>

                  <td width=\"25%\"><input name=\"hotel$i\" type=\"text\" class=\"ProfileTextFields\" id=\"hotel$i\" value=\"$newhotel[0]\" size=\"18\"></td><td width=\"25%\"><input name=\"location$i\" type=\"text\" class=\"ProfileTextFields\" id=\"location$i\" value=\"$newhotel[1]\" size=\"8\"></td><td width=\"25%\"><input name=\"rooms$i\" type=\"text\" class=\"ProfileTextFields\" id=\"rooms$i\" value=\"$newhotel[2]\" size=\"18\"></td><td width=\"25%\"><input name=\"date$i\" type=\"text\" class=\"ProfileTextFields\" id=\"date$i\" value=\"$newhotel[3]\" size=\"8\"></td></tr></table>";

 

 

 

}

echo    "<p class=\"Body\"><strong>Current Major Projects - additional notes:</strong> (Max 150 words)<br><textarea name=\"detailextra1\" rows=\"2\" class=\"LatNewsMTSmaller\" id=\"detail1\">$row[10]</textarea></p>";

 

echo    "<p><input name=\"submit\" type=\"submit\" class=\"Submit\" value=\"submit\" /></p></form>";

 

}

 

/*Close connection*/

mysql_close();

 

include ('templates/dl_footer.inc'); // Include the HTML footer.

?>

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.