Jump to content

Renlok

Members
  • Posts

    258
  • Joined

  • Last visited

Everything posted by Renlok

  1. urm now i chenged the spelling of unserialize(); so i now get no errors but it just comes up with $a_cookie[0] and $a_cookie[1] being nothing when you reach the page all that shows is: [quote] you are logged in as . this has not been made bare with us, or help us be sending us ideas at admin@welink.ej.am [/quote]
  2. thanks i tried but its come back with the error [i]'Fatal error: Call to undefined function unerialize() in /home/renlok/public_html/roe/members.php on line 10'[/i] the code it used is [code] <html> <head> <title>Members' Section</title> </head> <body> <?php if (!isset($_COOKIE['mysite_username'])) die("You are not logged in!"); $logcookie = unerialize($_COOKIE['mysite_username']); $mysite_username = $a_cookie[0]; echo "you are logged in as $mysite_username.<p>"; echo "this has not been made bare with us, or help us be sending us ideas at admin@welink.ej.am"; ?> </body> </html> [/code]
  3. thanks but once ive run the username and password though md5($username.$password); how can i gat the original enteries back out?
  4. ok my login page is sposed to set up two cookie but it only sets up one and ive no idea why. heres the login script if its any help. [code] <?php     include("includes/config.inc.php");     // connect to the mysql server     $link = mysql_connect($server, $db_user, $db_pass)     or die ("Could not connect to mysql because ".mysql_error());     // select the database     mysql_select_db($database)     or die ("Could not select database because ".mysql_error());     $match = "select id from a_users where nick = '".$_POST['nick']."'     and password = '".$_POST['password']."';";     $qry = mysql_query($match)     or die ("Could not match data because ".mysql_error());     $num_rows = mysql_num_rows($qry);     $username = $_POST['nick'];     if($num_rows <= 0){     echo "Sorry, there is no username $username with the specified password.<br>";     echo "<a href=login.php>Try again</a>";     exit;     } else {     setcookie("loggedin", "TRUE", time()+(3600 * 24));     setcookie("mysite_username", "$username");     echo "You are now logged in!<br>";     echo "Continue to the <a href=my_account.php>members</a> section.";     } $TPL_err=0; $TPL_errmsg=""; ?> [/code] its creates the 'mysite_username' cookie but not the 'loggedin' cookie.
  5. $confirm = $_POST['confirm']; is taken off the form, confirm is a checkbox $id = $_GET['id']; this is taken from the url this is the users id $id = $_POST['id']; then i added this because it wasnt updating i thought i may not have id for some reason the db connection in in the header and if you the code for the from here it is [code]         <FORM NAME=registration ACTION="confirm.php?action=activate" METHOD="POST">           <TABLE WIDTH="600" BORDER="0" CELLPADDING="5">             <TR>               <TD colspan="2" VALIGN="top" ALIGN="right"> <DIV align="left"><? print $std_font.$MSG_267; ?></DIV></TD>             </TR>             <TR>               <TD WIDTH="130">&nbsp;</TD>               <TD WIDTH="544">                 <? print $std_font.$MSG_368; ?>                 <BR> <input type="checkbox" name="confirm" value="checkbox">                 <? print $MSG_249; ?><br> <?php $id = $GET['id']; ?> <input type="hidden" name="id" value="<?php $id ?>">                 <BR> <INPUT TYPE=submit NAME=submit value='Activate Account'>               </TD>             </TR>             <TR>               <TD WIDTH="130">&nbsp;</TD>               <TD WIDTH="544"> <FONT FACE="Verdana,Helvetica,Arial" SIZE="2">&nbsp;                 </FONT> <BR> <INPUT type="hidden" name="id" value="<? echo $id; ?>">               </TD>             </TR>           </TABLE>         </FORM> [/code]
  6. ok ive made the most part of it work except for some reason it wont update the information cant figure out why heres the code: [code] include "header.php"; $confirm = $_POST['confirm']; $id = $_GET['id']; if($action == activate) {     if($confirm == checkbox) { $id = $_POST['id']; //-- User wants to confirm his/her registration $query = "UPDATE a_users SET suspended=0 where id='$id'"; $res = mysql_query($query); if(!$res) { $TPL_errmsg = $ERR_001; $TPL_err = 1; } include "templates/template_confirmed_php.html"; } else { echo 'You must confirm the activation before you can activate your account.<br>'; } } [/code]
  7. thanks the probleis solved i think it was mainly because i was trying to insert the wrong peice of information. ^^ lol thanks for your help.
  8. ok ive got a register form it it keeps returning with the error [b]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 3[/b] but i cant find any errors, can some one else help me out the code: [code] <? include "includes/messages.inc.php"; include "includes/config.inc.php"; include "includes/countries.inc.php"; //-- getSessionVars(); $auction_id = $sessionVars["CURRENT_ITEM"]; if (empty($action)) { $action="first"; } if ($REQUEST_METHOD=="POST" && $action=="first") { if ($TPL_surname && TPL_firstname && $TPL_nick && $TPL_password && $TPL_repeat_password && $TPL_email &&   $TPL_address && $TPL_city && $TPL_prov && $TPL_country && $TPL_zip && $TPL_phone) { // age check $nowday = date("d"); $nowmonth = date("m"); $nowyear = date("Y"); $thereday = $TPL_birthday; $theremonth = $TPL_birthday; $thereyear = $TPL_birthyear; $year = $thereyear - $nowyear; $month = ($nowmonth / 12) - ($theremonth / 12); $day =  ($nowday / 365) - ($thereday / 365); $age = $year - $month - $day; $age = $age * -1; if (strlen($TPL_nick)<6) { $TPL_err=1; $TPL_errmsg=$ERR_107; } else if (strlen ($TPL_password)<6) { $TPL_err=1; $TPL_errmsg=$ERR_108; } else if ($TPL_password!=$TPL_repeat_password) { $TPL_err=1; $TPL_errmsg=$ERR_109; }                 else if (!(ereg("^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-.]?[0-9a-zA-Z])*\\.[a-zA-Z]{2,3}$",$TPL_email)))          //Besserer mail check { $TPL_err=1; $TPL_errmsg=$ERR_110; } else if (strlen($TPL_zip)<4) //Primitive zip check { $TPL_err=1; $TPL_errmsg=$ERR_606; } else if (strlen($TPL_phone)<3) //Primitive phone check { $TPL_err=1; $TPL_errmsg=$ERR_607; } else if($age <= 18) { $TPL_err = 1; $TPL_errmsg = $ERR_113; } else { $sql="SELECT nick FROM ".$dbfix."_users WHERE nick=\"". AddSlashes ($TPL_nick)."\""; $res=mysql_query ($sql); if (mysql_num_rows($res)==0) { $id = uniqid(""); $id = eregi_replace("[a-f]","",$id); $TPL_id_hidden=$id; $TPL_nick_hidden=$TPL_nick; $TPL_password_hidden=$TPL_password; $TPL_firstname_hidden=$TPL_firstname; $TPL_surname_hidden=$TPL_surname; $TPL_email_hidden=$TPL_email; } else { $TPL_err=1; $TPL_errmsg=$ERR_111; // Selected user already exists } $sql="SELECT email FROM ".$dbfix."_users WHERE email=\"". AddSlashes ($TPL_email)."\"";                         $res=mysql_query ($sql);                         if (mysql_num_rows($res)==0)                         { $id = uniqid(""); $id = eregi_replace("[a-f]","",$id);                                                                $TPL_id_hidden=$id;                                 $TPL_nick_hidden=$TPL_nick;                                 $TPL_password_hidden=$TPL_password;                                 $TPL_firstname_hidden=$TPL_firstname; $TPL_surname_hidden=$TPL_surname;                                 $TPL_email_hidden=$TPL_email;                         }                         else                         {                                 $TPL_err=1;                                 $TPL_errmsg=$ERR_115; // Selected user already exists                         } if($TPL_err == 0) { $TPL_nick_hidden = addslashes($TPL_nick_hidden); $TPL_password_hidden = addslashes($TPL_password_hidden); $$TPL_firstname_hidden = addslashes($TPL_firstname_hidden); $$TPL_surname_hidden = addslashes($TPL_surname_hidden); $TPL_address = addslashes($TPL_address); $TPL_city = addslashes($TPL_city); $TPL_prov = addslashes($TPL_prov); $TPL_country = addslashes($TPL_country); $TPL_zip = addslashes($TPL_zip); $TPL_phone = addslashes($TPL_phone); $TPL_email_hidden = addslashes($TPL_email_hidden); $sql="INSERT INTO ".$dbfix."_users (id, nick, password, firstname, surname, address, city, prov, country, zip, phone, email, reg_date, rate_sum,  rate_num, birthdate)       VALUES ('$TPL_id_hidden', '$TPL_nick_hidden', '$TPL_password_hidden', '$TPL_firstname_hidden', '$TPL_surname_hidden', '$TPL_address', '$TPL_city', '$TPL_prov', '$TPL_country', '$TPL_zip', '$TPL_phone', '$TPL_email_hidden', NULL, 0,0,$DATE)"; $res=mysql_query ($sql); if ($res==0) { $TPL_err=1; $TPL_errmsg=mysql_error ();//"Error updating users data"; } else { //-- Get actual users and auctions counters $query = "select users from ".$dbfix."_counters"; $result_counters = mysql_query($query); if(!$result_counters){ $TPL_errmsg = $ERR_001; }else{ $users_counter = mysql_result($result_counters,0,"users") + 1; //-- Update counters table $query = "update ".$dbfix."_counters set users = $users_counter"; $result_update_counters = mysql_query($query); if(!$result_update_counters){ $TPL_errmsg = $ERR_001; } } // - bestätigungsmail verschicken $buffer = file("includes/usermail.inc.php"); $i = 0; $j = 0; while($i < count($buffer)) { if(!ereg("^#(.)*$",$buffer[$i])) { $skipped_buffer[$j] = $buffer[$i]; $j++; } $i++; } //--Reteve message $message = implode($skipped_buffer,""); //--Change TAGS with variables content $message = ereg_replace("<#c_id#>",addslashes($TPL_id_hidden),$message); $message = ereg_replace("<#c_name#>",addslashes($TPL_name_hidden),$message); $message = ereg_replace("<#c_nick#>",addslashes($TPL_nick_hidden),$message); $message = ereg_replace("<#c_address#>",addslashes($TPL_address),$message); $message = ereg_replace("<#c_city#>",addslashes($TPL_city),$message); $message = ereg_replace("<#c_prov#>",addslashes($TPL_prov),$message); $message = ereg_replace("<#c_zip#>",addslashes($TPL_zip),$message); $message = ereg_replace("<#c_country#>",addslashes($countries[$TPL_country]),$message); $message = ereg_replace("<#c_phone#>",addslashes($TPL_phone),$message); $message = ereg_replace("<#c_email#>",addslashes($TPL_email_hidden),$message); $message = ereg_replace("<#c_password#>",addslashes($TPL_password_hidden),$message); $message = ereg_replace("<#c_sitename#>",$SITE_NAME,$message);              $message = ereg_replace("<#c_siteurl#>",$SITE_URL,$message); $message = ereg_replace("<#c_adminemail#>",$adminEmail,$message);                    mail($TPL_email_hidden,"$MSG_098",$message,"From:$SITE_NAME <$adminEmail>\nReplyTo:$adminEmail"); } } // if($TPL_err == 0) } } else { $TPL_err=1; $TPL_errmsg="$ERR_112"; // Data missing } } include "header.php"; if (($REQUEST_METHOD=="GET" && $action=="first") || ($REQUEST_METHOD=="POST" && $action=="first" && $TPL_err)) { $country=""; while (list ($code, $name)=each ($countries)) { $country .="<option value=\"$code\""; if ($code==$TPL_country) { $country .= " selected"; } $country .=">$name</option>\n"; } include "templates/register_php3.html"; } if ($REQUEST_METHOD=="POST" && $action=="first" && !$TPL_err) { include "templates/registered_php3.html"; } include "footer.php"; $TPL_err=0; $TPL_errmsg=""; ?> [/code]
  9. Renlok

    tutorial

    lol yeah thats a bit ironic bth, i didnt check what i typed. okill give some explaination, and try fix the grammer but im not all that great at english but ill give a shot.
  10. Renlok

    tutorial

    well yeah i know what you mean the first i learnt with php was to echo  hello world well i though the same thing well thats crap, but thats only the begginning of the tutorial i will add more in time i have also spell checked it so all the speelings sould know be correct. i was planning on showing them something like how to create a simple database system where you can add things and retrive them with php showing them how to do this. as then like you said i would be more then super simple
  11. i wrote a tutorial wondering if its any good? [url=http://www.we-link.co.uk/forum/index.php?topic=32.0]http://www.we-link.co.uk/forum/index.php?topic=32.0[/url] any feedback on it? and i know its really simple but im going to make it more usful eventually, its just written to get people started
  12. ok heres the code for the registration form [code] <?php     include("config.php");     $user=$_POST['user'];     $pass=$_POST['pass'];     $email=$_POST['email'];     $vpass=$_POST['vpass'];     $ref=$_POST['ref'];     $nationality=$_POST['nationality']; if (!$user || !$pass || !$email || !$vpass || !$nationality ) { print "You must fill out all fields."; exit; } $query = "select * from players where user='$user'";          $sql = $db->query($query); $dupe1 = $sql->num_rows; if ($dupe1 > 0) { print "Someone already has that username."; exit; } $query = "select * from players where email='$email'";          $sql = $db->query($query); $dupe2 = $sql->num_rows; if ($dupe2 > 0) { print "Someone already has that email."; exit; } if ($pass != $vpass) { print "The passwords do not match."; exit; } $ip = "$HTTP_SERVER_VARS[REMOTE_ADDR]";         $query = "SELECT * FROM players WHERE ip= '$ip'";         $sql = $db->query($query);         $ipcheck = $sql->num_rows;   if ($ipcheck > 0) {   Print "You can only have 1 account per person.";        exit;         } $ref = strip_tags($ref); $user = strip_tags($user); $pass = strip_tags($pass); if ($ref) { $query = "update players set refs=refs+1 where id='$ref'";                    $sql = $db->query($query);             $query = "update players set refd='$ref' where user='$user'";             $sql = $db->query($query); } $msg="Thanks For Registering For World Sporting Game. This Email Contains Inportant Infomration About Your Account.<br><br> <b>Your Account Information</b><br> Username: <b>$user</b><br> Passowrd: <b>$pass</b><br> <br> Thanks For Registering From The Team Here At 'The Game'!";     mail($email,'World Sporting Game Registration',$msg,"From: Admin <admin@welink.ej.am>\n"."MIME-Version: 1.0\n".      "Content-type: text/html; charset=iso-8859-1"); $query = "insert into players (user,email,pass,country) values ('$user','$email','$pass','$nationality')";           $sql = $db->query($query);     if($sql < 0)     {     echo 'registration form is currently screwed please contact admin with your problem';     }     else     { echo "You are now registered to play, $user. Please <a href=index.php>login now</a>.";      } ?> [/code] and config.php is just the database connection which is [code] <?php mysql_connect("localhost","renlok_renlok","****"); mysql_select_db("renlok_game"); @ $db = mysql_db_connect("localhost","renlok_renlok","****","renlok_game"); if (mysql_connect_error()) {   echo 'Error: Could not connect to database. Please try again later.';   exit;   } ?> [/code] meh i cant find the error, plus when you run it, it will just show a blank page. the link to it is [url=http://www.we-link/game4]http://www.we-link/game4[/url]
  13. i know, i ment javascript
  14. thanks ill try that out. i tryed [code]   $fp = fopen("http://www.we-link.co.uk/sitemap.xml","a");   if(!$fp) {     echo 'Error: Cannot open file.';     exit;   }   $arr = file("http://www.we-link.co.uk/sitemap.xml");   fwrite($fp, "<url> <loc>".$url."</loc> <priority>0.5</priority> <changefreq>Weekly</changefreq> </url>", ( count($arr)-2 ));   fclose($fp); [/code] no luck any errors?
  15. what would be the code to add something into a flat file which will appear 1 line before the end but after the previous entry? if so whats the code to do this? what is mean by appearing one line before the end if you didnt understand: entry 1 new entry end tag thanks for any help.
  16. xbox 360 no question except there are alot of bugs with it.
  17. you cant use any php in a html page someones probly said this already but never mind.
  18. lol great question :P if the sites in java youll use java for that part the chat will need php and html coding, actuall all of the site will probly need html code.
  19. huh sorry i read that and it made no sense what so ever. could you explain it again, or maybe it obvious im just being stupid.
  20. yeah this can be done with javascript, you can use it to switch between stylesheets. it has nothing to do with php.
  21. it is a html problem if you print it like [code] $board_vars = array($board_id, $board_name, $board_description); [/code] its obviously going to come out in one line as theres nothing showing it has to print onto the next line.
  22. mines got to be phpEd. dont know why i just like it possible because its faster to load than dreamweaver and im just plain lazy =]]
  23. Renlok

    WeLink

    ok ive improved it still any feedback?
×
×
  • 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.