ecabrera Posted July 31, 2011 Share Posted July 31, 2011 ok when i go to my videos page and i click on the header to go home instead of taking me to www.mywebsite.index.php it takes me to index.php/ is something wrog with my header r videos page i'll post both code plz help me its annoy Video Page code <?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=iso-8859-1" /> <meta name="rating" content="General" /> <meta name="ROBOTS" content="All" /> <title>Videos</title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> </head> <body> <?php include_once "header_template.php"; ?> <table class="mainBodyTable" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="740" valign="top"><div><?php include_once "leaderBoardAd.php"; ?></div><br /> <table width="90%" align="center" cellpadding="6"> <tr> <td style="line-height:1.7em;"><h2>Videos</h2> <?php require("scripts/checkuserlog.php"); if(@$_GET['id']){$getid = $_GET['id']; echo "<div id='full'>"; echo "<div id='video'>"; $query = mysql_query("SELECT * FROM videos WHERE id='$getid'"); $numrows = mysql_num_rows($query); if ($numrows == 1){ $row = mysql_fetch_assoc($query); $id = $row['id']; $user_id = $row['user_id']; $user_name = $row['user_name']; $title = $row['title']; $description = $row['description']; $keywords = $row['keywords']; $category = $row['category']; $videoid = $row['videoid']; $views = $row['views']; $comments = $row['comments']; $date = $row['date']; $description =($description); // start left column echo "<div id='left'>"; // update the video views $views = $views + 1; mysql_query("UPDATE videos SET views='$views' WHERE id='$id'"); // display title echo "<h2><a href='videos.php?id=$id'>$title</a></h2>"; // display video echo " <object width='640' height='505'> <param name='movie' value='http://www.youtube.com/v/".$videoid."&autoplay=0&hl=en_US&fs=1'></param> <param name='allowFullScreen' value='true'></param> <param name='allowscriptaccess' value='always'></param> <embed src='http://www.youtube.com/v/".$videoid."&autoplay=0&hl=en_US&fs=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='640' height='505'></embed> </object>"; // display information echo "<b style='float: right;'>$views views</b>"; echo "<b><a href='profile.php?id=$user_id'>$user_name</a> on $date in $category</b><br /><br />"; echo "$description<br /><br />$keywords"; // comment section echo "<a name='comments'></a><div style='margin-top: 15px;'> <b class='corners'> <b class='corners1'><b></b></b> <b class='corners2'><b></b></b> <b class='corners3'></b> <b class='corners4'></b> <b class='corners5'></b></b> <div class='cornersfg'> <div class='top'>$title Comments</div> </div> <div class='bottom'>"; // comment button action if ($_POST['commentbtn']){ $comment = $_POST['comment']; if ($comment){ if ($userid != $getid){ $query = mysql_query("SELECT * FROM video_comments WHERE video_id='$getid' AND user_id='$userid' AND comment='$comment'"); $numerows = mysql_num_rows($query); if ($numrows != 0){ $commdate = date("F d, Y"); // October 08, 2010 mysql_query("INSERT INTO video_comments VALUES ('', '$getid', '$userid', '$username', '$comment', '$commdate')"); // email profile owner $webmaster = "admin@******.com"; $headers = "From: ******<$webmaster>"; $subject = "$username has commented on your profile"; $message = "Hello $firstname $lastname. $username has posted a comment on your you video titled \"$title\" on ******.com"; $message .= " The message $username has posted with is below.\n"; $message .= "\n****************************************************************\n"; $message .= "$comment"; $message .= "\n\n****************************************************************\n\n"; $message .= "Click here to view $username's profile profile.php?id=$userid\n"; $message .= "Click here to view your video videos.php?id=$getid\n"; // send email mail($email, $subject, $message, $headers); $msg = "Your comment has been added and is shown above."; } else $msg = "You can not submit the same comment twice."; } else $msg = "You can not comment on your own video."; } else $msg = "You did not supply a comment."; } // display comments $perpage = 10; $start = $_GET['s']; if (!$start) $start = 0; $query = mysql_query("SELECT * FROM video_comments WHERE video_id='$getid' ORDER BY id DESC LIMIT $start, $perpage"); $numrows = mysql_num_rows($query); if ($numrows > 0){ $next = $start + $perpage; $prev = $start - $perpage; while($row = mysql_fetch_assoc($query)){ $user_id = $row['user_id']; $user_name = $row['user_name']; $comment = nl2br($row['comment']); $date = $row['date']; echo "<b>Posted by <a href='profile.php?id=$user_id'>$user_name</a> on $date</b><br />"; echo "<div style='margin-left: 10px;'>$comment</div><hr>"; } } else echo "This video has no comments.<br />"; // end diplay comment area // show comment nav echo "<div style='float: right;'>"; if (!($start <= 0)) echo "<a href='videos.php?id=$getid&s=$prev#comments'>Previous</a>"; if (!($start > $numrows - $perpage)) echo "<a href='videos.php?id=$getid&s=$next#comments'>Next</a>"; echo "</div>"; if ($username){ // display comment form echo "<a name='comment-form'></a>"; if ($msg) echo "<b>$msg</b><br />"; echo "<form action='videos.php?id=$getid#comment-form' method='post'> <table> <tr> <td><textarea name='comment' style='width: 400px; height: 75px;'></textarea></td> </tr> <tr> <td><input type='submit' name='commentbtn' value='Comment'></td> </tr> </table> </form>"; } // end comment box echo "</div> <b class='corners'> <b class='corners5'></b> <b class='corners4'></b> <b class='corners3'></b> <b class='corners2'><b></b></b> <b class='corners1'><b></b></b></b> </div>"; // end comment section echo "</div>"; // end left column } else echo "The video you were looking for was not found."; // end full and video echo "</div>"; echo "</div>"; } else{ echo "<div id='left'>"; $perpage = 10; if(@$_GET['s']){ $start = $_GET['s']; } else{ $start = 0; } $next = $start + $perpage; $prev = $start - $perpage; $query = mysql_query("SELECT * FROM videos ORDER BY id DESC"); $numrows = mysql_num_rows($query); if ($numrows > 0){ $query = mysql_query("SELECT * FROM videos ORDER BY id DESC LIMIT $start, $perpage"); // show comment nav echo "<center><div class='pagination'>"; if (!($start <= 0)) echo "<a href='videos.php?s=$prev'>Previous</a>"; /* $x = 1; for ($i = 0; $i < $numrows; $i += $perpage){ if ($start != $i) echo "<a href='videos.php?s=$i'>$x</a>"; else echo "<a href='videos.php?s=$i'><b><u>$x</u></b></a>"; $x++; } */ if (!($start > $numrows - $perpage)) echo "<a href='videos.php?s=$next'>Next</a>"; echo "</div></center><br />"; while ($row = mysql_fetch_assoc($query)){ $id = $row['id']; $user_id = $row['user_id']; $user_name = $row['user_name']; $title = $row['title']; $description = $row['description']; $keywords = $row['keywords']; $category = $row['category']; $videoid = $row['videoid']; $views = $row['views']; $comments = $row['comments']; $date = $row['date']; //$description = $description.$description.$description; if (strlen($description) >= 100) $description = substr($description, 0, 100)."..."; echo "<div class='video'> <div class='image'><a href='videos.php?id=$id'><img src='http://i1.ytimg.com/vi/$videoid/default.jpg'></img></a></div> <div class='info'> <div class='title'><a href='videos.php?id=$id'>$title</a></div> <div class='description'> $description <br /><br /> <div style='float: left; font-size: 16px;'><a href='profile.php?id=$user_id'>$user_name</a></div> <div style='float: right; font-size: 16px;'>$category</div> <center>$views views</center> </div> </div> </div>"; } // show comment nav echo "<div class='clear'></div>"; echo "<center><div class='pagination'>"; if (!($start <= 0)) echo "<a href='videos.php?s=$prev'>Previous</a>"; if (!($start > $numrows - $perpage)) echo "<a href='videos.php?s=$next'>Next</a>"; echo "</div></center>"; } else echo "There currently are no videos."; echo "</div>"; echo "<div id='right'></div>"; } mysql_close(); ?> <h2><br /> </h2></td> </tr> </table></td> <td width="160" valign="top"><?php include_once "right_AD_template.php"; ?></td> </tr> </table> <?php include_once "footer_template.php"; ?> </body> </html> Header code <?php ?> <div style="background-image:url(style/headerStrip.jpg); height:50px; border-bottom:#999 1px solid;"> <table width="900" align="center" cellpadding="0" cellspacing="0" > <tr> <td width="169"><a href="http://<?php echo $dyn_www; ?>"><img src="images/logo2.png" alt="Web Intersect Social Network" width="156" height="48" border="0" /></a></td> <td width="513"> <div class="headerBtns" style="margin-top:12px;"> <a href="http://<?php echo $dyn_www; ?>/index.php">Home</a> <a href="http://<?php echo $dyn_www; ?>/about.php">About</a> <a href="http://<?php echo $dyn_www; ?>/member_search.php">Members</a> <a href="http://<?php echo $dyn_www; ?>/videos.php">Videos</a> </div> </td> <td width="216"><div align="right" style="margin-bottom:12px;"> <?php echo $logOptions; ?></div></td> </tr> </table> </div> Link to comment https://forums.phpfreaks.com/topic/243354-help-header-problem-plzzz-so-sad/ Share on other sites More sharing options...
inversesoft123 Posted July 31, 2011 Share Posted July 31, 2011 what value is assigned to variable $dyn_www ???? Link to comment https://forums.phpfreaks.com/topic/243354-help-header-problem-plzzz-so-sad/#findComment-1249709 Share on other sites More sharing options...
ecabrera Posted July 31, 2011 Author Share Posted July 31, 2011 its not that i checked it has something to do with the videos page because every other page works fine except the videos page and i check my header code and i think that cant be either but something is messing up the header code in the videos page because when i click about it talks me to about.php/ Link to comment https://forums.phpfreaks.com/topic/243354-help-header-problem-plzzz-so-sad/#findComment-1249712 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.