Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Why doesnt the form post showup?
Old 03-30-2009, 11:33 AM Why doesnt the form post showup?
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
Im using dw to create a form to be submitted into the database and after submitting it should go to the next page. The next page has the text to display certain form fields from the previous page but it doesnt showup? I have used <?php echo $_POST['name']; ?> if i change the form action field on the form page to sent.php it work but when i change it <?php echo $editFormAction; ?> then it doesnt work. Please find the header of the form page attached
Attached Files
File Type: txt db.txt (2.3 KB, 1 views)
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
 
Register now for full access!
Old 03-30-2009, 11:34 AM Re: Why doesnt the form post showup?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
PHP Code:
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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"] == "aircon")) {
  
$insertSQL sprintf("INSERT INTO request (category, name, email, phone, fax, city, suburb, request, image) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['category'], "text"),
                       
GetSQLValueString($_POST['name'], "text"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['phone'], "text"),
                       
GetSQLValueString($_POST['fax'], "text"),
                       
GetSQLValueString($_POST['city'], "text"),
                       
GetSQLValueString($_POST['suburb'], "text"),
                       
GetSQLValueString($_POST['request'], "text"),
                       
GetSQLValueString($_POST['image'], "text"));

  
mysql_select_db($database_db_sq3$db_sq3);
  
$Result1 mysql_query($insertSQL$db_sq3) or die(mysql_error());

  
$insertGoTo "sent.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?>
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 03-30-2009, 12:11 PM Re: Why doesnt the form post showup?
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
thnx.. could you please comment the lines that you edited.
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
Old 03-30-2009, 03:20 PM Re: Why doesnt the form post showup?
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
any idea why i cant post to the next page?
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
Reply     « Reply to Why doesnt the form post showup?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20900 seconds with 13 queries