Jump to content

Davie33

Members
  • Posts

    191
  • Joined

  • Last visited

Everything posted by Davie33

  1. Hi thanks for the reply what do you mean not using md5 ?.
  2. Am not too sure but i think am on the right path with this. Any help would be gr8t thanks. if ($_POST['password'] != $_POST['repeatpassword']) { ?><script>alert("Sorry password,repeatpassword does not match!");</script> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php echo $setting['siteurl'].'index.php?act=register';?>"> <?php exit; }
  3. Hi all hope you can help. For repeat password i was trying get repeat password to check if its the same as password if not same then you must enter password again. How do i code this in and what line would i add it too ?. <div id="center"> <div class="container_box1"> <div id="headergames2">Register:</div> <div class="containbox"><noscript> <?php if (isset($_POST['submit'])) { if ($_POST['recaptcha'] == 'yes') { include($setting['sitepath']."securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if (!$valid) { $passed = false; } else { $passed = true; } } elseif ($_POST['recaptcha'] == 'no') { $answer = array('10', 'ten'); if(!in_array(strtolower($_POST['security']),$answer)) { $passed = false; } else { $passed = true; } } if ($_POST['username']=='' || $_POST['password']=='' || $_POST['repeatpassword']=='') { ?><script>alert("Sorry username or password,repeatpassword is empty!!");</script> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php echo $setting['siteurl'].'index.php?act=register';?>"> <?php exit; } if ($passed) { $id = yasDB_clean($_POST["id"]); $username = yasDB_clean($_POST["username2"]); $password = md5(yasDB_clean($_POST["password"])); $repeatpassword = md5(yasDB_clean($_POST["repeatpassword"])); $name = yasDB_clean($_POST["name"]); $email = yasDB_clean($_POST["email"]);; $website = yasDB_clean($_POST["website"]); $date = time() + (0 * 24 * 60 * 60); $plays = 0; $points = 0; $randomkey = rand(13649875,98732458); $headers = 'From: '.$setting['sitename'].' <'.$setting['sitename'].'>'; $subject = 'Activate your account at '. $setting['siteurl']; $body = ' Thank you for becomming a member here at '.$setting['sitename'].'\r\n We hope you enjoy our site and what we have to offer.\r\n> To activate your account click the link below:\r\n '.$setting{'siteurl'}.'activated.php?id='.$id.'=code='.$randomkey.' \r\n Thanks, Admin:'; mail($email, $subject, $body, $headers); $stmt=yasDB_select("SELECT * FROM user WHERE username LIKE '$username'"); if($stmt->num_rows == 0){ $stmt = yasDB_insert("INSERT INTO `user` (username, password, repeatpassword, name, email, website, plays, points, date, randomkey, activated) VALUES ('$username','$password','$repeatpassword','$name','$email','$website','$plays','$points', '$date', $randomkey, '0')",false); if ($stmt) { ?><script>alert("Registered: Please check email to activate your account!");</script> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php echo $setting['siteurl'];?>"> <?php exit; } else { $stmt->close(); ?><script>alert("Action Failed");</script> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php echo $setting['siteurl'].'index.php?act=register';?>"> <?php exit; } } else { $stmt->close(); ?><script>alert("Sorry username or email exists try again!!");</script> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php echo $setting['siteurl'].'index.php?act=register';?>"> <?php } } } ?></noscript> <div id="preview"></div><div id="contactBox"> <?php if ($setting['regclosed'] == 'yes') { echo '<center>Registration is now closed.</center>'; } else { ?> <form name="myform" id="form" action="index.php?act=register" method="post" > Username: <br /> <input class="blue" type="text" name="username2" id="username2" size="35" /><br /> Password: <br /> <input class="formsheader" type="password" name="password" id="password" size="35" /> <Br /> Repeat Password: <br /> <input class="formsheader" type="password" name="repeatpassword" id="repeatpassword" size="35" /> <Br /> Name: <br /> <input type="text" name="name" size="35" /> <br /> Email: <br /> <input type="text" name="email" id="email" size="35" /> <br /> Website :<br /> <input type="text" name="website" size="35" /> <br /><br /> <?php if ($setting['userecaptcha'] == "yes") { @session_start(); // securimage captcha ?> <div style="width: 700px; float:left;height: 90px"> <img id="siimage" align="center" style="padding-right: 5px; border: 0" src="<?php echo $setting['siteurl']; ?>includes/securimage/securimage_show.php?sid=<?php echo md5(time()) ?>" /> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="19" height="19" id="SecurImage_as3" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="<?php echo $setting['siteurl']; ?>securimage_play.swf?audio=securimage_play.php&bgColor1=#fff&bgColor2=#284062&iconColor=#000&roundedCorner=5" /> <param name="quality" value="high" /> <param name="bgcolor" value="#284062" /> <embed src="<?php echo $setting['siteurl']; ?>securimage_play.swf?audio=securimage_play.php&bgColor1=#fff&bgColor2=#284062&iconColor=#000&roundedCorner=5" quality="high" bgcolor="#284062" width="19" height="19" name="SecurImage_as3" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> <!-- pass a session id to the query string of the script to prevent ie caching --> <a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = '<?php echo $setting['siteurl']; ?>includes/securimage/securimage_show.php?sid=' + Math.random(); return false"><img src="<?php echo $setting['siteurl']; ?>includes/securimage/images/refresh.gif" alt="Reload Image" border="0" onclick="this.blur()" align="middle" /></a> <div style="clear: both"></div> </div> Security Code:<br /> <input type="text" name="code" id="code" size="12" /><br /><br /> <input name="recaptcha" type="hidden" value="yes" /><?php // end securimage captcha } else { ?>Security Question: five + five = <br /> <input name="security" id="security" type="text" style="border: 1px solid #000;" /><br/> <input name="recaptcha" type="hidden" value="no" /><?php }?> <br/> <input type="submit" name="submit" value="Sign Up" /> </form> <br/>*Email is used to reset a forgotten password only. <?php } ?> </div></div> <div class="clear"></div> </div>
  4. Guys i got it working and thank you for your reply's. Here is what my query looks like if anyone comes to the same problem i had. "SELECT forumtopics.id, forumtopics.subject, forumposts.text, forumposts.date, forumposts.name FROM forumtopics INNER JOIN forumposts ON forumposts.topic = forumtopics.id ORDER BY forumposts.id DESC LIMIT 5" This query works as its on my site.
  5. Hi am not that good mysql i am still learning. this is what am aiming for We have more than 5 topics so.... Only the last five topics that had a post made would show. The username and date is pulled from forumposts and then we pull the subject of that topic that had the post to look like this..... -------------------------------------------------------------------------------- Latest topics - mostviewe username - date topic name date "My known issues for minix" username - date "low quality thumbnails" username - date "What would you like in ne" username - date "PurpleBot is back" username - date So say i made a post on "What would you like in ne" It will then look like this..... ------------------------------------------------------------------------------- What would you like in ne username - date Latest topics - mostviewe username - date My known issues for minix username - date low quality thumbnails username - date PurpleBot is back username - date
  6. Here is error. Error number: 0 - MySQL error Syntax error near '.Subject ON '.subject ON maxforumtopics.subject, forumposts.id=forumtopics.id ORDER by forump' on line 1 Query: "SELECT forumposts.id, forumposts.name,forumposts.date,forumtopics.subject FROM forumposts INNER JOIN (SELECT forumposts.id, MAX(id) AS lastid FROM forumtopics GROUP BY forumposts.id) maxforumtopics.subject ON maxforumtopics.subject, forumposts.id=forumtopics.id ORDER by forumposts.id asc limit 5"
  7. Thanks on the info been at this for 2 days still not getting it to work correct. I still need your help on this please. <div class="nav_box"><div class="nav">Latest Posts</div> <div class="nav_box2"> <?php $query = yasDB_select("SELECT * FROM forumposts"); if ($query->num_rows == 0) { echo '<center><h3>We have no posts yet!</h3></center>'; } else { $query = yasDB_select("SELECT forumposts.id, forumposts.name,forumposts.date,forumtopics.subject FROM forumposts INNER JOIN (SELECT forumposts.id, MAX(id) AS lastid FROM forumtopics.id GROUP BY forumposts.id) maxforumtopics.subject ON maxforumtopics.subject, forumposts.id=forumtopics.id ORDER by forumposts.id asc limit 5"); while($row = $query->fetch_array(MYSQLI_ASSOC)) { $subject = $row['subject']; $date = $row['date']; $name = $row['name']; if ($setting['seo'] == 'yes') { $topiclink = $setting['siteurl'].'forumtopics/'.$row['id'].'/1.html'; } else { $topiclink = $setting['siteurl'] . 'index.php?act=forumtopics&id='.$row['id']; } ?> <a href="<?php echo $topiclink;?>"><?php echo $subject;?></a><br /><?php echo $name;?> - <?php echo $date;?><br> <?php } } $query->close(); ?> </div> </div>
  8. I thought i had it working with this query but no.I am getting closer to fixing it but if any one knows a fix for this please post back. $query = yasDB_select("SELECT forumposts.id, forumposts.name,forumposts.date,forumtopics.subject FROM forumposts INNER JOIN forumtopics ON forumposts.id=forumtopics.id ORDER by id desc limit 5");
  9. Hi all am in need of your help am wanting to join two sql tables so that i show name of topic but username and date of the last post. Am really finding this abit hard to do if any would please help thank you. I know my query is not correct but really do need the help. <?php$query = yasDB_select("SELECT * FROM forumposts");if ($query->num_rows == 0) {echo '<center><h3>We have no posts yet!</h3></center>';}else {$query = yasDB_select("SELECT forumposts.id,forumposts.date,forumposts.name,forumtopics.id,forumtopics,subject FROM forumposts, forumtopics WHERE forumtopics.subject ORDER by id asc limit 5");while($row = $query->fetch_array(MYSQLI_ASSOC)) {$subject = $row['subject'];$date = $row['date'];$name = $row['name'];if ($setting['seo'] == 'yes') {$topiclink = $setting['siteurl'].'forumtopics/'.$row['id'].'/1.html';} else {$topiclink = $setting['siteurl'] . 'index.php?act=forumtopics&id='.$row['id'];}?><a href="<?php echo $topiclink;?>"><?php echo $subject;?></a><br /><?php echo $name;?> - <?php echo $date;?><br><?php }}$query->close();?> Tables for sql. forumtopics = id,subject,cat,name,date forumposts = id,text,date,name,topic name = username topic = topic id from forumtopics cat is the catid from forum sql which we don't need to worry about forum sql i mean. and topic is the topic id from forumtopics I need to join forumtopics = subject with forumposts = id username and date.
  10. Guys its ok i got it thanks anyway.
  11. Hi am hoping yous guys can help me with my sql. Here is sql ALTER TABLE `settings` MODIFY `theme` varchar(12) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'minix_26' I want to alter the table "settings` and modify the theme from minix_25 to what you see above ^. Only thing is when i enter it in the sql phpmyadmin it returns saying. " MySQL returned an empty result set (i.e. zero rows). (Query took 0.0650 sec)"
  12. Fook me i already fixed it on another file thanks guys for the help anyway. I really thought i had lost the file that i fixed .
  13. Am not to sure but i think this has solved it. <?php $catcheck = yasDB_select("SELECT `name` FROM `categories` WHERE `id` = " . $row['category']); $catname = $catcheck->fetch_array(MYSQLI_ASSOC); if ($id = $row['category']) { if ($setting['seo']=='yes') { ?> <a href="<?php echo $setting['siteurl'];?>category/<?php echo $row['category'];?>/1.html" onMouseover="showhint('<b><?php echo ucfirst($catname['name']);?></b>',this, event, 'auto')"><?php echo ucfirst($catname['name']);?></a> <?php } else { ?> <a href="<?php echo $setting['siteurl'];?>index.php?act=cat&id=<?php echo $row['category'];?>" onMouseover="showhint('<b><?php echo ucfirst($catname['name']);?></b>',this, event, 'auto')"><?php echo ucfirst($catname['name']);?></a> <?php } } ?>
  14. Hi what am looking for is when i go to the game page that code above is to give the name of the category the game is from. For some reason the code does work but still give out the error as thats whats on my site atm is that code. Check my link below then go to the main game page on any game you will see the name of the cat the game is from.
  15. It not my code i had it made for me that's why i posted on here for help am kinda lost with it. Sry am not an expert on php . How can i fix it ?.
  16. Hi guys hoping you can help with this code of mine. I seem to be getting an error ,i know its the query but tried a few to fix it without joy. <?php $catcheck = yasDB_select("SELECT `name` FROM `categories` WHERE `id` = " . $row['category']); $catname = $catcheck->fetch_array(MYSQLI_ASSOC); if ($setting['seo']=='yes') { ?> <a href="<?php echo $setting['siteurl'];?>category/<?php echo $row['category'];?>/1.html" title="<?php echo ucfirst($catname['name']);?>"><?php echo ucfirst($catname['name']);?></a> <?php } else { ?> <a href="<?php echo $setting['siteurl'];?>index.php?act=cat&id=<?php echo $row['category'];?>" title="<?php echo ucfirst($catname['name']);?>"><?php echo ucfirst($catname['name']);?></a> <?php } ?> this is the line thats causing the error. $catcheck = yasDB_select("SELECT `name` FROM `categories` WHERE `id` = " . $row['category']); error Error No: 0 - MySQL error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query: "SELECT `name` FROM `categories` WHERE `id` = " #0 /public_html/arcade/templates/minix_25/game.php(236): yasDB_select('SELECT `name` F...') #2 {main}
  17. Its ok guys thanks anyway and sorry about asking for pm help.
  18. Hi thanks for the reply. $setting['siteurl'] will print out the url with anding slash so no need to worry about that. I would like the email to let us return back to say www.games-flash.co.uk/forgotpassword.html But the part i need added to it is this code=$code&username=$username Would it be ok to send full code by pm ? its only two files and they are not big files.
  19. Hi all am having a small problem,When i change my password and i get email in emil the url is wrong as i would like to return back to forgotpassword.html How would i do this ?. This is the email that you would receive $setting['siteurl'] prints out the main domain name. $body = " You are receiving this e-mail because a request was made to reset your password If you did not make this request, you can ignore this e-mail. Click this link to reset your password. ".$setting['siteurl']."forgotpassword.php?code=$code&username=$username ";
  20. Ok thanks for all the help Barand .I will try it out some other day when i get the time to recode it thanks again.
  21. Thanks Barand,sry was reading up on what Jacques1 said. I think i need to recode the code again to get it to work with what you got but with a small tweak on the sql as you don't really need g. or c.added. As i have seen this in my script which i forgot about i had something like that sql for my forum.
  22. Hi how can i do that ?.Sorry my php coding is not that good.
  23. Thanks i got it working now just to fix my css for it.
  24. So i should $result the first one instead of the first $query ?.
  25. Hi all am haiving abit of a problem am trying to query 6 categories with 6 games each.With the code i done is only showing one cat with 6 games. How can i fix this ?. If you go to games-flash.co.uk you will see at the bottom of the home page that only one cat shows. php code. <div class="catgames"> <?php $query = yasDB_select("SELECT * FROM categories WHERE active='yes' AND home='yes' ORDER BY id DESC LIMIT 6",false); while ($row = $query->fetch_array(MYSQLI_ASSOC)) { $catid = $row['id']; $query = yasDB_select("SELECT id, title, thumbnail, description, plays, active FROM games WHERE category=".$catid." AND active='1' ORDER BY id DESC LIMIT 6",false); echo '<ul><li class="even"><div id="catheadergms">'; if ($setting['seo'] == 'yes') { echo '<a href="' . $setting['siteurl'] . 'category/' . $row['id'] .'/1.html">'.$row['name'].'</a>'; } else { echo '<a href="' . $setting['siteurl'] . 'index.php?act=cat&id=' . $row['id'] .'">'.$row['name'].'</a>'; } echo '</div>'; while ($games = $query->fetch_array(MYSQLI_ASSOC)) { $pic_settings = array('w'=>115,'h'=>72); $gameurl = prepgame($games['title']); $games['description'] = stripslashes($games['description']); if (file_exists($games['thumbnail'])) { $thumbnail = urldecode($games['thumbnail']); } else { $thumbnail = $setting['siteurl'].'templates/'.$setting['theme'].'/skins/'.$setting['skin'].'/images/nopic.jpg'; } if ($setting['seo']=='yes') { $gurl = $setting['siteurl'] . 'game/' . $games['id'] . '/' . $gameurl . '.html'; } else { $gurl = $setting['siteurl'] . 'index.php?act=game&id=' . $games['id']; } $hinttext = '<h2 class="title">'.$games['title'].'</h2>'.$games['description']; $hinttext = str_replace(array("\r\n", "\r", "\n"), '<br/>', $hinttext); $hinttext = str_replace(array('"',"'"),array('"','’'),$hinttext); ?> <div class="inner_box4"><a href="<?php echo $gurl;?>"><img align="absmiddle" src="<?php echo resize($thumbnail, $pic_settings);?>" title="<?php echo $games['title'];?> - <?php echo $games['plays'];?> Plays" width="115" height="72" /></a> </div> <?php } echo '</li></ul>'; } $query->close(); ?> <div class="clear"></div> </div>
×
×
  • 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.