
chocopi
Members-
Posts
551 -
Joined
-
Last visited
Never
Everything posted by chocopi
-
wow thanks it worked. just out of intrest how did you learn all of this php ?
-
wow thanks, but it is saying there is an parse error in header(location: index.php);
-
yea thats the sort of problem i need help with, its meant to be taken from the same row as the activation code
-
thats what i thought. could you please try and sort this: <? require_once ('page_header.php'); require_once ('url.php'); $code = urlpart(); $query = "SELECT active FROM users WHERE code = '$code'"; $update = "UPDATE users SET active ='1' WHERE code = '$code'"; mysql_query($update) or die (mysql_error()); print ("<br /> \n"); print ("<center> \n"); print ("$username, your account is now active, please login on the homepage. \n"); print ("<br /> \n"); print ("<br /> \n"); print ("<a href=\"index.php\">Home Page</a> \n"); print ("</center> \n"); ?> url.php is where the code you gave me earlier and page_header.php is the database connection. so what this is meant to do is just update the active field from 0 to 1 using the code you gave me to get the activation code thanks, ~ Chocopi
-
is there any way i can set this urlpart(); to a variable ?
-
wow thanks it WORKS WHOOP. CHEERS could it do with the fact that im using lycos to host it ?
-
that gives me Array ( [mark?] => )
-
strange so when i click on 'cheers.php?mark' it gives me 'mark?' is there anything wrong with what i did
-
well i would like so it says 'hat' instead of 'hat?'
-
wow thanks it worked but a question mark appears after the test for example http://www.blah.com/poo.php?hat gives hat?
-
well i just tested it on a blank page, but its not showing anything :'(
-
Ok, So i was wondering if it would be possible to get a section of a url what i mean is: url = http://www.somesite.com/stuff.php?=blahblahblah is there anyway i could just get the 'blahblahblah' bit Thanks, ~ Chocopi
-
Thanks as im still a n00b with php would be possible if you could write something for me? if you can then the activation code would be $activation table would be 'users' and the coloum to update would be 'active' Many thanks, ~ Chocopi
-
i had the same problem as you, but i just left it as http://www.somesite.co.uk and it remained as link for me
-
yea but its not working. if you could, can you tell how i can get it to recognise that it is the user. the way i would like it to work is that the user clicks on the link root/activation/ it loads up the activation page and activaters their account
-
Thanks for your help. you wouldnt believe it but i forgot to add the page_header so it wasnt connecting to the database however, its still not working properly as it is not picking up the username variable or the the actual activation variable. i think it might be because i am just loading activation.php as i dont know how to get it to work when its activation/ please help, thanks ~ Chocopi
-
@Broniukas: im still getting the same error @eZe616: will that make a big difference
-
i get a query error from mysql_query($update) or die ("Error in query" . mysql_query()); so it just says "Error in query"
-
as i couldnt get yours to work i improvised with this: $activate = $_GET['activate']; $query = "SELECT active FROM users WHERE code = $activate"; if ($query == 0) { $update = "UPDATE users SET active =1 WHERE code = $activate"; mysql_query($update) or die ("Error in query" . mysql_query()); print ("<br /> \n"); print ("<center> \n"); print ("$username, your account is now active, please login on the homepage. \n"); print ("<br /> \n"); print ("<br /> \n"); print ("<a href=\"index.php\">Home Page</a> \n"); print ("</center> \n"); } But for some reason i keep getting an error. any help would be greatly appreciated. ~ Chocopi
-
Thanks for your help !!! but i cant seem to get the code to work, what should the link be. should it be root/activation.php or root/activation/
-
When my users register on my site they recieve an activation email. i was wondering, how do i make so there is a link in the email that when the user clicks it, it changes their active satus from 0 to 1. Many Thanks, ~ Chocopi
-
ok i was able to sort out and stop the fields from being erased. such a n00bish error. me => all i had to do was add $username and $email into the value of the input boxes. DOY. but that did mean that i had to put all of my html into the "print" tag, but oh welly. So if anyone could help me with the validation it would be greatly appreciated. Thanks, ~ Chocopi
-
another way you could do it is where the button become locked once the user has clicked on it. i dont know how to do this but i have seen it before somewhere else. so when the user submitted the form the button became locked and changed from submit to submitting...
-
Cheers, thanks mate One down two to go
-
Well i am just trying to create a basic registration form with some sort of validation. I'm not a complete n00b in coding, but I am new to php, so please bare with me. My form that I use has four fields: email, username, password, confirm password. I would like some validation on all of these fields. My first main problem is that the validation occurs when the form is loaded, so instantly an error comes up telling the user they have not filled in the field. My second problem is that i could not get an validation to work on the password or email. The third problem is that when the submit button is pressed all of the fields are wiped clean. So if anyone could help i would need validation for all of the fields, to only allow the validation to occur when the button is pressed and so that the fields arent wiped clean when the field is submitted. Here is the code: <? $title = 'Registration'; require_once ('page_header.php'); $email = $_POST['email']; $username = $_POST['username']; $password = md5($_POST['password']); ?> // HTML code here (I couldnt be bothered to put this here as it is irrelevant. <form name="login" method="post" action="<?php echo $PHP_SELF;?>"> <input type="submit" name="submit" value="Submit"> <? $checkuser = mysql_query("SELECT username FROM users WHERE username='$username'"); $username_exist = mysql_num_rows($checkuser); $checkemail = mysql_query("SELECT email FROM users WHERE email='$email'"); $email_exist = mysql_num_rows($checkemail); print("<font color=\"#ff0000\">\n"); if (strlen($username) < 4){ die ("Your username must be longer than four characters."); } else if ($username_exist > 0){ die ("I'm sorry but the username " . $_POST['username'] . " has already been taken. Please pick another one."); } else if ($email_exist > 0){ echo ("Your are only allowed one account per email."); exit(); } else if (!$_POST['email']){ echo ("Please fill out your email, so that your account can be activated."); exit(); } else { print("</font>\n"); ?> Please delete the validation as it is a jumble of what i have written and taken. The database is MySQL and the is table is 'users' which contains the field username, password and email. Thanks for your help ~ Chocopi