Jump to content

Enderpanda

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Enderpanda's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok cool, I'll look into that soon, thanks.
  2. Ah okay, I thought the problem was something like that (since it worked without that part). I just tried doing a print_r($_POST) and sure enough, nothing comes up but "Array()", whether the captcha is passed or failed... that info is definitely going somewhere though hehe, as I am getting an email with all the entered info, if the captcha is passed. I'm pretty new to forms and using submitted data, I'll have to look into using sessions (been meaning to learn more about them anyway... mmm cookies). Is there an easy way to fix this in the meantime, by chance? Possibly changing the action taken with a non-valid response? Passing and failing the captcha both result in being redirected back to the same page with a variable, but they're handled in slightly different ways... A fail is done by the window location change [linked above] (borrowed from a user script, source is in the comments) while a pass is an input variable that, from what I can tell, gets passed to the server cgi script by the code in contact_mailer (the default godaddy form script). <input type="hidden" name="redirect" value="contact.php?captresult=pass" /> Thanks for your help, much appreciated!
  3. Okay I rewrote the contact page into one form file and one processing file, hopefully this will be a lot simpler (please disregard the earlier code I posted)... It actually works without the captcha, but with it the information still isn't being retained (after getting the captcha wrong). I added a back button in the error message, which sometimes works (info still there) and sometimes not (info gone - seems to depend on the browser), as a temporary band-aid. Anyway, without the captcha it seems to keep the data no problem (even though, because of the spry field, you would never really get an "error" since only the message field is required and you can't hit submit without that). I think the reason that the information isn't being retained is because of this (from contact_mailer.php): if (!$resp->is_valid) { header("location:/../contact.php?captresult=fail"); die(); } I don't think the information in the fields is being retained through that window switch (though it is successfully GET'ing the "captresult" variable) . At least, that's what I think is going wrong... Anyone have any idea? Seems like I'm soo close hehe. Thanks for any help you can give me! contact.php <!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=utf-8" /> <title>Contact Enderpanda</title> <link href="config/main.css" rel="stylesheet" type="text/css" /> <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> </head> <? if (isset($_GET['captresult'])) { $result = $_GET['captresult']; } if ($result == "fail" ) { $fail_message = 'reCAPTCHA code incorrect, please try again.'; } if ($result == "pass" ) { $sucess_message = "Message sent."; } ?> <body> <div id="contact_form_wrap"> <? if ($result == "pass" ) { echo '<h1><span class="green">'.$sucess_message.'</span></h1><br />'; } if ($result != "pass" ) { ?> <form action="config/contact_mailer.php" method="post"> <input type="hidden" name="redirect" value="contact.php?captresult=pass" /> Name (optional)<br /><input name="name" type="text" size="50" maxlength="75" value="<? if (isset($_POST['name'])) echo $_POST['name']; ?>" /><br /><br /> Email (optional)<br /><input name="email" type="text" size="50" maxlength="200" value="<? if (isset($_POST['email'])) echo $_POST['email']; ?>" /><br /><br /> Subject (optional)<br /><input name="subject" type="text" size="50" maxlength="200" value="<? if (isset($_POST['subject'])) echo $_POST['subject']; ?>" /><br /><br /> Message <br /> <span id="sprytextarea1"> <label> <textarea name="message" id="message" cols="45" rows="5"><? if (isset($_POST['message'])) echo $_POST['message']; ?></textarea> </label> <span class="textareaRequiredMsg">Message is required.</span></span><br /><br /> <? if ($result == "fail" ) { echo '<span class="red">'.$fail_message.'</span><br /><br />If your message got erased, try <a href = "javascript:history.back()">clicking here</a> to go back (also reload the reCAPTCHA).<br /><br />'; } require_once('config/recaptchalib.php'); $publickey = "OMITTED"; echo recaptcha_get_html($publickey); ?><br /> <input name="submit" type="submit" value="Submit" /> <input name="submitted" type="hidden" value="TRUE" /> </form> <? } ?> <p><a href="#" onclick="parent.Shadowbox.close();return false;"> Close Window </a></p> </div> <script type="text/javascript"> <!-- var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1"); //--> </script> </body> </html> contact_mailer.php <?php /* reCAPTCHA script from http://inko9nito.wordpress.com/2007/12/12/installing-recaptcha-with-php/ */ require_once('recaptchalib.php'); $privatekey = "OMITTED"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { header("location:/../contact.php?captresult=fail"); die(); } /* Removed for now, successful result handled by the redirect input in contact form else if ($resp->is_valid) { header("location:contact_sent.php"); } */ /* Default GoDaddy form script (from gdform.php on my server) */ $request_method = $_SERVER["REQUEST_METHOD"]; if($request_method == "GET"){ $query_vars = $_GET; } elseif ($request_method == "POST"){ $query_vars = $_POST; } reset($query_vars); $t = date("U"); $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t; $fp = fopen($file,"w"); while (list ($key, $val) = each ($query_vars)) { fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n"); fputs($fp,"$val\n"); fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n"); if ($key == "redirect") { $landing_page = $val;} } fclose($fp); if ($landing_page != ""){ header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page"); } else { header("Location: http://".$_SERVER["HTTP_HOST"]."/"); } ?>
  4. Hi everyone, I'm fairly new to working with forms, and having a bit of a difficult time getting this all tied together. I'm trying to use a simple contact form with reCAPTCHA, using Spry (Javascript) to validate the text area (everything else is optional): - If they enter something in the text area and solve the reCAPTCHA, it takes them to comment_sent.php - If they enter something in the text area, it takes them to comment_error.php - If they don't enter anything into the text area, it turns red and they can't sumbit Therefore the only real validation that takes you to another page and would need to retain data would be the reCAPTCHA part... Simple enough right? It all works pretty well... Except for the damn sticky forms part... Not sure what I am doing wrong. I've tried a few different things and at this point I'm just frustrated. Feel like I'm close but missing something simple. My contact form can be seen directly at http://enderpanda.com/contact.php (tho on my site I use it as a 540px-wide shadowbox popup). Couple notes: 1) the action of the form points to contact_mailer.php, which is basically some reCAPTCHA code I borrowed and the default godaddy script (I know, I should get a new one.. it works for now and I want to understand what is going on with this first) 2) currently the way I have it "jumps a page" (goes to contact_error.php) but I'd like to rewrite it to just reload contact and apply variables... but I want to try and get it work this way first if possible 3) some examples I have seen use $_SERVER['PHP_SELF'] instead of pointing to processing file... is that part of the problem? 4) I admit I don't complete understand what is going on the default godaddy script... maybe that's why the $_POST stuff isn't coming thru? 5) I tried adding isset, such as the example here, but that didn't seem to work... the code creating the captfail variable in contact_error seems to be working fine. Again, the problem I'm having right now is that the forms aren't sticky, the data is gone if you answer the captcha wrong and you have blank fields (which is very, very good way to make people never come back to your site again). Sorry if this a completely noob question (I'm sure it is), THANK YOU very much for any help you can give, I really appreciate it. contact.php (key omitted) <!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=utf-8" /> <title>Contant Enderpanda</title> <link href="config/main.css" rel="stylesheet" type="text/css" /> <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="contact_form_wrap"> <form action="contact_mailer.php" method="post"> <input type="hidden" name="subject" value="Comment From Enderpanda.com" /> <input type="hidden" name="redirect" value="contact_sent.php" /> <label for="name">Name (optional)<br /></label> <input name="name" type="text" id="name" size="50" maxlength="200" /><br /><br /> <label for="email">Email (optional)<br /></label> <input name="email" type="text" id="email" size="50" maxlength="200" /><br /><br /> <label for="message_sub">Subject (optional)<br /></label> <input name="message_sub" type="text" id="message_sub" size="50" maxlength="200" /><br><br> <label for="message">Message<br/></label> <span id="sprytextarea1"> <textarea name="message" cols="50" rows="6" id="message"></textarea> <span class="textareaRequiredMsg">You must include a message.</span></span><br /><br /> <? require_once('recaptchalib.php'); $publickey = "OMITTED"; echo recaptcha_get_html($publickey); ?><br> <input type="submit" name="submit" value="Send Message" /> </form> <p><a href="#" onclick="parent.Shadowbox.close();return false;"> Close Window </a></p> </div> <script type="text/javascript"> <!-- var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1"); //--> </script> </body> </html> contact_mailer.php (key omitted) <?php /* reCAPTCHA script from http://inko9nito.wordpress.com/2007/12/12/installing-recaptcha-with-php/ */ require_once('recaptchalib.php'); $privatekey = "OMITTED"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { header("location:contact_error.php?capresult=fail"); die(); } else if ($resp->is_valid) { header("location:contact_sent.php?capresult=pass"); } /* default GoDaddy script (from gdform.php on my server) */ $request_method = $_SERVER["REQUEST_METHOD"]; if($request_method == "GET"){ $query_vars = $_GET; } elseif ($request_method == "POST"){ $query_vars = $_POST; } reset($query_vars); $t = date("U"); $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t; $fp = fopen($file,"w"); while (list ($key, $val) = each ($query_vars)) { fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n"); fputs($fp,"$val\n"); fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n"); if ($key == "redirect") { $landing_page = $val;} } fclose($fp); if ($landing_page != ""){ header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page"); } else { header("Location: http://".$_SERVER["HTTP_HOST"]."/"); } ?> contact_sent.php <!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=utf-8" /> <link href="config/main.css" rel="stylesheet" type="text/css" /> <title>Message Sent</title> </head> <body> <div id="contact_form_wrap"> <br /> <h1>Thank you, your message has been sent.</h1><br /><br /> <h2><a href="#" onclick="parent.Shadowbox.close();return false;"> Close Window </a></h2> </div> </body> </html> contact_error.php (key omitted) <!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=utf-8" /> <title>Message Error</title> <link href="config/main.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="contact_form_wrap"> <form action="contact_mailer.php" method="post"> <input type="hidden" name="subject" value="Comment From Enderpanda.com" /> <input type="hidden" name="redirect" value="contact_sent.php" /> <label for="name">Name (optional)<br /></label> <input name="name" type="text" id="name" size="50" maxlength="200" value="<?=$_POST['name']; ?>" /><br /><br /> <label for="email">Email (optional)<br /></label> <input name="email" type="text" id="email" size="50" maxlength="200" value="<?=$_POST['email'] ?>" /><br /><br /> <label for="message_sub">Subject (optional)<br /></label> <input name="message_sub" type="text" id="message_sub" size="50" maxlength="200" value="<?=$_POST['message_sub'] ?>" /><br><br> <label for="message">Message<br/></label> <span id="sprytextarea1"> <textarea name="message" cols="50" rows="6" id="message"><?=$_POST['message'] ?></textarea> <span class="textareaRequiredMsg">You must include a message.</span></span><br /><br /> <? if (isset($_GET['capresult'])) { $capresult = $_GET['capresult']; } if ($capresult == "fail" ) { $captfail = "reCAPTCHA code incorrect, please try again.<br><br>"; } ?> <span class="red"><? echo $captfail; ?></span> <? require_once('recaptchalib.php'); $publickey = "OMITTED"; echo recaptcha_get_html($publickey); ?><br> <input type="submit" name="submit" value="Send Message"/> </form> <p><a href="#" onclick="parent.Shadowbox.close();return false;"> Close Window </a></p> </div> </body> </html>
  5. Ah cool, thx! That actually really helps, much appreciated.
  6. Woot! Thx! Problem(s) solved! Btw, the echo issue also tells me why the first variable in var.php was printing. When I'm a big famous web developer I'll tell everyone I owe it all to PHPFreaks
  7. That fixed it! Thank you soooo much everyone, you rock and/or roll! I'm still learning and I hate getting caught up stuff like that. I absolutely will in the future, thank you very much for the advice! If you guys could help with one last thing while I have u guys here, is there a way to combine these statements? Every time I try things go all broke-like.. if ($type == arindex) { include ("output.php"); } if ($type == downloads) { include ("output.php"); } if ($type == galindex) { include ("output.php"); } if ($type == subgal) { include ("output.php"); }
  8. Here's the included files, with sensitive info removed ep_config.php <?php $dbhost = "***removed***"; $dbuname = "***removed***"; $dbpass = "***removed***"; $dbname = "***removed***"; ?> ep_connect.php <?php $dbconn = mysql_connect($dbhost, $dbuname, $dbpass) or die ("Unable to connect"); mysql_select_db ($dbname, $dbconn) or die ("Unable to select database"); ?> var.php <?= $blank = ""; $p1 = "home.php"; $p1t = "Home"; $p2 = "archive.php"; $p2t = "Archive"; $p3 = "gallery.php"; $p3t = "Gallery"; $p4 = "music.php"; $p4t = "Music"; $p5 = "downloads.php"; $p5t = "Downloads"; $p6 = "info.php"; $p6t = "Info"; $imgdir = "../data/images/"; $wowdir = "../data/wowimages/"; $downdir = "../data/downloads/"; $icondir = "../data/icons/"; $galdir = "../data/gallery/"; $endermail = "***removed***"; $delicious - "***removed***"; $postcount = "9"; ?> By the way, I added the 'blank' variable because it kept printing out the first one from var.php, why it was doing that is another mystery, not a perfect fix but works for now.
  9. Dare to dream I still have to go thru and do some finalization, right now things are just sort of a mock-up to get problems solved. Thank you for the heads-up tho, I corrected that (and welcome any other suggestions!). Here's the view source, I removed some database output and info to help clarify (replaced with ***content***), I added a red arrow and highlighted where the '1' is popping up: home.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Enderpanda.com -- Home</title> </head> <body> <?php include ("config/ep_config.php"); include ("config/ep_connect.php"); include ("config/var.php"); /* */ $type = "home"; $table1 = "archive"; $search = "page_name"; $title = "archive_title"; $content1 = "archive_content"; $usedate = "yes"; $signature = "yes"; $linkhead = "yes"; /* */ $homeresult = mysql_query("SELECT * FROM $table1 ORDER BY $search DESC", $dbconn) or die ("Unable to run query (home1.php)"); $homerow = mysql_fetch_assoc($homeresult); $current = $homerow["page_name"]; /* */ $pageresult = mysql_query("SELECT * FROM $table1 WHERE $search='$current'", $dbconn) or die ("Unable to run query (home2.php)"); $pagerow = mysql_fetch_assoc($pageresult); /* */ $date = $pagerow[$search]; $titleoutput = $pagerow[$title]; $contentoutput = $pagerow[$content1]; /* */ include ("config/layout.php") ?> </body> </html> layout.php (removed the extra tags) <link rel="stylesheet" type="text/css" href="config/ep_css.css"> <script type="text/javascript" src="config/js/ep_js.js"></script> <script type="text/javascript" src="config/js/shadowbox/adapter/shadowbox-base.js"></script> <script type="text/javascript" src="config/js/shadowbox/shadowbox.js"></script> <script type="text/javascript"> Shadowbox.loadSkin('classic', 'config/js/shadowbox/skin'); Shadowbox.loadLanguage('en', 'config/js/shadowbox/lang'); Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'qt', 'swf', 'wmp'], 'config/js/shadowbox/player'); window.onload = function(){ Shadowbox.init(); }; </script> <div id="nav"> <ul> <li><a href="<?=$p1?>" onfocus="this.blur()"><?=$p1t?></a></li> <li><a href="<?=$p2?>" onfocus="this.blur()"><?=$p2t?></a></li> <li><a href="<?=$p3?>" onfocus="this.blur()"><?=$p3t?></a></li> <li><a href="<?=$p4?>" onfocus="this.blur()"><?=$p4t?></a></li> <li><a href="<?=$p5?>" onfocus="this.blur()"><?=$p5t?></a></li> <li><a href="<?=$p6?>" onfocus="this.blur()"><?=$p6t?></a></li> </ul> </div> <div id="spacer"></div> <div id="leftwrap"> <div id="leftheader"><span class="title"><a href="***content***" target="_blank">Links</a></span></div> <div id="leftbar"> <table width="138" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="8" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="leftbarhole"></div></td> <td width="8" bgcolor="#181818"> </td> </tr> </table> </div> <div id="leftbody"></div> <div id="leftheader"><span class="title">Friends</span></div> <div id="leftbar"> <table width="138" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="8" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="leftbarhole"></div></td> <td width="8" bgcolor="#181818"> </td> </tr> </table> </div> <div id="leftbody"> <ul> <li><a href="#">Fwiend 1</a></li> <li><a href="#">Fwiend 2</a></li> <li><a href="#">Fwiend 3</a></li> <li><a href="#">Fwiend 4</a></li> <li><a href="#">Fwiend 5</a></li> <li><a href="#">Fwiend 6</a></li> </ul> </div></div> <div id="contentwrap"><div id="currenttitle"><? if ($linkhead=="yes") { ?><span class="title"><a href ="archive.php?link=<?=$date?>"><?=$titleoutput?></a></span><?=; } else { ?><span class="title"><?=$titleoutput?></span><?=; } if ($usedate == yes) { $dateoutput = $date; $cvyr = substr($dateoutput, 2, 2); $cvmo = substr($dateoutput, 4, 2); $cvdy = substr($dateoutput, 6, 2); $cvdate = "$cvmo/$cvdy/$cvyr"; echo "$cvdate";}?></div> <div id="currentbar"></div> <div id="currentcontent"><? /* */ echo $contentoutput."<br>"; if ($type == arindex) { include ("output.php"); } if ($type == downloads) { include ("output.php"); } if ($type == galindex) { include ("output.php"); } if ($type == subgal) { include ("output.php"); } ?></div><div id="postend"></div></div> <div id="rightwrap"> <div id="rightheader"><span class="title">Recent Posts</span></div> <div id="rightbar"> <table width="196" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="rightbarhole"></div></td> <td width="16" bgcolor="#181818"> </td> </tr> </table> </div> <div id="rightbody"><ul><?= $rp_result = mysql_query("SELECT * FROM archive ORDER BY page_name DESC", $dbconn) or die ("Unable to run query (Recent Posts.php)"); $counter = "0"; while ($rp_row = mysql_fetch_assoc($rp_result)) { $rp_data1 = $rp_row["archive_title"]; $rp_data2 = $rp_row["page_name"]; $rp_cvyr = substr($rp_data2, 2, 2); $rp_cvmo = substr($rp_data2, 4, 2); $rp_cvdy = substr($rp_data2, 6, 2); $rp_date = "$rp_cvmo/$rp_cvdy"; if ($counter < $postcount) { echo '<li>' . $rp_date . ' - <a href="archive.php?link=' . $rp_data2 . '">' . $rp_data1 . '</a></li>'; } $counter++; } ?></ul> </div></div></div> <div id="spacer"></div> <div id="rightwrap"> <div id="rightheader"><span class="title">Contact</span></div> <div id="rightbar"> <table width="196" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="rightbarhole"></div></td> <td width="16" bgcolor="#181818"> </td> </tr> </table> </div> <div id="rightbody"> <div id="twitter_div"> <h2 style="display: none;" >Twitter Updates</h2> <ul id="twitter_update_list"></ul> </div></div></div></div> <div id="footerwrap"><div id="footer"><a href="<?=$p1?>"><?=$p1t?></a> - <a href="<?=$p2?>"><?=$p2t?></a> - <a href="<?=$p3?>"><?=$p3t?></a> - <a href="<?=$p4?>"><?=$p4t?></a> - <a href="<?=$p5?>"><?=$p5t?></a> - <a href="<?=$p6?>"><?=$p6t?></a></div></div> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/***content***.json?callback=twitterCallback2&count=5"></script>
  10. Oh and yes I know I'm using a couple tables as spacers like a noob, I'm gonna get rid of those soon.
  11. (You guys are awesome btw) Hrrmmm, no that wasn't everything, I was just trying to put it where I personally thought the problem was. I think you are right, I'm pretty sure it has to do something with include, though I'm pretty sure I escaped all the echo statements properly. Here's the entire home.php and layout.php code. The piece I had posted earlier is towards the bottom of 'layout.php'. God I feel naked now... home.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Home</title> </head> <body> <?php include ("config/ep_config.php"); include ("config/ep_connect.php"); include ("config/var.php"); /* */ $type = "home"; $table1 = "archive"; $search = "page_name"; $title = "archive_title"; $content1 = "archive_content"; $usedate = "yes"; $signature = "yes"; $linkhead = "yes"; /* */ $homeresult = mysql_query("SELECT * FROM $table1 ORDER BY $search DESC", $dbconn) or die ("Unable to run query (home1.php)"); $homerow = mysql_fetch_assoc($homeresult); $current = $homerow["page_name"]; /* */ $pageresult = mysql_query("SELECT * FROM $table1 WHERE $search='$current'", $dbconn) or die ("Unable to run query (home2.php)"); $pagerow = mysql_fetch_assoc($pageresult); /* */ $date = $pagerow[$search]; $titleoutput = $pagerow[$title]; $contentoutput = $pagerow[$content1]; /* */ include ("config/layout.php") ?> </body> </html> layout.php <title>EP Layout</title> <link rel="stylesheet" type="text/css" href="config/ep_css.css"> <script type="text/javascript" src="config/js/ep_js.js"></script> <script type="text/javascript" src="config/js/shadowbox/adapter/shadowbox-base.js"></script> <script type="text/javascript" src="config/js/shadowbox/shadowbox.js"></script> <script type="text/javascript"> Shadowbox.loadSkin('classic', 'config/js/shadowbox/skin'); Shadowbox.loadLanguage('en', 'config/js/shadowbox/lang'); Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'qt', 'swf', 'wmp'], 'config/js/shadowbox/player'); window.onload = function(){ Shadowbox.init(); }; </script> </head> <body> <div id="nav"> <ul> <li><a href="<?=$p1?>" onfocus="this.blur()"><?=$p1t?></a></li> <li><a href="<?=$p2?>" onfocus="this.blur()"><?=$p2t?></a></li> <li><a href="<?=$p3?>" onfocus="this.blur()"><?=$p3t?></a></li> <li><a href="<?=$p4?>" onfocus="this.blur()"><?=$p4t?></a></li> <li><a href="<?=$p5?>" onfocus="this.blur()"><?=$p5t?></a></li> <li><a href="<?=$p6?>" onfocus="this.blur()"><?=$p6t?></a></li> </ul> </div> <div id="spacer"></div> <div id="leftwrap"> <div id="leftheader"><span class="title"><a href="http://delicious.com/enderpanda" target="_blank">Links</a></span></div> <div id="leftbar"> <table width="138" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="8" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="leftbarhole"></div></td> <td width="8" bgcolor="#181818"> </td> </tr> </table> </div> <div id="leftbody"></div> <div id="leftheader"><span class="title">Friends</span></div> <div id="leftbar"> <table width="138" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="8" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="leftbarhole"></div></td> <td width="8" bgcolor="#181818"> </td> </tr> </table> </div> <div id="leftbody"> <ul> <li><a href="#">Fwiend 1</a></li> <li><a href="#">Fwiend 2</a></li> <li><a href="#">Fwiend 3</a></li> <li><a href="#">Fwiend 4</a></li> <li><a href="#">Fwiend 5</a></li> <li><a href="#">Fwiend 6</a></li> </ul> </div></div> <div id="contentwrap"><div id="currenttitle"><? if ($linkhead=="yes") { ?><span class="title"><a href ="archive.php?link=<?=$date?>"><?=$titleoutput?></a></span><?=; } else { ?><span class="title"><?=$titleoutput?></span><?=; } if ($usedate == yes) { $dateoutput = $date; $cvyr = substr($dateoutput, 2, 2); $cvmo = substr($dateoutput, 4, 2); $cvdy = substr($dateoutput, 6, 2); $cvdate = "$cvmo/$cvdy/$cvyr"; echo "$cvdate";}?></div> <div id="currentbar"></div> <div id="currentcontent"><? /* */ echo $contentoutput."<br>"; if ($type == arindex) { include ("output.php"); } if ($type == downloads) { include ("output.php"); } if ($type == galindex) { include ("output.php"); } if ($type == subgal) { include ("output.php"); } ?></div><div id="postend"></div></div> <div id="rightwrap"> <div id="rightheader"><span class="title">Recent Posts</span></div> <div id="rightbar"> <table width="196" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="rightbarhole"></div></td> <td width="16" bgcolor="#181818"> </td> </tr> </table> </div> <div id="rightbody"><ul><?= $rp_result = mysql_query("SELECT * FROM archive ORDER BY page_name DESC", $dbconn) or die ("Unable to run query (Recent Posts.php)"); $counter = "0"; while ($rp_row = mysql_fetch_assoc($rp_result)) { $rp_data1 = $rp_row["archive_title"]; $rp_data2 = $rp_row["page_name"]; $rp_cvyr = substr($rp_data2, 2, 2); $rp_cvmo = substr($rp_data2, 4, 2); $rp_cvdy = substr($rp_data2, 6, 2); $rp_date = "$rp_cvmo/$rp_cvdy"; if ($counter < $postcount) { echo '<li>' . $rp_date . ' - <a href="archive.php?link=' . $rp_data2 . '">' . $rp_data1 . '</a></li>'; } $counter++; } ?></ul> </div></div></div> <div id="spacer"></div> <div id="rightwrap"> <div id="rightheader"><span class="title">Contact</span></div> <div id="rightbar"> <table width="196" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16" bgcolor="#181818"> </td> <td align="center" valign="top"><div id="rightbarhole"></div></td> <td width="16" bgcolor="#181818"> </td> </tr> </table> </div> <div id="rightbody"> <div id="twitter_div"> <h2 style="display: none;" >Twitter Updates</h2> <ul id="twitter_update_list"></ul> </div></div></div></div> <div id="footerwrap"><div id="footer"><a href="<?=$p1?>"><?=$p1t?></a> - <a href="<?=$p2?>"><?=$p2t?></a> - <a href="<?=$p3?>"><?=$p3t?></a> - <a href="<?=$p4?>"><?=$p4t?></a> - <a href="<?=$p5?>"><?=$p5t?></a> - <a href="<?=$p6?>"><?=$p6t?></a></div></div> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/Enderpanda.json?callback=twitterCallback2&count=5"></script>
  12. thanks for the quick reply Unfortunately it's still there, in fact I had tried switching between using echo vs. escaping php earlier. What ticks me off is it seemingly just appeared while editing code, so I wonder if it could possibly be something else, however removing that code removes the "1" as well, so I think it's gotta be in there somewhere... Hoping there's a known bug with php or something that would explain it, because I sure can't. EDIT: By the way, the '1' is not in the database itself, I changing the search parameters, same thing everytime. If I remove the line tag, it prints the '1' with the data, if I leave the line in it prints it on the line above, so it's happening before the line tag comes in.
  13. For some reason, this code is printing a "1" before the first line, and I cannot for the life of me figure out why. Here's my code: $postcount = "9"; $rp_result = mysql_query("SELECT * FROM archive ORDER BY page_name DESC", $dbconn) or die ("Unable to run query (Recent Posts)"); $counter = "0"; while ($rp_row = mysql_fetch_assoc($rp_result)) { $rp_data1 = $rp_row["archive_title"]; $rp_data2 = $rp_row["page_name"]; $rp_cvyr = substr($rp_data2, 2, 2); $rp_cvmo = substr($rp_data2, 4, 2); $rp_cvdy = substr($rp_data2, 6, 2); $rp_date = "$rp_cvmo/$rp_cvdy"; if ($counter < $postcount) {?> <li><?=$rp_date?> - <a href="archive.php?link=<?=$rp_data2?>"><?=$rp_data1?></a></li><?=; $counter++; } } Thanks, any help would be appreciated.
×
×
  • 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.