Jump to content

jameson9

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jameson9's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hm, not sure I follow you Lumio. That would only be good for "bob"'s redirect, but not the other two. Also, these people will already be logged into the site, so do I need to include all the connect to db statements in my php script?
  2. So it's just not possible in CSS?
  3. Hi Does anyone know of a CSS way of playing a .wav or other soundfile when a button is clicked or mouseovered?
  4. Thanks Lumio, well that kinda works, insofar as a page is displayed but it is only the else statement that is calling the page. The first two don't get called when their username and password are entered, so it is always the same person's page loading. Should it have to connect to the db to verify the username password combo? I personally don't see why, as I thought I was just telling it to pull one of three pages linked to one of three user/pswd combos.
  5. Hey guys, Does anyone know how to redirect a user to a specific page based on a login? Essentially, there are only 3 separate pages involved, ie bob, sue and mary's. When they enter their username and password I want them to be redirected to the appropriate corresponding page. This is the code I have below, but I am getting a parse error on line 11 (which is just a curly bracket -if the syntax was wrong i would have thought the parse error would be earlier on in the script). Any suggestions? <?PHP if (!isset($username['bob']) || !isset($password['bob'])) { header( "Location: http://www.somesite.com/bob.html" ); } elseif (!isset($username['sue']) || !isset($password['sue'])) { header( "Location: http://www.somesite.com/sue.html" ); } else (!isset($username['mary']) || !isset($password['mary'])) { header( "Location: http://www.somesite.com/ciara.html" ); } ?>
  6. Hi, newbie here so I will try and explain as best I can. I have a successful login and session created using PHP and MYSQL and now I would like to have the username appear at the top of the screen after successful login, and possibly, though not necessarily , throughout the entire user session until logout. Any suggestions as to the easiest, lightest weight and newbie friendly code to use? Thanks.
  7. Cool, Yeah i used $row = mysql_fetch_row($result); and it worked. Thanks!
  8. Hello, Could someone please help me? I want to get the UserID (UID) from the users table and then put it together with a CourseID (CID) into a table called enrollment. I know it's wrong (because it is not working), and I think there may be an array involved, but could someone correct my syntax for me? This is what I have so far: $ID = mysql_query("SELECT UID FROM users WHERE username=$username"); mysql_query("INSERT INTO enrollment (UID, CID) VALUES('$row','$course')");
  9. Ok, thanks for the advice guys. I knew it looked a bit stupid when I set up the table but seemed like a good idea at the time!
  10. Thanks guys, I appreciate it! Boo_lolly, yours works perfectly. Just wondering about the CONTENT=\"0; what does the 0 refer to? You see, I have divided up the registration page into 2 pages. I would like the user id created by mysql for the preceding page to be put into a field on the 2nd page. The user id is autoincremented by mysql. Is there a simple (I am such a newbie, be gentle ) way of making the user id from page 1 into a variable which can be inserted into page 2's table when page 2 is posted?
  11. Hello, I have a php script that works fairly well so far, taking data from a form and inserting into the mysql db. At present I have it set up so that it echoes a thank you message once submitted: if(isset($_POST['Submit'])) { echo "Thank you for registering!\n"; } However, instead of a blank page with just the echo message, I would like the user to be directed to another page on the site. I have tried various combinations of <ahref= ...all to no avail. Every php tutorial site covers how to submit a form etc but none seem to tell you what to do after that. I don't want the user left in dead air. How do I get the php script to automatically forward them to a link within the site once the form has been submitted?
  12. Hey guys, I am new here and new to both PHP and MYSQL so please bear with me. I have a table in my db set up for a quiz and answers and want to compare the parsed query string against the answers in the table, then total them. The table has a field for the quiz id# and then 20 separate fields each containing an integer between 1-4 corresponding to the correct answer on the multiple choice quiz. I want to assign a value of 5 for each field so that the sum total = 100. When a query string is passed, I want to compare the string against the answers in the table, and whichever ones are equal to the values in the table, total them up to get a percentage score. Any ideas as to how to do this as simply as possible? Am I going the wrong way about it altogether?
×
×
  • 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.