Jump to content

mdre83

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

About mdre83

  • Birthday 01/14/1983

Profile Information

  • Gender
    Male
  • Location
    UK

mdre83's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I originally posted within the Javascript section and was told it was JQuery. I've also just received a warning PM for double posting. Come on guys, I'm just looking for some help here.
  2. Hi, Within the following link http://www.ncl-coll.ac.uk/course-information.aspx?courseid=12099#nowhere you can see that the course details have an expandable/collapse ability (accordion affect?). I want to incorporate this this function onto a website of mine however, not sure what scripting is being used, can anyone help? Cheers, Martin
  3. Hi Richard (madtechie) Been a little busy since my last post. ok so, the sign up process scripts and now working, many thanks for that This may seem like a stupid question (I'm a novice in PHP) The memonly script, should this be added to the html of those pages that are only to be viewed by registered members? Will this prompt them with the login box? :-\
  4. Couldn't resist doing a quick test before I dash out... Scripts seem to be working spot on now mate Much appreciated, your skills are second to none! I will report back later regarding my next step in the process as mentioned above
  5. HAHA, Cheers mate. Unfortunately I have to dash out, will test the scripts a little later and report back. Many thanks for your help so far, really appreciate it. My next step would be to only to have members sign up for access to part of the site. Speak soon
  6. I now receive... 'Cannot sleect DB' Which appears to be coming from signup-ac.php. I've included the code for this below <? include('config.php'); // table name $tbl_name=websmart_tempmembersdb; // Random confirmation code $confirm_code=md5(uniqid(rand())); // values sent from form $name=$_POST['name']; $email=$_POST['email']; $country=$_POST['country']; // Insert data into database $sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')"; $result=mysql_query($sql); // if suceesfully inserted data into database, send confirmation link to email if($result){ // ---------------- SEND MAIL FORM ---------------- // send e-mail to ... $to=$email; // Your subject $subject="Websmartin confirmation link here"; // From $header="from: Websmartin.co.uk"; // Your message $message="Your Comfirmation link \r\n"; $message.="Click on the below link to activate your account \r\n";<br> $message.="http://www.websmartin.co.uk/confirmation.php?passkey=$confirm_code";<br><br> $message.="Kinds regards,"<br> $message.="Websmartin" // send email $sentmail = mail($to,$subject,$message,$header); } // if not found else { echo "Not found your email in our database"; } // if your email succesfully sent if($sentmail){ echo "Your Confirmation link Has Been Sent To Your Email Address<br>Please close this window."; } else { echo "Cannot send Confirmation link to your e-mail address"; } ?>
  7. This is the other 'tutorial' I used... http://www.phpeasystep.com/mysql/2.html
  8. sorry forgot to paste in link. This is where I got the codes from http://www.phpeasystep.com/phptu/6.html the temp DB holds those that are not yet activated, then once the activation link is clicked it transfers the data to the registered members DB :S When I have this issue fixed I would then need to use a sign-in script but to then allow registered users to my site. This will be another stumbling block for me. I really appreciated all your help in this. Maybe I should give up on PHP already This is my first real attempt at it.
  9. This is where I got the codes from however, I made slight adjustments to my code regarding table names and text.
  10. I created two DBs 1. websmart_tempmembersdb which contains the table also named websmart_tempmembersdb 2. websmart_registeredmembers which also contain a table named websmart_registeredmembers As I say I'm a complete novice in this... as you can see
  11. I now receive the following message... (**** replaces email address and password) #1: #2: INSERT INTO websmart_registeredmembers(name, email, password, country)VALUES('martinAndrews', '****', '****', 'UK')Table 'websmart_tempmembersdb.websmart_registeredmembers' doesn't exist SQL injection... ?
  12. MadTechie, Thanks for the reply. Form what I can see, the DBs are setup correctly. The websmart_registeredmembers table does exist under a separate DB to the temp members one. I'm new to all this, so I may be missing something very simple. I've included the code again below and ill remove the above images <? include('config.php'); // table name $tbl_name=websmart_tempmembersdb; // Random confirmation code $confirm_code=md5(uniqid(rand())); // values sent from form $name=$_POST['name']; $email=$_POST['email']; $country=$_POST['country']; // Insert data into database $sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')"; $result=mysql_query($sql); // if suceesfully inserted data into database, send confirmation link to email if($result){ // ---------------- SEND MAIL FORM ---------------- // send e-mail to ... $to=$email; // Your subject $subject="Websmartin confirmation link here"; // From $header="from: Websmartin.co.uk"; // Your message $message="Your Comfirmation link \r\n"; $message.="Click on the below link to activate your account \r\n";<br> $message.="http://www.websmartin.co.uk/confirmation.php?passkey=$confirm_code";<br><br> $message.="Kinds regards,"<br> $message.="Websmartin" // send email $sentmail = mail($to,$subject,$message,$header); } // if not found else { echo "Not found your email in our database"; } // if your email succesfully sent if($sentmail){ echo "Your Confirmation link Has Been Sent To Your Email Address<br>Please close this window."; } else { echo "Cannot send Confirmation link to your e-mail address"; } ?> <? include('config.php'); // Passkey that got from link $passkey=$_GET['passkey']; $tbl_name1="websmart_tempmembersdb"; // Retrieve data from table where row that match this passkey $sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'"; $result1=mysql_query($sql1); // If successfully queried if($result1){ // Count how many row has this passkey $count=mysql_num_rows($result1); // if found this passkey in our database, retrieve data from table "websmart_tempmembersdb" if($count==1){ $rows=mysql_fetch_array($result1); $name=$rows['name']; $email=$rows['email']; $password=$rows['password']; $country=$rows['country']; $tbl_name2="websmart_registeredmembers"; // Insert data that retrieves from "websmart_tempmembersdb" into table "websmart_registeredmembers" $sql2="INSERT INTO $tbl_name2(name, email, password, country)VALUES('$name', '$email', '$password', '$country')"; $result2=mysql_query($sql2); } // if not found passkey, display message "Wrong Confirmation code" else { echo "Wrong Confirmation code"; } // if successfully moved data from table "websmart_tempmembersdb" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db" if($result2){ echo "Your account has been activated"; // Delete information of this user from table "websmart_tempmembersdb" that has this passkey $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'"; $result3=mysql_query($sql3); } } ?> <? $host="localhost"; // Host name $username="*****"; // Mysql username $password="****"; // Mysql password $db_name="websmart_tempmembersdb"; // Database name //Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); ?>
  13. Hi, I have one slight problem, I'm setting up a sign_up process. The confirmation email is received fine however, when clicking the link to activate the account, all I receive is a blank screen. I cannot see where I may have gone wrong. It's resolution is probably looking straight at me. I've checked that the passkey appears in the temp members DB, which is fine. Do you have any ideas what could be going wrong? Here are the scripts... signup_ac.php Confirmation.php config.php Any help is appreciated. Cheers, Martin
×
×
  • 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.