Jump to content

glenthecomputerguy

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

glenthecomputerguy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh, Wildteen88 ... That was EXACTLY what it was! I forgot that I had the doctype (and head, html, body) entries in those files!!!!!!!!!!!!!! Thank you so much for your time and reply, Wildteen88! Take care, (no longer) "stumped" Glen the Computer Guy
  2. OKAY, Ken, here's what you asked for (cut off at the beginning of the generation of the page, but including the open/close of the dbase and related php coding): <?php include 'library/config.php'; include 'library/opendb.php'; // ************************************************************* // SET THE Category Type ($catType) AS PASSED BY USER SELECTION // ************************************************************* switch ($_GET["cat"]) { case dining: $catType = "Dining & Restaurants"; break; case auto: $catType = "Automotive"; break; case hair: $catType = "Hair & Beauty"; break; case health: $catType = "Health & Fitness"; break; case home: $catType = "Home Improvement"; break; case medical: $catType = "Medical Services"; break; case professional: $catType = "Professional Services"; break; case retail: $catType = "Retail & Other Services"; break; default: $catType = "Dining & Restaurants"; } $pageNumber = 1; switch ($_GET["page"]) { case 1: $pageNumber = 1; break; case 2: $pageNumber = 2; break; case 3: $pageNumber = 3; break; case 4: $pageNumber = 4; break; case 5: $pageNumber = 5; break; case 6: $pageNumber = 6; break; default: $pageNumber = 1; } $category = ($_GET["cat"]); $zoneToBeDisplayed = ($_GET["area"]); // *************************************************************************************** // SET THE Page Number ($pageNumber) of $catType BY DEFAULT ***ALL*** OR FROM USER SELECTION // *************************************************************************************** // $pageNumber = 1; // ********************************************************************************* // SET THE MAXIMUM NUMBER OF ROWS THAT WILL BE DISPLAYED ON EACH CATEGORY PAGE HERE // ********************************************************************************* $maxRowsPerPage = 9; // ************************************************************************************************* // QUERY ADVERTISERS DATABASE (advertisers), SELECTING CATEGORY TO BE DISPLAYED (busType='$catType') // ************************************************************************************************* switch ($zoneToBeDisplayed) { case 0: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' ORDER BY busName"; $showArea = "Serving Orange County"; break; case 1: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' && ( (zone = '0') || (zone = '1') || (zone = '5') || (zone = '6') || (zone = '8')) ORDER BY busName"; $showArea = "Serving Tustin"; break; case 2: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' && ( (zone = '0') || (zone = '2') || (zone = '5') || (zone = '8') || (zone = 'b') || (zone = 'd')) ORDER BY busName"; $showArea = "Serving Irvine North"; break; case 3: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' && ( (zone = '0') || (zone = '3') || (zone = '6') || (zone = '8') || (zone = 'b') || (zone = 'd') || (zone = 'e')) ORDER BY busName"; $showArea = "Serving Irvine South"; break; case 4: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' && ( (zone = '0') || (zone = '4') || (zone = '9') || (zone = 'd') || (zone = 'e')) ORDER BY busName"; $showArea = "Serving Lake Forest"; break; case 5: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' && ( (zone = '0') || (zone = '7') || (zone = '9')) ORDER BY busName"; $showArea = "Serving Mission Viejo & RSM"; break; default: $query = "SELECT * FROM advertisers0903 WHERE busType='$catType' ORDER BY busName"; $showArea = "Serving Orange County"; } // ******************************************************************************* // STORE THE SELECTED advertisers by $catType IN AN ARRAY ($advertisersToBeListed) // ******************************************************************************* $arrayOfAdsToDisplay = @mysql_query($query); // ************************************************************ // SHOW AN ERROR IF THE ARRAY ($arrayOfAdsToDisplay) IS EMPTY! // ************************************************************ if (!$arrayOfAdsToDisplay) { exit ('Database error: ' . mysql_error()); } // ************************************************************************************************************* // DETERMINE THE NUMBER OF ROWS TO BE DISPLAYED ON THE WEB PAGE (FOUND WITHIN THE SELECTED $catType ADVERTISERS) // ************************************************************************************************************* $totalRowsToDisplay = mysql_num_rows($arrayOfAdsToDisplay); // ********************************************************************************************** // *IF* THE NUMBER OF ROWS OF ADVERTISERS IS LESS THAN THE NUMBER OF ROWS TO DISPLAY ON ONE PAGE // THEN SET THE VARIABLE ($totalPagesToDisplay) to 1 // ********************************************************************************************** if ($totalRowsToDisplay <= $maxRowsPerPage) { $totalPagesToDisplay = 1; $rowsOnLastPage = $totalRowsToDisplay; } // **************************************************************************** // *IF* THERE IS MORE THAN ONE PAGE OF ADVERTISERS TO DISPLAY ON THE SITE // DETERMINE HOW MANY PAGES ARE TO BE DISPLAYED // ROUNDING 'UP' IF THERE IS A REMAINDER OF THE FORMULA // **************************************************************************** else { $rowsOnLastPage = (fmod($totalRowsToDisplay, $maxRowsPerPage)); if ($rowsOnLastPage == 0) { $totalPagesToDisplay = floor(($totalRowsToDisplay / $maxRowsPerPage)); } else { $totalPagesToDisplay = (floor(($totalRowsToDisplay / $maxRowsPerPage)) + 1); } } // NOW display, for debugging purposes, // ********************** // the number of rows in the category and, // the number of rows on the last page and, // the number of pages to be displayed =8-) // echo 'Total Rows: (' . $totalRowsToDisplay . ') Rows on Last Page: (' . $rowsOnLastPage . ') Total Pages: (' . $totalPagesToDisplay . ') Category: (' . $category . ')<br />'; include 'library/closedb.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> <title>Hometown - Orange County Direct Mail Advertising</title> <meta http-equiv="Content-Language" content="en-us" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="description" content="Description" /> <meta name="keywords" content="Keywords" /> <meta name="author" content="Glen the Computer Guy for Hometown OC" /> <link href="p7exp/p7exp.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="p7exp/p7exp.js"></script> <!--[if lte IE 7]> <style> #menuwrapper, #p7menubar ul a {height: 1%;} a:active {width: auto;} </style> <![endif]--> <style type="text/css" media="all">@import "css/masterNEW.css";</style> <script type="text/javascript" src="p7pm/p7popmenu.js"></script> <style type="text/css" media="screen"> <!-- @import url("p7pm/p7pmv0.css"); .ltPurpleWhiteBG, a.ltPurpleLinksWhiteBG { background-color: #CC3366; color: #000000; } #ltPurpleWhiteBG li a { background-color: #CC3366; color: #000000; } #ltPurpleWhiteBG li a:hover { background-color: #FFFFFF; color: #000000; } --> </style> </head> <body onLoad="P7_initPM(0,0,1,-20,10);P7_ExpMenu()"> <?php include("_preHeaderSplash.html"); ?> <div id="page-container"> Now, please be gentle with me, Ken (et al who reply) ... thanks a MILLION!!! still-"stumped" Glen the Computer Guy (edited by kenrbnsn to replace the [pre][/pre] tags with tags)
  3. I just noticed the "view source" code of my html/php/mysql-based website (that I have had online for more than a year) has THREE (duplicate!) HTML doctype,html,header,body entries BEFORE the site's "real" HTML coding ... This is what shows in the "source view" - repeated 3 times! - before the "real" HTML/PHP/MSYQL coding for the site begins: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> </body> </html> Can someone please tell me why this is happening? What other pieces of information/coding do you need from me to help clarify this for an answer? Thank you so much! "Stumped" GlentheComputerGuy (edited by kenrbnsn to replace the [pre][/pre] tags with tags)
  4. Thank you for the 'pat on the brain' ... I'll redo the code to use a more secure method. I'll investigate the process, as you describe it: I really appreciate your follow-up with your astute comment/recommendation. Thanks, AndyB
  5. AndyB .... I changed those errors (name vs yourname & email vs youremail) and that helped the thing along. Sorry I did not mention that when I also confirmed that the form was working after the register_globals permission was set to ON. Glen
  6. :) I guess it took a few hours to get the 'change' to take place on the server this morning. I tried the form on the website and suddenly it started working!!!!!!!! Thanks, AndyB, for your help in this. It was the "register_globals" apparently. Take care! Glen
  7. Greetings again! I've just heard from the hosting company. They've turned both "register_globals" ON (Local Value and Master Value) ... And, retried the script. To no avail - same error message! What's a fellow to do now? I do appreciate your time (AndyB and whomever else would please feel free to comment)... Cheers! Glen
  8. Thank you, AndyB, for your input. I contacted the server people. They tell me the "register_globals" is ON. Here's what I see in the link they sent me: register_globals [Local Value] = On [Master Value] = Off They tell me to try it again, the form page and formmail script. It still it comes up with the error message when submitted: the following fields must be filled in. 1. You forgot to write your name 2. Your forgot to write your email address. SIGH ... Maybe this will help? (a link to the actual page): http://www.youluckydawg.com/emailfriend.html BTW, your suggestion to Uh ... I don't know/see where to put that. Can you help me understand your request/suggestion? Thanks again, AndyB ... and anyone else who wants to 'have at it' here - PLEASE DO! Glen
  9. Greetings! I've just taken over hosting a website (I moved it to a server I use) which contains formmail code. The formmail error checking process (from what I've been told) used to work OK. But, after moving the site to the new server and testing the 'contact us' page (which contains the unchanged formmail code), I've not been able to get a successful submission of the form/data. I've been trying to figure this our for several days, but must ask for outside help. I fill in the input boxes with valid entries (my name & my valid email address, in both places) yet continually receive the following error message/page: the following fields must be filled in. 1. You forgot to write your name 2. Your forgot to write your email address. HELP! Thanks! Glen (I hope I've put the code properly on this page. Didn't see a 'code' parameter in which I should have enclosed it!) Here's the 'contact us' page code: <form action="php/forfriend.php" method="post" enctype="multipart/form-data"> <p> <input type="hidden" name="recipient" value="me@mywebsite.com" /> <input type="hidden" name="subject" value="Friend Referral: Name + Email " /> <span class="style1">Thank for taking the time to contact us!</span> </p> <p> <span class="style1"> <span class="style2">TELL A FRIEND </span> Your Name: <input name="name" type="text" id="yourname" value="Name" size="20" /> Your Email: <input name="email" type="text" id="youremail" value="E-Mail" size="20" /> </span> </p> <p> <span class="style1"> Friends Name: <input name="friendsname" type="text" id="friendsname" value="Name" size="20" /> Friends Email: <input name="friendsemail" type="text" id="friendsemail" value="E-Mail" size="20" /> </span> </p> <p class="style1">Note for Friend: </p> <p class="style1"> <textarea name="notetofriend" cols="30" rows="10" id="notetofriend"></textarea> </p> <p> <input type="submit" name="submit" value="E-Mail Me!" /> <input type="hidden" name="redirect" value="www.mywebsite.com/home.html" /> </p> <p class="style1"> </p> </form> Here's the formmail code: <? $mail="me@mywebsite.com"; $subject="People Interested in Knowing More"; $thank="thank.html"; $no_name="You forgot to write your name"; $mail_error="Your forgot to write your email address."; $error_title="wrong parameters"; $back='#ffffff'; $text='#000000'; $h2='#cccccc'; $error_message="the following fields must be filled in."; $result=1; if($yourname==""){ $result=0; $error="<li>$no_name</li>"; } else{ $mailbody="Name : $yourname\n"; } if ($youremail!==""){ if (!eregi("^.+@.+\\..+$", $youremail)){ $error4="<li>$mail_error</li>"; $result=0; } } else{ $youremail=trim($youremail); } $mailbody.="name: $yourname\n"; $mailbody.="email: $youremail\n"; $mailbody.="friendsname: $friendsname\n"; $mailbody.="friendsemail: $friendsemail\n"; $mailbody.="notetofriend: $notetofriend\n"; $mailbody.="---------------\n"; $mailbody.="USER INFO\n"; $mailbody.="---------------\n"; $mailbody.="User use :$HTTP_USER_AGENT\n"; $mailbody.="Send via :$HTTP_VIA\n"; $mailbody.="ip adress is :$REMOTE_ADDR\n"; $mailbody.="Remote host is : $REMOTE_HOST\n"; $mailbody.="-------------\n"; $date=date("m/d/Y H:i:s"); $mailbody.="SERVER INFO\n"; $mailbody.="send date/time : $date\n"; $mailbody.="Came From web : $HTTP_HOST\n"; $mailbody.="Came from Ip number : $SERVER_ADDR\n"; $mailbody.="FILE name : $SCRIPT_FILENAME\n"; if ($result==1){ mail($mail,$subject,$mailbody,"From: $email\n"); Header ("Location: $thank"); } if ($result!=="1"){ echo ("<body bgcolor=$back text=$text><title>$error_title</title> <center><h2><font color='$h2'>$error_message</font></h2></center><ol>$error$error1$error2$error3$error4 $error5$error6</ol></center></body>"); } ?>
×
×
  • 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.