Jump to content

fncuis

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fncuis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Max Rows allows me to specify how many records are displayed per page before the viewer hits next. I have a 170 records, all records get returned. Thanks, -F
  2. Hello again, I created a search query that should only return results that are like the one entered in the "search field" of the search page. However, when ever i enter any value in the search field it returns all records in my table. Here is my SQL statement: <?php $currentPage = $_SERVER["PHP_SELF"]; $maxRows_rs1 = 50; $pageNum_rs1 = 0; if (isset($_GET['pageNum_rs1'])) { $pageNum_rs1 = $_GET['pageNum_rs1']; } $startRow_rs1 = $pageNum_rs1 * $maxRows_rs1; $sterm_rs1 = "1"; if (isset($_GET['sterm'])) { $sterm_rs1 = (get_magic_quotes_gpc()) ? $_GET['sterm'] : addslashes($_GET['sterm']); } mysql_select_db($database_msds, $msds); $query_rs1 = sprintf("SELECT * FROM msds WHERE msds.`ref` LIKE 'stermterm%%' OR msds.description LIKE '%%%s%%' OR msds.manufacturer LIKE '%%%%s%%' ORDER BY msds.`ref`ASC", $sterm_rs1); $query_limit_rs1 = sprintf("%s LIMIT %d, %d", $query_rs1, $startRow_rs1, $maxRows_rs1); $rs1 = mysql_query($query_limit_rs1, $msds) or die(mysql_error()); $row_rs1 = mysql_fetch_assoc($rs1); if (isset($_GET['totalRows_rs1'])) { $totalRows_rs1 = $_GET['totalRows_rs1']; } else { $all_rs1 = mysql_query($query_rs1); $totalRows_rs1 = mysql_num_rows($all_rs1); } $totalPages_rs1 = ceil($totalRows_rs1/$maxRows_rs1)-1; ?> Any ideas how to filter down? All the best, -F
  3. Hey Morpheus, I forgot to change that line back when i was experimenting... Ironically that action was there first and it still does/did not work. http://www.hornerxpressfinancialservices.com/dealers/reg.txt ive saved it online as a txt file this way i dont have to keep pasting every line of code in here... Check it out, i have it with the changed action and it still does not work. The page simply reloads itself. -F
  4. I've been reading up on registered_globals... it's turned off. I checked the code generated by DMX and it uses superglobals where needed. Im sooo stumped on this! -F
  5. <?php require_once('../Connections/hfs1.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"] == "dealerReg")) { $insertSQL = sprintf("INSERT INTO users (username, password, company, name, address, city, `state`, zip, phone, fax, email, usrGroup) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['usrName'], "text"), GetSQLValueString($_POST['pwd'], "text"), GetSQLValueString($_POST['cName'], "text"), GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['add1'], "text"), GetSQLValueString($_POST['city'], "text"), GetSQLValueString($_POST['state'], "text"), GetSQLValueString($_POST['zipCode'], "text"), GetSQLValueString($_POST['phone'], "text"), GetSQLValueString($_POST['fax'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['userGroup'], "text")); mysql_select_db($database_hfs1, $hfs1); $Result1 = mysql_query($insertSQL, $hfs1) or die(mysql_error()); $insertGoTo = "login.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- InstanceBegin template="/Templates/hfs04.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>HornerXpress Financial Services | Home Improvement Loans, Pool Loans, Pool Finance Loans, Enhance Your Pool, Increase Your Home's Equity</title> <script language="JavaScript" type="text/JavaScript"> <!-- <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } //--> </script> <link href="/css/textStyles.css" rel="stylesheet" type="text/css"> <link href="/css/bodyStyles.css" rel="stylesheet" type="text/css"> <link href="/css/verdana.css" rel="stylesheet" type="text/css"> </head> <body class="bodyProperties" onLoad="MM_preloadImages('/assets/footer_r1_c1_f2.gif','/assets/footer_r1_c3_f2.gif','/assets/footer_r1_c5_f2.gif','/assets/footer_r1_c7_f2.gif','/assets/footer_r1_c9_f2.gif','/assets/footer_r1_c11_f2.gif')"> <div align="center"> <table width="50%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="134" align="center" valign="top"><table align="center" border="0" cellpadding="0" cellspacing="0" width="725"> <!-- fwtable fwsrc="hfsmast.png" fwbase="header.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" --> <tr> <td><img src="/assets/spacer.gif" width="43" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="161" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="88" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="11" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="95" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="12" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="83" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="12" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="106" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="12" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="100" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="2" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td colspan="12"><a href="/index.html"><img name="header_r1_c1" src="/assets/header_r1_c1.gif" width="725" height="91" border="0" alt="Return To Home Page"></a></td> <td><img src="/assets/spacer.gif" width="1" height="91" border="0" alt=""></td> </tr> <tr> <td rowspan="2"><a href="/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header_r2_c1','','/assets/header_r2_c1_f2.gif',1)"><img name="header_r2_c1" src="/assets/header_r2_c1.gif" width="43" height="42" border="0" alt="Home Page"></a></td> <td colspan="11"><img name="header_r2_c2" src="/assets/header_r2_c2.gif" width="682" height="2" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="1" height="2" border="0" alt=""></td> </tr> <tr> <td><img name="header_r3_c2" src="/assets/header_r3_c2.gif" width="161" height="40" border="0" alt=""></td> <td><a href="/benefits.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header_r3_c3','','/assets/header_r3_c3_f2.gif',1)"><img name="header_r3_c3" src="/assets/header_r3_c3.gif" width="88" height="40" border="0" alt="Calculators"></a></td> <td><img name="header_r3_c4" src="/assets/header_r3_c4.gif" width="11" height="40" border="0" alt=""></td> <td><a href="/finance.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header_r3_c5','','/assets/header_r3_c5_f2.gif',1)"><img name="header_r3_c5" src="/assets/header_r3_c5.gif" width="95" height="40" border="0" alt="Follow to Education..."></a></td> <td><img name="header_r3_c6" src="/assets/header_r3_c6.gif" width="12" height="40" border="0" alt=""></td> <td><a href="/dealers/reg.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header_r3_c7','','/assets/header_r3_c7_f2.gif',1)"><img name="header_r3_c7" src="/assets/header_r3_c7.gif" width="83" height="40" border="0" alt="Dealers Register Here"></a></td> <td><img name="header_r3_c8" src="/assets/header_r3_c8.gif" width="12" height="40" border="0" alt=""></td> <td><a href="/contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header_r3_c9','','/assets/header_r3_c9_f2.gif',1)"><img name="header_r3_c9" src="/assets/header_r3_c9.gif" width="106" height="40" border="0" alt="HFS Contact Information"></a></td> <td><img name="header_r3_c10" src="/assets/header_r3_c10.gif" width="12" height="40" border="0" alt=""></td> <td><a href="/appinstruct.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header_r3_c11','','/assets/header_r3_c11_f2.gif',1)"><img name="header_r3_c11" src="/assets/header_r3_c11.gif" width="100" height="40" border="0" alt="HFS Application Link"></a></td> <td><img name="header_r3_c12" src="/assets/header_r3_c12.gif" width="2" height="40" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="1" height="40" border="0" alt=""></td> </tr> </table></td> </tr> <tr> <td height="667" valign="top"><table width="100%" height="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="bodyTablebg"> <tr> <td width="20%" align="left" valign="top"><table width="100%" height="600" border="0" cellpadding="0" cellspacing="0" class="rightBorder"> <tr> <td align="left" valign="top"><table width="100%" border="0" align="left" cellpadding="5" cellspacing="1"> <tr> <td align="left" valign="top" bgcolor="#0073E6"><strong>HFS Links </strong></td> </tr> <tr> <td align="left" valign="top"><a href="/index.html">Home</a></td> </tr> <tr> <td align="left" valign="top"><a href="/finance.html">Financing</a></td> </tr> <tr> <td align="left" valign="top"><a href="/benefits.html">Benefits</a></td> </tr> <tr> <td align="left" valign="top"><a href="/dealers/reg.php">Dealers</a></td> </tr> <tr> <td align="left" valign="top"><a href="/Calculator/calculators.html">Calculators</a></td> </tr> <tr> <td align="left" valign="top"><a href="/contact.html">Contact Us </a></td> </tr> <tr> <td align="left" valign="top"><a href="/feedback.html">Feedback</a></td> </tr> <tr> <td align="left" valign="top"><a href="/app.html">Apply Now </a></td> </tr> <tr> <td align="left" valign="top"><a href="/dealers/login.php">Log-In</a></td> </tr> <tr> <td align="left" valign="top" bgcolor="#0073E6"><strong>Related Links </strong></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.hornerxpress.com" target="_blank">HornerXpress</a></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.aquacal.com" target="_blank">AquaCal</a></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.autopilot.com" target="_blank">AutoPilot</a></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.hxworldwide.com" target="_blank">HXWorldWide</a></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.tropiclear.com" target="_blank">TropiClear</a></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.lo-chlor.com" target="_blank">Lo-Chlor</a></td> </tr> <tr> <td align="left" valign="top"><a href="http://www.teamhorner.com" target="_blank">Team Horner </a></td> </tr> <tr> <td align="left" valign="top"><img src="/assets/phslug.gif" width="93" height="11"></td> </tr> </table></td> </tr> </table></td> <td width="80%" align="left" valign="top" class="whiteFont"><!-- InstanceBeginEditable name="body" --> <form action="<?php echo $editFormAction; ?>" method="POST" name="dealerReg" id="dealerReg"> <table width="98%" border="0" cellpadding="2" cellspacing="1"> <tr> <td align="left" valign="top"><h2>Dealer Registration </h2></td> </tr> <tr> <td width="100%" align="left" valign="top"> <p>Please take the time to create an account below. By creating an account you will be able to log-in and view Dealer related information.</p> </td> </tr> <tr> <td align="left" valign="top"><span style="color: #FFFFCC">Fields denoted with asterisk(*) are required!</span></td> </tr> <tr> <td align="left" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="22%" align="left" valign="top"><div align="left">Username*:</div></td> <td width="71%"><label> <input name="usrName" type="text" class="fields" id="usrName" tabindex="1"> We recommend your email address</label></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Password*:</div></td> <td><input name="pwd" type="password" class="fields" id="pwd" tabindex="2"></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Company Name*:</div></td> <td><input name="cName" type="text" class="fields" id="cName" tabindex="3"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Your Name*:</div></td> <td><input name="name" type="text" class="fields" id="name" tabindex="4"> Please enter your full name</td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Address*:</div></td> <td><input name="add1" type="text" class="fields" id="add1" tabindex="5"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">City*:</div></td> <td><input name="city" type="text" class="fields" id="city" tabindex="6"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">State*:</div></td> <td><input name="state" type="text" class="fields" id="state" tabindex="7"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Zip Code*:</div></td> <td><input name="zipCode" type="text" class="fields" id="zipCode" tabindex="8"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Phone Number*:</div></td> <td><input name="phone" type="text" class="fields" id="phone" tabindex="9"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Fax Number:</div></td> <td><input name="fax" type="text" class="fields" id="fax" tabindex="10"></td> </tr> <tr> <td width="22%" align="left" valign="top"><div align="left">Email Address*:</div></td> <td><input name="email" type="text" class="fields" id="email" tabindex="11"> ex: alias@domain.com</td> </tr> <tr> <td width="22%" align="left" valign="top"><input name="userGroup" type="hidden" id="userGroup" value="dealer"></td> <td><label> <input name="Submit" type="submit" class="submit" value="Submit" tabindex="12"> </label> <label> <input name="Reset" type="reset" class="submit" value="Reset" tabindex="13"> </label></td> </tr> </table></td> </tr> </table> <input type="hidden" name="MM_insert" value="dealerReg"> </form> <!-- InstanceEndEditable --></td> </tr> </table></td> </tr> <tr> <td height="31" align="center" valign="middle"><table align="center" border="0" cellpadding="0" cellspacing="0" width="725"> <!-- fwtable fwsrc="footer.png" fwbase="footer.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" --> <tr> <td><img src="/assets/spacer.gif" width="43" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="170" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="87" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="2" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="95" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="12" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="83" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="12" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="106" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="12" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="100" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="3" height="1" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td><a href="/index.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('footer_r1_c1','','/assets/footer_r1_c1_f2.gif',1)"><img name="footer_r1_c1" src="/assets/footer_r1_c1.gif" width="43" height="30" border="0" alt="Home Page"></a></td> <td><img name="footer_r1_c2" src="/assets/footer_r1_c2.gif" width="170" height="30" border="0" alt=""></td> <td><a href="/benefits.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('footer_r1_c3','','/assets/footer_r1_c3_f2.gif',1)"><img name="footer_r1_c3" src="/assets/footer_r1_c3.gif" width="87" height="30" border="0" alt=""></a></td> <td><img name="footer_r1_c4" src="/assets/footer_r1_c4.gif" width="2" height="30" border="0" alt=""></td> <td><a href="/finance.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('footer_r1_c5','','/assets/footer_r1_c5_f2.gif',1)"><img name="footer_r1_c5" src="/assets/footer_r1_c5.gif" width="95" height="30" border="0" alt=""></a></td> <td><img name="footer_r1_c6" src="/assets/footer_r1_c6.gif" width="12" height="30" border="0" alt=""></td> <td><a href="/dealers/reg.php" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('footer_r1_c7','','/assets/footer_r1_c7_f2.gif',1)"><img name="footer_r1_c7" src="/assets/footer_r1_c7.gif" width="83" height="30" border="0" alt=""></a></td> <td><img name="footer_r1_c8" src="/assets/footer_r1_c8.gif" width="12" height="30" border="0" alt=""></td> <td><a href="/contact.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('footer_r1_c9','','/assets/footer_r1_c9_f2.gif',1)"><img name="footer_r1_c9" src="/assets/footer_r1_c9.gif" width="106" height="30" border="0" alt=""></a></td> <td><img name="footer_r1_c10" src="/assets/footer_r1_c10.gif" width="12" height="30" border="0" alt=""></td> <td><a href="/appinstruct.html" target="None" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('footer_r1_c11','','/assets/footer_r1_c11_f2.gif',1)"><img name="footer_r1_c11" src="/assets/footer_r1_c11.gif" width="100" height="30" border="0" alt=""></a></td> <td><img name="footer_r1_c12" src="/assets/footer_r1_c12.gif" width="3" height="30" border="0" alt=""></td> <td><img src="/assets/spacer.gif" width="1" height="30" border="0" alt=""></td> </tr> </table></td> </tr> </table> </div> </body> <!-- InstanceEnd --></html>
  6. This might help: <?php require_once('../Connections/hfs1.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"] == "dealerReg")) { $insertSQL = sprintf("INSERT INTO users (username, password, company, name, address, city, `state`, zip, phone, fax, email, usrGroup) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['usrName'], "text"), GetSQLValueString($_POST['pwd'], "text"), GetSQLValueString($_POST['cName'], "text"), GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['add1'], "text"), GetSQLValueString($_POST['city'], "text"), GetSQLValueString($_POST['state'], "text"), GetSQLValueString($_POST['zipCode'], "text"), GetSQLValueString($_POST['phone'], "text"), GetSQLValueString($_POST['fax'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['userGroup'], "text")); mysql_select_db($database_hfs1, $hfs1); $Result1 = mysql_query($insertSQL, $hfs1) or die(mysql_error()); $insertGoTo = "login.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?>
  7. Thanks Morpheus for the reply... I have been trying different ways of getting this form to insert, with different INSERT scripts that i have found online. I reverted back to the DMX INSERT since you stated that the problem isnt there. I was under the impression that it was. Just to let you know, i stripped all the code out and hand coded a small INSERT with to fields into a test db. It worked. It seems to be that when i add a larger amount of fields to INSERT something goes wrong. I do have a hidden field called UserGroup. It will allow me to specify what group that registrant is from when i want to restrict access to specific pages... could it be this hidden form that is preventing me from INSERTing correctly? This is very frustrating because i am not getting any errors. Just a page that reloads and no deposit is made. So i really cant turn anywhere but to help forums. Anyhow, im having a hard time following what you were asking me. The curly brace at the end of my statement. The hfsReg is the name of the form itself. The hidden field "name = usrGroup value = Dealer". When creating the INSERT statement through DMX i have it insert as a "text" field into the db... Im not quite sure about your comment here: "The problem must be in your form. The closing braket for this escape is below header shown below so for your script to reload the same page it is escaping at the above line." http://www.hornerxpressfinancialservices.com/dealers/reg.php Thanks for your diligence, -F
  8. Hello Again! Looking for some help on this very interesting problem... My INSERT statement does not INSERT! Woot! Upon submit, the page it just simply reloads itself, even though i have specified for it to redirect to a log-in page after registration... http://www.hornerxpressfinancialservices.com/dealer/reg.php <snippet> <?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"] == "hfsReg")) { $insertSQL = sprintf("INSERT INTO accountinfo (UserName, Password, FirstName, Address, City, `State`, Zip, Phone, Fax, Email, Company) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['username'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['address'], "text"), GetSQLValueString($_POST['city'], "text"), GetSQLValueString($_POST['state'], "text"), GetSQLValueString($_POST['zip'], "text"), GetSQLValueString($_POST['phone'], "text"), GetSQLValueString($_POST['fax'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['company'], "text")); mysql_select_db($database_hfsphp, $hfsphp); $Result1 = mysql_query($insertSQL, $hfsphp) or die(mysql_error()); $insertGoTo = "login.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> </snippet> Thanks! If i left criteria out let me know...
  9. I'd like to update the post by mentioning that the search results are refined, however, the search term is only functioning in the "description" column of the db. I have specified in the code to search for "sterm" in all columns of the db. Any ideas Guru?
  10. The only difference i see here is that you added $colname_ to the recordset correct? Also, Guru, why is it that when you specify '%sterm%' in the SQL statement window of DW, in the advanced mode, when you switch to view the code in the document it totally changes it to: %%%%s% or something of that nature...? Anywho... here's the code: <?php $currentPage = $_SERVER["PHP_SELF"]; $maxRows_q1 = 50; $pageNum_q1 = 0; if (isset($_GET['pageNum_q1'])) { $pageNum_q1 = $_GET['pageNum_q1']; } $startRow_q1 = $pageNum_q1 * $maxRows_q1; $sterm_q1 = "1"; if (isset($_GET['sterm'])) { $sterm_q1 = (get_magic_quotes_gpc()) ? $_GET['sterm'] : addslashes($_GET['sterm']); } mysql_select_db($database_msdsphp, $msdsphp); $query_q1 = sprintf("SELECT * FROM msds WHERE manufacturer LIKE 'stermterm%%' OR description LIKE '%%%s%%' OR ref LIKE '%%%%s%%' ORDER BY msds.`ref`ASC", $sterm_q1); $query_limit_q1 = sprintf("%s LIMIT %d, %d", $query_q1, $startRow_q1, $maxRows_q1); $q1 = mysql_query($query_limit_q1, $msdsphp) or die(mysql_error()); $row_q1 = mysql_fetch_assoc($q1); if (isset($_GET['totalRows_q1'])) { $totalRows_q1 = $_GET['totalRows_q1']; } else { $all_q1 = mysql_query($query_q1); $totalRows_q1 = mysql_num_rows($all_q1); } $totalPages_q1 = ceil($totalRows_q1/$maxRows_q1)-1; ?>
  11. My dilemna is in the "advanced window" of the recordset creation in DWMX. My SQL statement is as follows: SELECT * FROM msds WHERE msds.`ref`LIKE '%sterm%' OR msds.description LIKE '%sterm%' OR msds.manufacturer LIKE '%sterm%' ORDER BY `ref` ASC Simple enough? However, when i do a search, all records are returned from the DB. I want only the record that is 'LIKE' that of the term entered in the search field of the search page. In ASP a simple "Request.QueryString['varName'] will suffice... from what i have researched for PHP, this statement should do the trick: Name: sterm Value: 1 Run-Time Value: $_GET['sterm'] Still no luck... Help is much appreciated! Thank you!
×
×
  • 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.