Jump to content

Stotty

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Everything posted by Stotty

  1. Thanks KEV after using that code in the email it send the write code 7787-8880-9990-9989 but in the database its still imputting 2456 a 4 numbered one How can i fix this $i = 0; $activ_code = array(); while (++$i < 5) $activ_code[] = rand(1000, 9999); $activ_code = implode('-', $activ_code); $server = $_SERVER['HTTP_HOST']; $host = ereg_replace('www.','',$server); mysql_query("INSERT INTO users (`user_email`,`user_pwd`,`country`,`joined`,`activation_code`,`full_name`) VALUES ('$_POST[email]','$md5pass','$_POST[country]',now(),'$activ_code','$_POST[full_name]')") or die(mysql_error()); Imputting into the database code is "INSERT INTO users (`user_email`,`user_pwd`,`country`,`joined`,`activation_code`,`full_name`) VALUES ('$_POST[email]','$md5pass','$_POST[country]',now(),'$activ_code','$_POST[full_name]')") or die(mysql_error()); Thanks
  2. Ive made a register page and it emails a activation code $activ_code = rand(1000,9999); $server = $_SERVER['HTTP_HOST']; $host = ereg_replace('www.','',$server); mysql_query("INSERT INTO users (`user_email`,`user_pwd`,`country`,`joined`,`activation_code`,`full_name`) VALUES ('$_POST[email]','$md5pass','$_POST[country]',now(),'$activ_code','$_POST[full_name]')") or die(mysql_error()); $message = "Thank you for registering an account with $server. Here are the login details...\n\n User Email: $_POST[email] \n Password: $_POST[pass2] \n Activation Code: $activ_code \n ____________________________________________ *** ACTIVATION LINK ***** \n Activation Link: http://$server/activate.php?usr=$_POST[email]&code=$activ_code \n\n _____________________________________________ Thank you. This is an automated response. PLEASE DO NOT REPLY. "; ATM : the code is 4 letters so anything from 0000 to - 9999 random So output is Your activation code is : 8989 i want it to look more pro and send out Your activation code is 1089-8778-9090-8787 Thanks In advanced Stotty
  3. Thank you so much mate
  4. Ive already been given that url but can someone give me the code because i dont understand it
  5. Im trying to grab <div class"newsTitle"> From runescape.com How would i make it appear on my homepage my homepage is php can someone give me the code Thanks in advanced Stotty
  6. This is my 3rd Thread Im trying to grab latest news of runescape to my website using Runescapes div tag <div class="newsTitle"> I dont know how to get it over but i really need help As my site is estimated to go live in around 2 hours these are the finsihing touches to it Thanks guys In advanced
  7. Hello PhpFreaks (: Im making a website that needs to grab news from another website " runescape.com " The div i need to grab is <div class="newsTitle"> And i got told to get this code <?php $ch = curl_init("http://www.example.com/"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); ?> I was just wondering what i need to change to get it to grab that data (: Thanks in Advanced
  8. <?php $ch = curl_init("http://www.example.com/"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); ?> Thats the code If i wanted to open a div " <div class=""newsTitle""> " from runescape.com how would i do that Cheers In Advanced
  9. Sorry Do you know how to do it matey and thanks for your help before
  10. Bump Please help need to get this done quick Thanks in advanced
  11. Right ive got my website And im trying to add news of another website eg Runescape.com there latest news so on my website in the code i would put <div class=""newsTitle""> But it needs to open runescape first so it knows to get divclass from runescape.com Anyone help ?
  12. Thats everything could you write me one up all i need it to do is website/index.php?action=status or =client Thanks in Advance
  13. <?php $action = $_GET['action']; if($action == "") { $include = "home.php"; } $include2 = $include . ".php"; if(file_exists($include2)) { include($include2); } else { echo 'Page Cannot Be Found.<br>'; echo 'Requested File: ' . strip_tags($include2); } ?> and the error is Parse error: syntax error, unexpected '{' in /home/a5499887/public_html/Setoxis/index.php on line 7
  14. Ive just uploaded this script <?php $action = $_GET['action']; if($action == "") { $include = "home.php"; } $include2 = $include . ".php"; if(file_exists($include2) { include($include2); } else { echo 'Page Cannot Be Found.<br>'; echo 'Requested File: ' . strip_tags($include2); } ?> Ive had this error before but carnt rember how i fixedd this is the error i get Parse error: syntax error, unexpected '{' in /home/a5499887/public_html/Setoxis/index.php on line 7 Thanks in Advanced
  15. Right ive got my website And im trying to add news of another website eg Runescape.com there latest news so on my website in the code i would put <div class=""newsTitle""> But it needs to open runescape first so it knows to get divclass from runescape.com Anyone help ?
  16. Im using this code to add up my Post count (creds Blade ) $sql = mysql_query("SELECT posts FROM km_users WHERE playername = '$player'"); $sql = mysql_fetch_assoc($sql); $posts = $sql['posts']; $sql = mysql_query("UPDATE km_users SET posts = '".($posts + 1)."' WHERE playername = '$player'"); thats on post.php and reply.php its adding perfect ive got 2 users on called "k" and one called "one" one has 5 posts and k has 3 if on messages.php i add this code $sql = mysql_query("SELECT posts FROM km_users WHERE playername = '$player'"); $sql = mysql_fetch_assoc($sql); $posts = $sql['posts']; print "<br>"; print "Posts :"; echo $posts; it displays 3 Posts for every user that would be K's post count how can i make it display each users post count not just 1 users my mysql is like this CREATE TABLE `km_users` ( `ID` bigint(21) NOT NULL auto_increment, `status` int(11) NOT NULL default '0', `playername` varchar(15) NOT NULL default '', `password` varchar(255) NOT NULL default '', `email` varchar(255) NOT NULL default '', `validated` int(11) NOT NULL default '0', `validkey` varchar(255) NOT NULL default '', `tsgone` bigint(20) NOT NULL, `oldtime` bigint(20) NOT NULL default '0', `lasttime` bigint(20) NOT NULL default '0', `posts` int(11) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; Thanks in advanced
  17. On my custom forums im making the Post Count at the Moment In Post.php ive added mysql_query("UPDATE km_users SET posts = '+1' WHERE playername = '$player'"); But when i post the post count goes to one then stops wont go up anymore Why is this ??
  18. Right after being helped Yesterday with Custom Forums http://phpboard.comze.com/index.php Theres my link atm Im trying to get on index saying Logged In : Username EG Logged In : Stotty Logout But $sql = "SELECT playername FROM km_users WHERE ID = '{$_GET['ID']}'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); print $row['playername']; Wont Work for some reason this is my index Layout <?php include "connect.php"; session_start(); ?> <center> <html> <head> <title>punMM</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> </html> <?php if (isset($_SESSION['player'])) { $playername=$_SESSION['player']; $getuser="SELECT * from km_users where playername='$playername'"; $getuser2=mysql_query($getuser) or die("Could not get user info"); $getuser3=mysql_fetch_array($getuser2); $thedate=date("U"); $checktime=$thedate-200; $uprecords="Update km_users set lasttime='$thedate' where ID='$getuser3[iD]'"; mysql_query($uprecords) or die("Could not update records"); if($getuser3[tsgone]<$checktime) { $updatetime="Update km_users set tsgone='$thedate', oldtime='$getuser3[tsgone]' where ID='$getuser3[iD]'"; mysql_query($updatetime) or die("Could not update time"); } print "<center><table class='maintable'><tr class='headline'><td colspan='2' width=75%>Forum name</td><td>Topics</td><td>Posts</td><td>Last Post</td></tr>"; $getforums="SELECT * from km_forums order by forumorder ASC"; $getforums2=mysql_query($getforums) or die("Could not get forums"); while($getforums3=mysql_fetch_array($getforums2)) { print "<tr class='mainrow'><td width=3%>"; if($getforums3['realtimelastpost']>$getuser3['oldtime']) { print "<img src='images/postforum.jpg' border='0'>"; } else { print "<img src='images/postforum.gif' border='0'>"; } print "</td><td><A href='forum.php?ID=$getforums3[forumID]'>$getforums3[forumname]</a><br>$getforums3[descrip]</td><td>$getforums3[numtopics]</td><td>$getforums3[numposts]</td><td>$getforums3[timelastpost]<br>by <b>$getforums3[lastposter]</b></td></tr>"; } print "</table>"; } else { print "<table class='maintable'>"; print "<tr class='headline'><td><center>Not logged in</center></td></tr>"; print "<tr class='mainrow'><td>You are not logged in, please <A href='login.php'>Login</a>"; print "</td></tr></table>"; } ?> PHP My Admin Layout CREATE TABLE `km_users` ( `ID` bigint(21) NOT NULL auto_increment, `status` int(11) NOT NULL default '0', `playername` varchar(15) NOT NULL default '', `password` varchar(255) NOT NULL default '', `email` varchar(255) NOT NULL default '', `validated` int(11) NOT NULL default '0', `validkey` varchar(255) NOT NULL default '', `tsgone` bigint(20) NOT NULL, `oldtime` bigint(20) NOT NULL default '0', `lasttime` bigint(20) NOT NULL default '0', PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; Thanks in Advanced Im Very Greatfull I was trying this all Night
×
×
  • 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.