This is a discussion on "Record insertion form problem" within the PHP Forum section. This forum, and the thread "Record insertion form problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Record insertion form problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Record insertion form problem
Because I am using aone page to display my whole site my record insertion form doesn't work!
If I do it from a normal name.php page the rcord insertion form works fine but becuase my page is called from inside this one page see my other post... it doesn't work and this url comes up www.mysite.com/<?php%20echo%20/index.php?Section=Registration;%20?> and when it worksfrom a stand alone page the url is www.mysite.com/registration? Any ideas Web Wizards! Please help out this frustrated newbie! Cheers Brain |
|
|
|
#2
|
|||
|
|||
|
Re: Record insertion form problem
I will need to see your code to even begin to understand whats wrong, or what you are trying to do.
|
|
#3
|
|||
|
|||
|
Re: Record insertion form problem
Thanks for replying Phoenix...
I am just using dreamweavers record insertion code e.g. see below and the problem seems to be because i am calling all pages from one page like so but I don't know how to resolve this... Just to reiterate it goes to the url http://www.mysite.com/<?php%20echo%2...gistration;%20?> which doesn't bring up a page <?php function getCSS($x) { if ($x == $_GET["Section"]) { echo "activeButton"; } else { echo "button"; } } ?> <td align="middle"><a class="<?php getCSS("")?>"href="index.php">Home</a></td> <td align="middle" width="1"><span class="style22"> | </span></td> <td align="middle"><a class="<?php getCSS("Registration")?>" href="index.php?Section=Registration">Free Registration</a></td> <?php switch ($_GET["Section"]) { case "Registration": // Record insertion code <?php require_once('Connections/The_DB.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO User_Details (Username, Password, `First Name`, Surname, Sex, Age, City, Country, Occupation, Unique_Description, Picture, ImageType, ShowAll, Email, PhoneNo, Contact_Access, Person1_FN, Person1_SN, Person2_FN, Person2_SN, Person3_FN, Person3_SN, Person4_FN, Person4_SN, Person5_FN, Person5_SN, Person6_FN, Person6_SN, Person7_FN, Person7_SN, Person8_FN, Person8_SN, Person9_FN, Person9_SN, Person10_FN, Person10_SN) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Username'], "text"), GetSQLValueString($_POST['Password'], "text"), GetSQLValueString($_POST['First_Name'], "text"), GetSQLValueString($_POST['Surname'], "text"), GetSQLValueString($_POST['Sex'], "text"), GetSQLValueString($_POST['Age'], "text"), GetSQLValueString($_POST['City'], "text"), GetSQLValueString($_POST['Country'], "text"), GetSQLValueString($_POST['Occupation'], "text"), GetSQLValueString($_POST['Unique_Description'], "text"), GetSQLValueString($_POST['Picture'], "text"), GetSQLValueString($_POST['ImageType'], "text"), GetSQLValueString($_POST['ShowAll'], "text"), GetSQLValueString($_POST['Email'], "text"), GetSQLValueString($_POST['PhoneNo'], "text"), GetSQLValueString($_POST['Contact_Access'], "text"), GetSQLValueString($_POST['Person1_FN'], "text"), GetSQLValueString($_POST['Person1_SN'], "text"), GetSQLValueString($_POST['Person2_FN'], "text"), GetSQLValueString($_POST['Person2_SN'], "text"), GetSQLValueString($_POST['Person3_FN'], "text"), GetSQLValueString($_POST['Person3_SN'], "text"), GetSQLValueString($_POST['Person4_FN'], "text"), GetSQLValueString($_POST['Person4_SN'], "text"), GetSQLValueString($_POST['Person5_FN'], "text"), GetSQLValueString($_POST['Person5_SN'], "text"), GetSQLValueString($_POST['Person6_FN'], "text"), GetSQLValueString($_POST['Person6_SN'], "text"), GetSQLValueString($_POST['Person7_FN'], "text"), GetSQLValueString($_POST['Person7_SN'], "text"), GetSQLValueString($_POST['Person8_FN'], "text"), GetSQLValueString($_POST['Person8_SN'], "text"), GetSQLValueString($_POST['Person9_FN'], "text"), GetSQLValueString($_POST['Person9_SN'], "text"), GetSQLValueString($_POST['Person10_FN'], "text"), GetSQLValueString($_POST['Person10_SN'], "text")); mysql_select_db($database_The_DB, $The_DB); $Result1 = mysql_query($insertSQL, $The_DB) or die(mysql_error()); $insertGoTo = "/NewUserConfirm.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> Many thanks mate. |
|
#4
|
|||
|
|||
|
Re: Record insertion form problem
Er...
I don't see your url in the code anywhere... am I to be under the impression that you are inserting the php into the webbrowsers address bar? |
![]() |
| Tags |
| record, insertion, form, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Form creating record but not adding data | Andrew1986 | Databases | 22 | Oct 19th, 2007 08:47 |
| E-mailing a report based on current record on form | easydoesit | Databases | 0 | Aug 27th, 2007 23:07 |
| Add/Delete/Modify Database Record form | David Blake | Starting Out | 6 | May 1st, 2007 16:22 |
| record set problem of sorts... | riotman | Classic ASP | 3 | Jan 20th, 2006 23:32 |
| Delete record problem | Gee Bee | Databases | 2 | Jan 4th, 2006 18:28 |