Jump to content

vyb3

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vyb3's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a problem with two scripts clashing, i've narrowed it down to a single piece of code thats causing the problem: This is the code: <?php $curdir = getcwd (); chdir('../forum'); require_once('../forum/global.php'); chdir ($curdir); ?> Its a code for a forum login script on my sites homapge (for vbulletin) and I have a news script/cms script to manage categories on my site and this clash is casuing the pagination of this cms/news script to screw up, and its not adding & in links sometimes either too. When I remove this piece of code which is placed at the top of my index.php before the html tags, everything works fine with my site but the login doesn't work then. How can I do what this piece of code is trying to achieve without the two scripts clashing...
  2. $sql = "SELECT allowcomments FROM $newstable WHERE id = '".slash2($id) . "'";
  3. How do I go about finding that information?
  4. I tried that man Warning: mysql_result() [function.mysql-result]: Unable to jump to row 1 on MySQL result index 25 in /home/fhlinux159/v/vyb3.co.uk/user/htdocs/vyb308/news/index.php on line 46 ####@@@**split**@@@###Please enter a name.####@@@**split**@@@### this is real baffling me u no
  5. $query = mysql_query($sql); $allowcomments = mysql_result($query,0); echo $delimiter; $message = slash2($_POST['message']); $message = str_replace($delimiter ,"",$message); $name = slash2($_POST['name']); $name = str_replace($delimiter,"",$name); $email = slash2($_POST['email']); $email = str_replace($delimiter,"",$email); if(!$name){ echo "Please enter a name."; }elseif(!$message){ echo "Please enter a message."; }else{ if($allowcomments == "1" || $allowcomments == "2"){ $sql2 = "SELECT * FROM $newsusers WHERE user = '". $name . "'"; $query2 = mysql_query($sql2); $ex = mysql_num_rows($query2); if(time() - $_SESSION['lastmsg'] <= $spamtime){ $spammsg = str_replace("{timeleft}",($spamtime - (time() - $_SESSION['lastmsg'])),$spammsg); echo $spammsg; }else{ $user = slash2($_POST['name']); $user = str_replace($delimiter ,"",$user); $message = slash2($_POST['message']); $message = str_replace($delimiter ,"",$message); $email = slash2($_POST['email']); $email = str_replace($delimiter ,"",$email); $timestamp = time(); $ip = $_SERVER['REMOTE_ADDR']; $pid = slash2($id); $all = mysql_fetch_array($query2); if($allowcomments == "1"){ $approved = '1'; }elseif($allowcomments == "2"){ $approved = '0'; } $sql = "INSERT INTO $newscomments (user,email,message,timestamp,approved,ip,pid) VALUES ('$user','$email','$message','$timestamp','$approved','$ip','$pid')"; if($ex == 1){ if($_SESSION['name'] == $all['user']){ $_SESSION['lastmsg'] = time(); $query = mysql_query($sql) or die(mysql_error()); if($allowcomments == "1"){ echo $commentmsg; }elseif($allowcomments == "2"){ echo $commentapprovemsg; } }else{ echo "Choose another name."; } }else{ $_SESSION['lastmsg'] = time(); $query = mysql_query($sql) or die(mysql_error()); if($allowcomments == "1"){ echo $commentmsg; }elseif($allowcomments == "2"){ echo $commentapprovemsg; } } } }else{ #incase anyone tries adding comments to posts which have comments disabled echo "Nice try"; } } } echo $delimiter; } Line 46 which the error message displays is: $allowcomments = mysql_result($query,0); So any ideas peeps? i'm trying....
  6. Ok i have figured it out the problem is coming from the index file of my news script... $delimiter = '####@@@**split**@@@###'; I found that piece of code in there.... Still I don't know what to change to make this error go away, it has also caused my news categories search function to malfunction.... This is really doing my head in!
  7. Its wierd though because I dont have any mysql num code in the piece of code i've added which has caused this....
  8. Hi, i'm currently trying to implement something into my website and it keeps giving me parse erros: echo 'Vyb3 welcomes users from: <img src = \"http://www.bfnsoftware.com/cgi-bin/home/Members/Flag/Flag.cgi?User=29365\">' What have I done wrong?
  9. Why has this been moved this script is not a 3rd party script... Its to do with a 3rd party script...
  10. I've got a very strange error on my site (www.vyb3.co.uk) The error appears in a completely different place on my site to where I installed the script thats resulted in this error, Its a vbulletin login script to allow users to be able to login to the site on the homepage as well as in the forums (because im going to password protect some pages) But yeah the code for this login box is: This code is displayed at the top of my page before the <html> tag <?php $curdir = getcwd (); chdir('../forum'); require_once('../forum/global.php'); chdir ($curdir); ?> Then this code is placed where I want my login box to be. <?PHP $forumpath = "../forum"; // We check if user is logged in if ($vbulletin->userinfo['userid']!=0) { // +++++++++++++++++++++++++++++++++++++++++ // As Logged in display welcome back message // +++++++++++++++++++++++++++++++++++++++++ echo "Welcome Back, <b>"; echo $vbulletin->userinfo['username']; echo " !</b><br />"; // As were logged in display logout link echo "<a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&logouthash=$logouthash"; echo $vbulletin->userinfo['logouthash']; echo "\">"; echo "<font size=\"1\" face=\"verdana\">Log Out</font></a><br />"; // Display last visit time and date echo "You last visited: $pmbox[lastvisitdate] at $pmbox[lastvisittime]"; echo "<br />"; // Display PM Details and generate link to PM box echo "<a href=\"".$forumpath."private.php?$session[sessionurl] \">Private Messages: </a> $vbphrase[unread_x_nav_compiled] $vbphrase[total_x_nav_compiled]"; echo "<br />"; } else { include("login_vb.php"); } ?> Then this is the code for login_vb.php <form action="../forum/login.php?do=login" method="post" onSubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])"> <input type="hidden" name="do" value="login" /> <input type="hidden" name="url" value="http://www.vyb3.co.uk/vyb308/index.php?vyb3=main" /> <input type="hidden" name="vb_login_md5password" /> <input type="hidden" name="vb_login_md5password_utf" /> <input type="hidden" name="s" value="$session[sessionhash]" /> <label>Username:<input name="vb_login_username" type="text" class="bginput" id="login" accesskey="u" tabindex="1" size="12"/> </label> <label><br> Password: <input name="vb_login_password" type="password" class="bginput" id="password" tabindex="1" size="12" /> </label> <label><br> Remember me? <input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" /></label> <br> <input name="submit" type="submit" id="submit" tabindex="1" value="Login" accesskey="s" class="button" /> </form> And the error displays on a completely different part of the site...
  11. Ok I'l gonna try it now how do i add a default? say if i want the default to be index.php?vyb3=main
  12. Right i've been having problems with my site (www.vyb3.co.uk) loading sometimes it will load properly then other times it appears to time out and only half load... I've tested it on serveral computers and it happens on them all, i've also spoke to my webhost but they haven't responded so I tried to figure out what the problem was my self and I believe its this code: <?php if(isset($_GET['vyb3'])) $vyb3=$_GET['vyb3']; else $vyb3=''; switch ($vyb3) { case "main": include('main.php'); break; case "about": include('about.php'); break; case "contact": include('contact.php'); break; case "news": include('news.php'); break; case "forums": include('forums.php'); break; case "sounds": include('sounds.php'); break; case "downloads": include('downloads.php'); break; case "links": include('links.php'); break; case "linktous": include('linktous.php'); break; case "sponsors": include('sponsors.php'); break; case "riddims": include('riddims.php'); break; case "disclaimer": include('disclaimer.php'); break; case "artistsmyspace": include('artistsmyspace.php'); break; case "acapellas": include('acapellas.php'); break; case "instrumentals": include('instrumentals.php'); break; case "greensleeves": include('greensleeves.php'); break; case "chineseassassin": include('chineseassassin.php'); break; case "federationinvasionmixtapes": include('federationinvasionmixtapes.php'); break; case "october2008": include('october2008.php'); break; case "october2008mixtapes": include('october2008mixtapes.php'); break; case "september2008": include('september2008.php'); break; case "september2008mixtapes": include('september2008mixtapes.php'); break; case "august2008": include('august2008.php'); break; case "august2008mixtapes": include('august2008mixtapes.php'); break; case "july2008": include('july2008.php'); break; case "july2008mixtapes": include('july2008mixtapes.php'); break; case "june2008": include('june2008.php'); break; case "june2008mixtapes": include('june2008mixtapes.php'); break; case "may2008": include('may2008.php'); break; case "may2008mixtapes": include('may2008mixtapes.php'); break; case "april2008": include('april2008.php'); break; case "april2008mixtapes": include('april2008mixtapes.php'); break; case "march2008": include ('march2008.php'); break; case "march2008mixtapes": include('march2008mixtapes.php'); break; case "february2008": include('february2008.php'); break; case "february2008mixtapes": include('february2008mixtapes.php'); break; case "january2008": include('january2008.php'); break; case "january2008mixtapes": include('january2008mixtapes.php'); break; case "q42007": include('q42007.php'); break; case "q42007mixtapes": include('q42007mixtapes.php'); break; case "q32007": include('q32007.php'); break; case "q32007mixtapes": include('q32007mixtapes.php'); break; case "q22007": include('q22007.php'); break; case "q22007mixtapes": include('q22007mixtapes.php'); break; case "q12007": include('q12007.php'); break; case "q12007mixtapes": include('q12007mixtapes.php'); break; case "2006": include('2006.php'); break; case "2005": include('2005.php'); break; case "2004": include('2004.php'); break; case "2003": include('2003.php'); break; case "2002": include('2002.php'); break; case "2001": include('2001.php'); break; case "2000": include('2000.php'); break; case "19901999": include('19901999.php'); break; case "pre1990": include('pre1990.php'); break; case "19901999mixtapes": include('19901999mixtapes.php'); break; case "pre1990mixtapes": include('pre1990mixtapes.php'); break; case "2006mixtapes": include('2006mixtapes.php'); break; case "2005mixtapes": include('2005mixtapes.php'); break; case "2004mixtapes": include('2004mixtapes.php'); break; case "2003mixtapes": include('2003mixtapes.php'); break; case "2002mixtapes": include('2002mixtapes.php'); break; case "2001mixtapes": include('2001mixtapes.php'); break; case "2000mixtapes": include('2000mixtapes.php'); break; } ?> Is there any more efficient way to do this? I need to keep the variable set to vyb3 and I could do with keeping all my pages in the same directory as It would be a hell of a lot of hassle to change everything. But I need a navigation system that doesnt time out sometimes.... Thats if this is even the problem.... ARGH its driving me mad!
  13. I've spoke to my webost and they haven't responded... I do think its a problem with a script but i just dont know what....
×
×
  • 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.