Jump to content

lucas20042004

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lucas20042004's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I used a program called forms2go. It can insert things into database but cannot retrive info so I dont know how to do it. As you can see for the purpose of the question my table is called "track" and the two fields are called "email" and "description". <?PHP ###################################################### # # # Forms To Go 4.2.0 # # http://www.bebosoft.com/ # # # ###################################################### error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('track_errors', true); function DoStripSlashes($fieldValue) { if ( get_magic_quotes_gpc() ) { if (is_array($fieldValue) ) { return array_map('DoStripSlashes', $fieldValue); } else { return stripslashes($fieldValue); } } else { return $fieldValue; } } function FilterCChars($theString) { return preg_replace('/[\x00-\x1F]/', '', $theString); } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $clientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $clientIP = $_SERVER['REMOTE_ADDR']; } $FTGEmail = DoStripSlashes( $_POST['Email'] ); $FTGDescription = DoStripSlashes( $_POST['Description'] ); $validationFailed = false; # Include message in error page and dump it to the browser if ($validationFailed === true) { $errorPage = '<html><head><title>Error</title></head><body>Errors found: <!--VALIDATIONERROR--></body></html>'; $errorPage = str_replace('<!--FIELDVALUE:Email-->', $FTGEmail, $errorPage); $errorPage = str_replace('<!--FIELDVALUE:Description-->', $FTGDescription, $errorPage); $errorList = @implode("<br />\n", $FTGErrorMessage); $errorPage = str_replace('<!--VALIDATIONERROR-->', $errorList, $errorPage); echo $errorPage; } if ( $validationFailed === false ) { #==================================================== # Dump field values to a MySQL table = #==================================================== $mysqlLink = @mysql_connect("localhost", "username", "password"); if (mysql_errno() == 0) { @mysql_select_db("database", $mysqlLink); } if (mysql_errno() == 0) { $sqlCmd = sprintf("INSERT INTO `track`(`email`, `description`) VALUES('%s', '%s')", mysql_real_escape_string($FTGEmail, $mysqlLink), mysql_real_escape_string($FTGDescription, $mysqlLink)); @mysql_query($sqlCmd, $mysqlLink); } # Redirect user to success page header("Location: http://www.xxxxx.com"); } ?>
  2. I have managed to make a form in frontpage that has two textboxes. One for the persons email address and one for comments. When the info is typed and submitted it stores on my database in two fields in a table. My question is how do I make another form on a different page so when they put their email address in a textbox and submit it, it will display their comments on the page that they put in previously on the 1st page. This is a kind of test thing as I just want to get used to it. As you can see im trying to make a kind of order tracking page. Hope you understand thanks
  3. Hi, my site was working ok yesterday but today it is coming up with this error: Fatal error: Maximum execution time of 30 seconds exceeded in /xxxxxx/library/classes/class_db.php on line 31 The class_db.php file is below. I hope somebody can help. Thanks <?php class db { var $totalquerys=0; function connect($sqlhost, $sqluser, $sqlpass){ $db=mysql_connect($sqlhost, $sqluser, $sqlpass) or die("Cant connect to Database!"); return $db; } function select_db($sqldb){ mysql_select_db($sqldb) or die("Cant select Database"); $this->totalquerys++; } function query($sqlquery){ $result=mysql_query($sqlquery); if(empty($result)){ $sqlerror = mysql_error(); $line = __LINE__; echo "<b>MySQL Returned Error:</b><br/><textarea rows=10 cols=40>$sqlerror</textarea><br />on Line: $line<br /><br /><b>Query:</b><br /><textarea rows=10 cols=40>$sqlquery</textarea>"; exit(); } $this->totalquerys++; return $result; } function qfetch($sqlquery){ $result=mysql_query($sqlquery); if(empty($result)){ $sqlerror = mysql_error(); $line = __LINE__; echo "<b>MySQL Returned Error:</b><br/><textarea rows=10 cols=40>$sqlerror</textarea><br />on Line: $line<br /><br /><b>Query:</b><br /><textarea rows=10 cols=40>$sqlquery</textarea>"; exit(); } $row=mysql_fetch_assoc($result); return $row; } function fetch($result){ $row=mysql_fetch_assoc($result); return $row; } function num_rows($result){ $rows=mysql_num_rows($result); return $rows; } function qnum_rows($fieldlist, $table, $field="", $value="", $operator="="){ if(!empty($field)&&!empty($value)) echo "SELECT " . $fieldlist . " FROM sf_" . $table . " WHERE " . $field . " " . $operator . " '" . $value ."'"; if(!empty($field)&&!empty($value)) $result = $this->query("SELECT " . $fieldlist . " FROM sf_" . $table . " WHERE " . $field . " " . $operator . " '" . $value ."'"); else $result = $this->query("SELECT $fieldlist FROM sf_$table"); $rows = $this->num_rows($result); return $rows; } function close($conn){ mysql_close($conn); } } $db=new db; ?>
  4. Hi, can anyone help me fix this as im quite inexpierenced. Getting error on a contact form. MSQL returned error: Unknown column 'admin' in 'where clause' Query: SELECT * FROM sf_users WHERE admin ='1' Code: <?php require("./global.php"); if(isset($_POST['submit']) && !empty($_POST['c_mail']) && !empty($_POST['c_subject']) && !empty($_POST['c_text']) ){ $result = $db->query("SELECT * FROM ".$pfx."_users WHERE admin ='1'"); while($admins = $db->fetch($result)){ $header = "From: $globalsettings[sendermail]"; mail($admins['mail'], "Contact Mail: $_POST[c_subject]", "This is a Mail from the Contact Form. Reply to: $_POST[c_mail] IP Adress of the User: $_SERVER[REMOTE_ADDR] Message: $_POST[c_text]", $header); } eval ("dooutput(\"".gettemplate($tplfolder . "header")."\");"); eval ("dooutput(\"".gettemplate($tplfolder . "contact_success")."\");"); eval ("dooutput(\"".gettemplate($tplfolder . "footer")."\");"); exit(); } eval ("dooutput(\"".gettemplate($tplfolder . "header")."\");"); eval ("dooutput(\"".gettemplate($tplfolder . "contact")."\");"); eval ("dooutput(\"".gettemplate($tplfolder . "footer")."\");"); $db->close($sqlconn); ?>
  5. Hi, does anyone know where can I find an affiliate script like freeipods.com etc.?? Thanks
×
×
  • 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.