Jump to content

MidOhioIT

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by MidOhioIT

  1. Mchl, Thanks for your help. I did that put still got the same error. The error does not go away until i take away the entire php block: <?php include("inc/dbconnect.php"); $cat_sql = "SELECT * FROM categories order by display_order"; while ($cat_row = mysql_fetch_array($cat_sql)) { echo "267";// $navigation_name = "$cat_row['navigation_name']"; $navigation_name2 = "{$cat_row['navigation_name']}"; // $type = '$cat_row["type"]'; if($type == "sub") {$navigation_name2 = " $navigation_name"; } echo "<option value='".$navigation_name."'>".$navigation_name2."</option>" ; } ?> Is it possible that i can not do php the the $html_form = <<< END_HTML like i want to?
  2. Can anyone view my code and tell me why im getting the error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/thesmi6/public_html/registration2.php on line 266 266 starts at the code: <?php include("inc/dbconnect.php"); $cat_sql = "SELECT * FROM categories order by display_order"; while ($cat_row = mysql_fetch_array($cat_sql)) { echo "267"; //$navigation_name = "$cat_row['navigation_name']"; $navigation_name2 = '$cat_row["navigation_name"]'; $type = '$cat_row["type"]'; if($type == "sub") {$navigation_name2 = " $navigation_name"; } echo "<option value='".$navigation_name."'>".$navigation_name2."</option>" ; } ?> I tried to do these lines many ways but not sure if this can even be done at all... I think it may have something to do with how its in a function but not positive of that either. $html_form = <<< END_HTML <form method="POST" action="registration2.php" name="reg_form"> <input type="hidden" name="action" value="submit"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"> </td> <td width="630" valign="top"><table width="642" height="596" border="0" cellpadding="0" cellspacing="0" background="images/registrationbox1.png" STYLE=" background-repeat:no-repeat; background-position:top;"> <tr> <td width="21" height="40"> </td> <td colspan="3"><div align="center"><span class="style20">Register Now! </span></div></td> <td width="30"> </td> </tr> <tr> <td rowspan="19"> </td> <td width="199" height="23" valign="middle"><div align="right" class="style11">* UserName : </div></td> <td width="9" height="23" valign="middle"> </td> <td width="383" height="23" valign="middle"><input name="username" type="text" value="$username" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['username']}</span></td> <td rowspan="19"> </td> </tr> <tr> <td height="23"><div align="right" class="style11">* Password : </div></td> <td width="9" height="23"> </td> <td height="23" valign="middle"><input name="password" type="password" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['password']}</span></td> </tr> <tr> <td height="23"><div align="right" class="style11">* Password Again: </div></td> <td width="9" height="23"> </td> <td height="23" valign="middle"><input name="password2" type="password" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['password2']}</span></td> </tr> <tr> <td height="23"><div align="right" class="style11">* Advertiser Name : </div></td> <td width="9" height="23"> </td> <td height="23" valign="middle"><label> <input name="ad_name" type="text" value="$ad_name" class="style2" size="35" /> </label> <span style="color:{$ErrColor};"> {$formError['ad_name']}</span></td> </tr> <tr> <td height="23"><div align="right" class="style11">* Contact Name : </div></td> <td width="9" height="23"> </td> <td height="23" valign="middle"> <input name="cname" type="text" value="$cname" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['cname']}</span></td> </tr> <tr> <td height="23"><div align="right" class="style11">* Phone : </div> </td> <td width="9" height="23"> </td> <td height="23" valign="middle"><input name="phone" type="text" value="$phone" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['phone']}</span></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">Email : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><input name="email" type="text" value="$email" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['email']}</span></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">* Billing Address : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><input name="b_address" type="text" value="$b_address" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['b_address']}</span></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">* City : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><input name="city" type="text" value="$city" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['city']}</span></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">* State : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><input name="state" type="text" value="$state" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['state']}</span></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">* Zip Code : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><input name="zip" type="text" value="$zip" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['zip']}</span></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">* # categories/coupons : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><p> <label> <input type="radio" name="num_cat" value="1" /> <span class="style11">1</span></label> <label> <input type="radio" name="num_cat" value="2" /> <span class="style11">2</span></label> <label> <input type="radio" name="num_cat" value="3" /> <span class="style11">3</span></label> <span style="color:{$ErrColor};"> {$formError['num_cat']}</span> </p></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">* category heading(s) : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><select name="select_cat" class="style14"> <option value="Select Categories">Select Categories</option> <?php include("inc/dbconnect.php"); $cat_sql = "SELECT * FROM categories order by display_order"; while ($cat_row = mysql_fetch_array($cat_sql)) { echo "267"; //$navigation_name = "$cat_row['navigation_name']"; $navigation_name2 = '$cat_row["navigation_name"]'; $type = '$cat_row["type"]'; if($type == "sub") {$navigation_name2 = " $navigation_name"; } echo "<option value='".$navigation_name."'>".$navigation_name2."</option>" ; } ?> </select></td> </tr> <tr> <td height="23" valign="middle"><div align="right" class="style11">web address : </div></td> <td height="23" valign="middle"> </td> <td height="23" valign="middle"><input name="web_address" type="text" value="$web_address" class="style2" size="35" /> <span style="color:{$ErrColor};"> {$formError['web_address']}</span></td> </tr> <tr> <td height="50" colspan="3" valign="top"><div align="center"> <label> <br /> <input type="submit" name="Submit" value="Submit" /> </label> <label> <input type="reset" name="Submit2" value="Reset" /> </label> </div></td> </tr> </table></td> <td width="16"> </td> <td width="222" valign="top" background="images/infobox2.png" STYLE=" background-repeat:no-repeat; background-position:top;"><table width="100%" height="361" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="8" rowspan="9"> </td> <td width="87%" height="55"> </td> <td width="5" rowspan="9"> </td> </tr> <tr> <td height="34"><span class="style19">Phone: </span><span class="style2">(740) 555 - 6677</span><span class="style19"> Fax: </span><span class="style2">(740) 666 - 8899 </span></td> </tr> <tr> <td height="32" valign="bottom"><span class="style19">Email:</span></td> </tr> <tr> <td height="26" valign="middle"><span class="style2">info@buckeyediscount.com</span></td> </tr> <tr> <td height="25"> </td> </tr> <tr> <td height="56" align="center" valign="middle"><img src="images/facebooklink.jpg" width="171" height="56" border="0" usemap="#Map" /></td> </tr> <tr> <td height="25"> </td> </tr> <tr> <td height="76" align="center" valign="middle"><img src="images/twitterlink.jpg" width="169" height="76" border="0" usemap="#Map2" /></td> </tr> <tr> <td> </td> </tr> </table> <map name="Map" id="Map"> <area shape="rect" coords="3,3,167,49" href="http://www.facebook.com" /> </map> <map name="Map2" id="Map2"> <area shape="rect" coords="2,4,159,66" href="http://www.twitter.com" /> </map> </td> <td width="10"> </td> </tr> </table> </form> END_HTML;
  3. cags, thanks for your help. I notice that it puts a "+" on it. so i just had to do a $business = str_replace('+', ' ', $business); to get rid of the place and allow spaces again. this worked, thank you for your help !
  4. Can someone tell me why the following code is not working correctly? The scenerio is that the variable $business_name = "teeth fixes" it only gets the first word and not the entire phrase. If I do "teeth_fixes" then it will get the entire phrase. For some reason when it hits the space it cuts the rest off. The same variable business name just before the "</a>" in the link has the whole name just fine, it has something to do with the param function i guess?? I even tried to do the link different like this: echo"<tr> <td><a href=show_coupon.php?business=".$business_name.">$business_name</a> <td> </tr>"; But that did not seem to work either. Here is the code that is breaking the words. Not sure why or how to fix it while ($row = mysql_fetch_array($cat_coupons)) { $business_name = $row["business_name"]; echo"<tr> <td><a href=show_coupon.php?business=$business_name>$business_name</a></td> </tr>"; } Any help in advanced is appriciated.
  5. Can someone please help me? I keep getting blank forms being mailed to me or bots (spam) being put into my forms. I checked and there is no way that I can see you can do this becasue I put in code to prevent the blank form anyways using the form. it looks as if maybe my form is being bypassed. any solutions would be nice... Here is an example of one that is coming in blank: Form: <form name="form1" action="mail.php" enctype="multipart/form-data" onSubmit="return checker()"> <table width="364" border="0" cellspacing="0" cellpadding="0"> <tr align="left" valign="middle" class="style2"> <td width="89" height="22">Your first name:</td> <td height="22"><input type="text" name="textfield" style="width:275px; height:20px; font-family:tahoma; font-size:11px; border:1px solid #BEC0C2 "></td> </tr> <tr align="left" valign="middle" class="style2"> <td width="89" height="22">Your last name:</td> <td height="22"><input type="text" name="textfield2" style="width:275px; height:20px; font-family:tahoma; font-size:11px; border:1px solid #BEC0C2 "></td> </tr> <tr align="left" valign="middle" class="style2"> <td width="89" height="22">E-mail address:</td> <td height="22"><input type="text" name="textfield3" style="width:275px; height:20px; font-family:tahoma; font-size:11px; border:1px solid #BEC0C2 "></td> </tr> <tr align="left" valign="middle" class="style2"> <td width="89" height="22">Your telephone:</td> <td height="22"><input type="text" name="textfield4" style="width:275px; height:20px; font-family:tahoma; font-size:11px; border:1px solid #BEC0C2 "></td> </tr> <tr align="left" valign="top" class="style2"> <td width="89"><div style="padding-left:0px; padding-top:5px">Your message:</div></td> <td><textarea name="textarea" style="width:275px; height:123px; font-family:tahoma; font-size:11px; border:1px solid #BEC0C2; overflow:auto "></textarea></td> </tr> <tr align="left" valign="middle" class="style2"> <td width="89" height="34"> </td> <td height="34" align="right" valign="bottom"> <input name="Submit" type="submit" class="style5" value="Submit"> <input name="Reset" type="reset" class="style5" value="Reset"> </td> </tr> </table> <label></label> </form> Here is the java script that tried to stop the empty fields: <script Language="JavaScript" type="text/javascript"> function checker() { if ( (form1.textfield.value.length == 0 ) || (form1.textfield2.value.length == 0 ) ||(form1.textfield4.value.length == 0 ) ) { // If there were less then selections made display an alert box alert("Please fill in all Required fields - First name, Last name and Telephone") return (false); form1.name.focus(); } return (true); } // end function checkbox_checker() </script> mail.php: <?php //get all the variables from the form require_once ('class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "localhost"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "****"; // SMTP username $mail->Password = "***"; // SMTP password $mail->From = "info@****.com"; $mail->FromName = "****"; $mail->AddAddress("***@ohio.com"); $mail->AddAddress("designteam@***.com"); $mail->AddReplyTo("$email"); $mail->WordWrap = 50; // set word wrap //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); $mail->IsHTML(true); // send as HTML $mail->Subject ="Website form"; $mail->Body = "<b>-- Clients Information from Contact page --</b> </br></br> <b>Name:</b> $textfield $textfield2 </br> <b>Phone:</b> $textfield4</br> <b>Email:</b> $textfield3 </br> <b>Comments:</b> $textarea " ; $mail->AltBody = "This is the text-only body"; if(!$mail->Send()) { echo "Message was not sent, please try again. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } // message is sent! echo "<center><meta http-equiv='refresh' content='7; url=http://www.***.com'></center>"; echo "<center><br><h5>Thank you for contacting us.</h5></center>"; ?>
  6. THANK YOU that is exactly what I needed. I was having problems getting me concatenation to store in the variable correctly. Much THANKS
  7. What does the code look like where you declare the id? For example this is a link that you have to click on located on a website that controls my id: <td><b><a href='menu.php?param=id'>Invoice number</a></b></td> which then goes and runs this: $result = mysql_query("SELECT * FROM invoices ORDER BY $param",$db);
  8. What I am trying to do is take x amount of records coming back from the database where "x" is unknown. Capture that number by looping through and each time it loops through the count, make a new instance of a variable so that it will not be over written. I need to save each record as it is being used as a new row on a table. Here is my code: $result = mysql_query("SELECT * FROM invoiceItems where invoiceID = '$invoiceid' ",$db); $numrows = mysql_num_rows($result); $tableCounter = $numrows; $row = 'row'; while ($row = mysql_fetch_array($result)) { $invoiceItem = $row["Item"]; $invoiceDescription = $row["description"]; $invoiceItemPrice = $row["itemPrice"]; $tableItems =" <tr> <td width='10'> </td> <td width='271'><div align='left'>$invoiceDescription</div></td> <td><div align='center'>355</div></td> <td width='94'><div align='right'>$</div></td> <td width='74'><div align='left'>$invoiceItemPrice</div></td> </tr>"; while ( $tableCounter >= 1 ) { $row.$tableCounter = $tableItems; $tableCounter = $tableCounter - 1; } $alltableItems = $row1.$row2.$row3.$row4; } Please help and thanks in advance
×
×
  • 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.