Dada78 Posted August 24, 2008 Share Posted August 24, 2008 Hello all, I am having a minor problem with this comments script I have. When I first wrote this up it was back in Feb and I haven't worked on it until now because I need to finish it for obvious reasons when you see it. Anyways, I can not remember what was wrong with it when I took a break from it. To my knowledge it was working fine. I have been validating all the code on the pages so I can launch this section to the rest of the site. When I validated it now it stopped working. When you type something in the text area and hit submit it doesn't submit the info. It just refreshes the a page and sends you back down to the form. The comment box is at the bottom of this page. http://www.mesquitechristmas.com/loc...play.php?id=61 What is really strange is this page has comments but when you first visit it they don't show unless you hit submit then they show. They use to show regardless. So it is connecting to the DB just not sure why it is not submitting.... So if they are not showing when you visit this page that is why, just hit the submit button. http://www.mesquitechristmas.com/local/display.php?id=2 Here is the php for the comment field // Start code for inserting comments if(isset($_POST['timeout'])) { if(time() < $_POST['timeout']) unset($_POST); $firstname = $_POST['firstname']; $location = $_POST['location']; $comment_date = date("m-d-Y"); $comment = $_POST['comment']; $id = $_POST['id']; // setup our query $query ="INSERT INTO comments (firstname, location, comment_date, comment, id) VALUES ('$firstname', '$location', '$comment_date', '$comment', '$id')"; $result=mysql_query($query) or die(mysql_error()); // run our query // end code for inserting comments } // start code for displaying comments function show_data(){ $id = array(); $firstname = array(); $location = array(); $comment_date = array(); $comment = array(); $id = mysql_real_escape_string($_GET['id']); $i=0; if(isset($id)) { $limit = 5; { $sql = "SELECT * FROM comments WHERE id = '$id' ORDER BY comment_date DESC"; $site['url'] = "http://www.mesquitechristmas.com/local/display.php?id=$id"; $PageNav = swPagination( $sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think I need the stuff above IF ( !$PageNav['TotalRes'] ) echo("<table class='fullbox' align='center' width='100%' cellpadding='1' cellspacing='1'><tr bgcolor='".$color."'> <td align='left'>No Comments left for this Display. Be the first to leave one.</td></tr></table>"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#F4F4F4':'#E4E4E4'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<table class='fullbox' align='center' width='100%' cellpadding='1' cellspacing='1'><tr bgcolor='".$color."'> <td align='left' width='120'><strong> Name</strong>: $firstname[$i]</td> <td align='left' width='120'><strong> Location</strong>: $location[$i]</td> <td align='left' width='216'><strong> Date</strong>: $comment_date[$i]</td> </tr> <tr bgcolor='".$color."'> <td colspan='4'><strong> Comment</strong>: $comment[$i]</td> </tr></table>"; ++$i; } } } print"<table width='100%'> <tr> <td> <div align='right'>$PageNav[HrefNav]</div></td> </tr> </table>"; } // end code for displaying comments Here is the HTML for the form and where it is displayed. <div class="title">Comments For <? echo $row['displayname']; ?>...</div> <div class="fullbox"> <?php show_data(); ?> </div> <a name="comments" id="comments"> <form method="post" action="display.php?id=<?php echo $row['id']."#comments"; ?>"> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <div class="boxWrapper"> <div class="commentsInner"> <div class="commentsInput"><table border="0" cellpadding="4" cellspacing="0" width="100%"> <tr> <td width="203">Name: <input type="text" name="firstname" value="Anonymous" onclick="this.value=''" /></td> <td width="287">Location: <input type="text" name="location" value="Anonymous" onclick="this.value=''" /></td> </tr> <tr> <td colspan="2"><br /> Comment (Max 255 characters):<br /> <textarea name="comment" rows="5" cols="50" class="c5" onkeydown="javascript:limittext(this.form.comment);"> </textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="reset" value="Reset" /> <input type="submit" value="Submit" /></td> </tr> </table </div> </div> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> </tr> </table> </form> </a> Any suggestion or ideas would be great as I am stumped. I think it has something to do with how the form is submitting but not sure as to what.... I am not all that educated when it comes to forms as I don't use them often. -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/ Share on other sites More sharing options...
redarrow Posted August 24, 2008 Share Posted August 24, 2008 name="timeout" <<<<<<<<<,, where that on the submit button Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-624486 Share on other sites More sharing options...
Dada78 Posted August 24, 2008 Author Share Posted August 24, 2008 Just so I follow you are you suggesting doing this? <input type="submit" value="Submit" name="timeout" /> -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-624509 Share on other sites More sharing options...
DeanWhitehouse Posted August 24, 2008 Share Posted August 24, 2008 yes, try it Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-624510 Share on other sites More sharing options...
Dada78 Posted August 24, 2008 Author Share Posted August 24, 2008 Well the comments are inserting and showing now but I have two or three problems. I am not sure what adding timeout to the submit button was suppose to do though. 1.) I am not sure if this happens with everyone but it happens with me on FF3 and IE7. If the page has comments and you first visit the page. The previous comments that are already there do not show unless you hit submit. So no one can view the comments unless the hit submit. 2.) For some reason it is also inserting a blank comment when you insert a comment or refresh the page. So basically it inserts two comments. The one from the visitor and then an empty one. 3.) If a visitor refreshes the page it will flood the comments and allow them to insert the same comment over and over again by refreshing. If I can get these sorted out it will run perfectly. Can anyone help me with this? -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-624521 Share on other sites More sharing options...
Dada78 Posted August 25, 2008 Author Share Posted August 25, 2008 Please anyone? I really need some help with this bad. I am running out of time. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-624880 Share on other sites More sharing options...
JasonLewis Posted August 25, 2008 Share Posted August 25, 2008 Firstly, it works after adding the name because in your PHP code you are checking to see if $_POST['timeout'] has a value before proceeding with any insertion or error checking. So by adding the name="timeout" to the submit button it'll be getting a value when you press it. Which means you can process the form. 1) Sound's to me like an error in your script. 2) Put in re-direction to the same page so that the form cannot be reloaded by the user after they have already submitted it. 3) See number 2. Hope it helps. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-624887 Share on other sites More sharing options...
Dada78 Posted August 25, 2008 Author Share Posted August 25, 2008 1) Sound's to me like an error in your script. Yes, but what? That is what I am trying to resolve. Some people say it happens, some don't. I don't know why this is happening. 2) Put in re-direction to the same page so that the form cannot be reloaded by the user after they have already submitted it. All the code is on the same page it it does redirect back to it after the form as been submitted. At least I think it does? All the code is on the same page so it doesn't redirect anywhere. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625017 Share on other sites More sharing options...
DarkWater Posted August 25, 2008 Share Posted August 25, 2008 Also, you're doing the dates wrong. For MySQL, you want to use the column type DATE and just use the MySQL NOW() function so the date is easily manipulated by MySQL. >_< Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625025 Share on other sites More sharing options...
Dada78 Posted August 25, 2008 Author Share Posted August 25, 2008 Also, you're doing the dates wrong. For MySQL, you want to use the column type DATE and just use the MySQL NOW() function so the date is easily manipulated by MySQL. >_< It does, but that wouldn't have any bearing over the problems I am having. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625054 Share on other sites More sharing options...
DarkWater Posted August 25, 2008 Share Posted August 25, 2008 Also, you're doing the dates wrong. For MySQL, you want to use the column type DATE and just use the MySQL NOW() function so the date is easily manipulated by MySQL. >_< It does, but that wouldn't have any bearing over the problems I am having. Show me the full code that you have right now. I have an idea on problem 1. >_< Problems 2 and 3 can be stopped by adding a refresh or redirect to stop the browser from storing the POST data. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625057 Share on other sites More sharing options...
Dada78 Posted August 25, 2008 Author Share Posted August 25, 2008 The full code is above in my first post. They are both on the same page. The php is at the top and of course the form is placed in the HTML where it needs to be towards the bottom. That is all the code that is for the comments script. I can pull the full code for the page, but it will probably be irrelevant since it has a lot of unneeded code posted. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625079 Share on other sites More sharing options...
DarkWater Posted August 25, 2008 Share Posted August 25, 2008 Yeah, but you added something after one of the suggestions in this topic, right? if (isset($_POST['something'])) { }, right? (I forgot the exact code and I don't feel like finding it. =P) Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625169 Share on other sites More sharing options...
Dada78 Posted August 25, 2008 Author Share Posted August 25, 2008 No I haven't added anything, but I will repost the code for the comments just so we are on the same page. PHP... // Start code for inserting comments if(isset($_POST['timeout'])) { if(time() < $_POST['timeout']) unset($_POST); $firstname = $_POST['firstname']; $location = $_POST['location']; $comment_date = date("m-d-Y"); $comment = $_POST['comment']; $id = $_POST['id']; // setup our query $query ="INSERT INTO comments (firstname, location, comment_date, comment, id) VALUES ('$firstname', '$location', '$comment_date', '$comment', '$id')"; $result=mysql_query($query) or die(mysql_error()); // run our query // end code for inserting comments } // start code for displaying comments function show_data(){ $id = array(); $firstname = array(); $location = array(); $comment_date = array(); $comment = array(); $id = mysql_real_escape_string($_GET['id']); $i=0; if(isset($id)) { $limit = 5; { $sql = "SELECT * FROM comments WHERE id = '$id' ORDER BY comment_date DESC"; $site['url'] = "http://www.mesquitechristmas.com/local/display.php?id=$id"; $PageNav = swPagination( $sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think I need the stuff above IF ( !$PageNav['TotalRes'] ) echo("<div class='commentsInner'>No Comments left for this Display. Be the first to leave one.</div>"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#F4F4F4':'#E4E4E4'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<div class='commentsOutter'> <div class='commentsInner'> <div class='comments'>$comment[$i] <div class='commentsDetails'>Left By: $firstname[$i] | From: $location[$i] | Date: $comment_date[$i] </div> </div> </div> </div>"; ++$i; } } } print"<table width='100%'> <tr> <td> <div align='right'>$PageNav[HrefNav]</div></td> </tr> </table>"; } // end code for displaying comments HTML <div class="title">Comments For <? echo $row['displayname']; ?>...</div> <div class="fullbox"> <?php show_data(); ?> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> </tr> </table> <a name="comments" id="comments"></a> <form method="post" action="display.php?id=<?php echo $row['id']."#comments"; ?>"> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <div class="boxWrapper"> <div class="commentsInner commentsInput"> <table border="0" cellpadding="4" cellspacing="0" width="100%"> <tr> <td width="203">Name: <input type="text" name="firstname" value="Anonymous" onclick="this.value=''" /></td> <td width="287">Location: <input type="text" name="location" value="Anonymous" onclick="this.value=''" /></td> </tr> <tr> <td colspan="2"><br /> Comment (Max 255 characters):<br /> <textarea name="comment" rows="5" cols="50" class="c5" onkeydown="javascript:limittext(this.form.comment);"> </textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="reset" value="Reset" /> <input type="submit" value="Submit" name="timeout" /></td> </tr> </table> </form> </div> </div> -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625212 Share on other sites More sharing options...
Dada78 Posted August 26, 2008 Author Share Posted August 26, 2008 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625566 Share on other sites More sharing options...
JasonLewis Posted August 26, 2008 Share Posted August 26, 2008 If you have a look, after you have posted a comment it will insert the data then continue to display your form. This can be bad, because if the user refreshes the page they re-send the post data and it gets inserted again, hence the duplicate entry. To solve this use the header redirection. $result=mysql_query($query) or die(mysql_error()); // run our query After you have run your query you would do something like this: header("Location: {$_SERVER['REQUEST_URI']}"); That will basically send the browser window to the current page. So then the person can't refresh it and re-send the post data. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-625741 Share on other sites More sharing options...
Dada78 Posted August 26, 2008 Author Share Posted August 26, 2008 Ok this is what I have done as suggested, is this correct? It seems to have cured the one problem with the refresh but want to make sure. // setup our query $query ="INSERT INTO comments (firstname, location, comment_date, comment, id) VALUES ('$firstname', '$location', '$comment_date', '$comment', '$id')"; $result=mysql_query($query) or die(mysql_error()); // run our query header("Location: {$_SERVER['REQUEST_URI']}"); // end code for inserting comments } Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626010 Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 Add exit(); after the header(); call for good measure. Otherwise it looks good. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626027 Share on other sites More sharing options...
Dada78 Posted August 26, 2008 Author Share Posted August 26, 2008 For reference what is the purpose of exit();? That seems to resolve the refresh problem. Only problem I am still having is the comments do no show when you first visit the page. You have to hit submit in order to get the comments to show which then inserts an empty entry. Any idea why this could be happening? -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626171 Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 The purpose of exit(); is to kill the current script, because header(); doesn't, so it keeps executing, you just don't see the output. exit(); prevents any unwanted queries or data manipulation and stuff. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626181 Share on other sites More sharing options...
Dada78 Posted August 26, 2008 Author Share Posted August 26, 2008 Ok, so what would be causing the comments to not show unless you hit the submit button when you first visit the page? Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626193 Share on other sites More sharing options...
DeanWhitehouse Posted August 26, 2008 Share Posted August 26, 2008 Not looked at your code, but i am guessing that where you check for posting (should be something like , if(isset($_POST[''])) ) you have closed the { (bracket) after the code to show the comment. Not before, so it will only show when posted. Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626230 Share on other sites More sharing options...
Dada78 Posted August 26, 2008 Author Share Posted August 26, 2008 This is the code for displaying the comments. // start code for displaying comments function show_data(){ $id = array(); $firstname = array(); $location = array(); $comment_date = array(); $comment = array(); $id = mysql_real_escape_string($_GET['id']); $i=0; if(isset($id)) { $limit = 5; { $sql = "SELECT * FROM comments WHERE id = '$id' ORDER BY comment_date DESC"; $site['url'] = "http://www.mesquitechristmas.com/local/display.php?id=$id"; $PageNav = swPagination( $sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think I need the stuff above IF ( !$PageNav['TotalRes'] ) echo("<div class='commentsInner'>No Comments left for this Display. Be the first to leave one.</div>"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#F4F4F4':'#E4E4E4'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<div class='commentsOutter'> <div class='commentsInner'> <div class='comments'>$comment[$i] <div class='commentsDetails'>Left By: $firstname[$i] | From: $location[$i] | Date: $comment_date[$i] </div> </div> </div> </div>"; ++$i; } } } print"<table width='100%'> <tr> <td> <div align='right'>$PageNav[HrefNav]</div></td> </tr> </table>"; } // end code for displaying comments Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626241 Share on other sites More sharing options...
DeanWhitehouse Posted August 26, 2008 Share Posted August 26, 2008 show the code for the whole page , Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626249 Share on other sites More sharing options...
Dada78 Posted August 26, 2008 Author Share Posted August 26, 2008 Well it contains a bunch of unrelavant code to the comments but here it is... <?php // connect to database include ('db_connect.php'); include ('utiles.php'); // start code for showing display information if (isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $sql = "SELECT * FROM users WHERE id = $id;"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $id = $row["id"]; $displayname = $row["displayname"]; $owner = $row["owner"]; $displaytype = $row["displaytype"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $postal = $row["postal"]; $country = $row["country"]; $StartDateMonth = $row['StartDateMonth']; $StartDateDay = $row['StartDateDay']; $EndDateMonth = $row['EndDateMonth']; $EndDateDay = $row['EndDateDay']; $StartTimeHour = $row['StartTimeHour']; $StartTimeMin = $row['StartTimeMin']; $EndTimeHour = $row['EndTimeHour']; $EndTimeMin = $row['EndTimeMin']; $meridiem = $row['meridiem']; $animated = $row['animated']; $TotalLights = $row['TotalLights']; $description = $row['description']; $website = $row['website']; $rating = $row['rating']; $votes = $row['votes']; $imgurl = $row['imgurl']; $imgurl2 = $row['imgurl2']; } else { die("No user found"); } } else { die(mysql_error()); } } // end code for showing display information // Start code for inserting comments if(isset($_POST['timeout'])) { if(time() < $_POST['timeout']) unset($_POST); $firstname = $_POST['firstname']; $location = $_POST['location']; $comment_date = date("m-d-Y"); $comment = $_POST['comment']; $id = $_POST['id']; // setup our query $query ="INSERT INTO comments (firstname, location, comment_date, comment, id) VALUES ('$firstname', '$location', '$comment_date', '$comment', '$id')"; $result=mysql_query($query) or die(mysql_error()); // run our query header("Location: {$_SERVER['REQUEST_URI']}"); exit(); // end code for inserting comments } // start code for displaying comments function show_data(){ $id = array(); $firstname = array(); $location = array(); $comment_date = array(); $comment = array(); $id = mysql_real_escape_string($_GET['id']); $i=0; if(isset($id)) { $limit = 5; { $sql = "SELECT * FROM comments WHERE id = '$id' ORDER BY comment_date DESC"; $site['url'] = "http://www.mesquitechristmas.com/local/display.php?id=$id"; $PageNav = swPagination( $sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think I need the stuff above IF ( !$PageNav['TotalRes'] ) echo("<div class='commentsInner'>No Comments left for this Display. Be the first to leave one.</div>"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#F4F4F4':'#E4E4E4'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<div class='commentsOutter'> <div class='commentsInner'> <div class='comments'>$comment[$i] <div class='commentsDetails'>Left By: $firstname[$i] | From: $location[$i] | Date: $comment_date[$i] </div> </div> </div> </div>"; ++$i; } } } print"<table width='100%'> <tr> <td> <div align='right'>$PageNav[HrefNav]</div></td> </tr> </table>"; } // end code for displaying comments ?> <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="<? echo $row['city']; ?>,<? echo $row['state']; ?> <? echo $row['description']; ?>" /> <meta name="keywords" content="Mesquite, Texas, Country Christmas" /> <link rel="stylesheet" type="text/css" href="/stylesheet.css" media="screen" /> <script type="text/javascript" src="/drop_down.js"></script> <title>A Mesquite Country Christmas - <? echo $row['displayname']; ?></title> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAHsqGZjU15T9Ax9NeNmkr3BTBG4OpKDapRX640iwTNUvuS9ZsRhRAhx93j_0sEqAt5jDYsfdAlZ8gmw" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ var map = null; var geocoder = null; var xmasIcon = new GIcon(); function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("Gmap")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GScaleControl()); // Create our custom marker icon xmasIcon.image = "/images/markerdisplay.gif"; xmasIcon.iconSize = new GSize(13, 17); xmasIcon.iconAnchor = new GPoint (6, 20); xmasIcon.infoWindowAnchor = new GPoint (5, 1); geocoder = new GClientGeocoder(); } showAddress('<? echo $address; ?> <? echo $city; ?>,<? echo $state; ?> <? echo $postal; ?>'); } function showAddress(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { map.setCenter(new GLatLng(32.7668, -96.5992), 11); map.openInfoWindowHtml(new GLatLng(32.7668, -96.5992),"<br>"+address+" is not found"); } else { map.setCenter(point, 14); var marker = new GMarker(point, xmasIcon); map.addOverlay(marker); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("<strong><? echo $displayname; ?></strong><br>"+ address +"<br /><a href='http://maps.google.com/maps?saddr=" + address + "' target='_blank'>Get Directions</a>"); }); } } ); } } //]]> </script> <style type="text/css"> p.c6 {text-align: center} textarea.c5 {width: 540px;} table.c4 {border-top: 1px solid #990000;} </style> </head> <body onload="load();populate()" onunload="GUnload()"> <div id="wrap"> <a href="/index.html"> <img id="frontphoto" src="/images/mcc_header1.gif" alt="Mesquite Country Christmas" border="0" /></a> <div id="menu"> <h2 class="hide">Menu:</h2> <ul id="avmenu"> <li><a href="/index.html">Home</a></li> <li><a href="/christmasstory.html">The Christmas Story</a></li> <li><a href="/directions.html">Directions</a></li> <li><a href="#">Information</a><ul> <li><a href="/information.html">Display Facts & Info</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/playlist.html">2008 Playlist</a></li> <li><a href="#">Christmas History</a></li> </ul></li> <li><a href="#">Photos</a> <ul> <li><a href="/2007photos.html">2007</a></li> </ul></li> <li><a href="#">Videos</a> <ul> <li><a href="/2007videos.html">2007</a></li> </ul></li> <li><a href="/guestbook.php">Guestbook</a></li> <li><a href="/webcam.html">Web Cam</a></li> <li><a href="/webradio.html">Internet Radio</a></li> <li><a href="http://www.noradsanta.org/" target="_blank">Track Santa</a></li> <li><a href="/projects.html">Projects & How Tos</a></li> <li><a href="/links.html">Links</a></li> <li><a href="/contact_us.html">Contact Us</a></li> </ul> <div class="c1"><a href="http://www.toysfortots.org/" target="_blank"><img src="/images/toys_for_tots.jpg" alt="toys for tots" border="0" width="110" height="153" vspace="10" /></a></div> <div class="c1"><a href="http://christmas.bronners.com/2007/house/534.html"><img src="http://christmas.bronners.com/voteforme/vote.jpg" border="0" width="110" height="153" alt="christmas decorations" vspace="10" /></a></div> </div> <div class="fadebox" id="content"> <h2><? echo $row['displayname']; ?></h2> <hr /> <table class="imgBox" width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="center"> <table class="fullbox" align="center" width="100%" cellpadding="3" cellspacing="1"> <tr> <td align="center"><img src="/local/submitted/<? echo $row['imgurl1']; ?>" alt="<? echo $row['displayname']; ?>" class="border" width="520" height="320" id="big" /></td> </tr> <tr> <td align="center"><img src="/local/submitted/<? echo $row['imgurl1']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl2']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl3']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl4']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl5']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table> </td> </tr> </table> <div class="b1"><a href='browse.php'><img src="images/return.gif" alt="return to list" /></a></div> <table border="0" cellpadding="0" cellspacing="0" class="fullbox" width="100%"> <tr> <td class="title">About This Display...</td> </tr> </table> <table border='0' cellpadding='2' cellspacing='0' class='fullbox' width='100%'> <tr><td class="bg1" width="115"><b>Display Name</b>:</td><td class="bg1"> <? echo $row['displayname']; ?></td></tr> <tr><td class="bg2" width="120"><b>Owner/Operated By</b>:</td><td class="bg2"> <? echo $row['owner']; ?></td></tr> <tr><td class="bg1"><b>Display Type</b>:</td><td class="bg1"> <? echo $row['displaytype']; ?></td></tr> <tr><td class="bg2" valign="top"><b>Address</b>:</td><td class="bg2"> <? echo $row['address']; ?><br /> <? echo $row['city']. "," . $row['state']. " " . $row['postal']; ?><br /> <? echo $row['country']; ?></td></tr> <tr><td class="bg1"><b>Dates</b>:</td><td class="bg1"> <? echo $row['StartDateMonth']; ?> <? echo $row['StartDateDay']; ?> <strong>to</strong> <? echo $row['EndDateMonth']; ?> <? echo $row['EndDateDay']; ?></td></tr> <tr><td class="bg2"><b>Times</b>:</td><td class="bg2"> <? echo $row['StartTimeHour']; ?>:<? echo $row['StartTimeMin']; ?> <? echo $row['meridiem']; ?> <strong>to</strong> <? echo $row['EndTimeHour']; ?>:<? echo $row['EndTimeMin']; ?> <? echo $row['meridiem']; ?></td></tr> <tr><td class="bg1"><b>Animated</b>:</td><td class="bg1"> <? echo $row['animated']; ?></td></tr> <tr><td class="bg2"><b>Total Lights</b>:</td><td class="bg2"> <? echo $row['TotalLights']; ?></td></tr> <tr><td class="bg1"><b>Description</b>:</td><td class="bg1"> <? echo $row['description']; ?></td></tr> <tr><td class="bg2"><b>Website</b>:</td><td class="bg2"> <a href="<? echo $row['website']; ?>"><? echo $row['website']; ?></a></td></tr> <tr><td class="bg1" valign="top"><b>Current Conditions</b>:</td><td class="bg1"> <?php include("http://www.mesquitechristmas.com/hw/hw3.php?config=&forecast=zandh&pands=$postal&alt=display_current"); ?></td></tr> <tr><td class="bg2" valign="top"><b>Sponsor Links</b>:</td><td class="bg2"> <script type="text/javascript"><!-- google_ad_client = "pub-8048181801684156"; /* 234x60, created 2/2/08 */ google_ad_slot = "1119945783"; google_ad_width = 234; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table> <br /> <table border='0' cellpadding='0' cellspacing='0' class='fullbox' width='100%'> <tr> <td class="title">Directions to <? echo $row['displayname']; ?>...</td> </tr> </table> <table class="fullboxGmap" width="100%" cellpadding="3" cellspacing="1"> <tr> <td><div id="Gmap"></div></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table> <div class="b2"><?php include("http://www.mesquitechristmas.com/hw/hw3.php?config=&forecast=zandh&pands=$postal&alt=extended_forecast"); ?></div> <div class="b1"><?php include("http://www.mesquitechristmas.com/hw/hw3.php?config=&forecast=zandh&pands=$postal&alt=display_warnings"); ?></div> <div class="title">Comments For <? echo $row['displayname']; ?>...</div> <div class="fullbox"> <?php show_data(); ?> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> </tr> </table> <a name="comments" id="comments"></a> <form method="post" action="display.php?id=<?php echo $row['id']."#comments"; ?>"> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <div class="boxWrapper"> <div class="commentsInner commentsInput"> <table border="0" cellpadding="4" cellspacing="0" width="100%"> <tr> <td width="203">Name: <input type="text" name="firstname" value="Anonymous" onclick="this.value=''" /></td> <td width="287">Location: <input type="text" name="location" value="Anonymous" onclick="this.value=''" /></td> </tr> <tr> <td colspan="2"><br /> Comment (Max 255 characters):<br /> <textarea name="comment" rows="5" cols="50" class="c5" onkeydown="javascript:limittext(this.form.comment);"> </textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="reset" value="Reset" /> <input type="submit" value="Submit" name="timeout" /></td> </tr> </table> </div> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> </tr> </table> </form> <div class="b1"><a href='browse.php'><img src="images/return.gif" alt="return to list" /></a></div> </div> </div> <div id="footer">© 2007-2008 Mesquite Country Christmas<br /> This site best viewed with <a href="http://www.spreadfirefox.com/node&id=0&t=219"><img border="0" alt="Firefox 3" title="Firefox 3" src="http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/ff2b80x15.gif" /></a> <p align="center"> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a> <a href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.mesquitechristmas.com%2Fstylesheet.css&profile=css21&usermedium=all&warning=1/"><img class="c1" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a> </p> <script type="text/javascript"><!-- google_ad_client = "pub-8048181801684156"; //468x60, created 1/8/08 google_ad_slot = "0360766123"; google_ad_width = 468; google_ad_height = 60; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/121134-leave-a-comment-script-not-inserting-comments/#findComment-626276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.