Jump to content

locutus84

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

locutus84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I\'ve started to build my own forum with some help of the membership system that phpfreaks have....however I have a problem with making a user level session to work. How should I do to make it work? Could somone please help me, I need it to work before friday because then I need to handover my forum to my theacher.... <?php session_start(); //check to make sure the session variable is registered if(session_is_registered(\'first_name\')){ //the session variable is registered, the user is allowed to see anything that follows } else{ //the session variable isn\'t registered, send them back to the login page header(\"Location: login_form.html\"); } if ($user_level= \"2\") { header(\"Location: forum.php\");} //the session variable is registered, the user is allowed to see anything that follows ?>
  2. thank you that helped alot
  3. Hey Im new here and hope someone would like to try to help me with this .... Yesterday I\'ve installed apache with php and mysql. When I try to execute a command like this below it doesn\'t execute it. Normally the line: The post have been registered! should come up on the screen but it doesn\'t. And the table don\'t get the data that it should have got from this. However this work on tripods database but not on my own server that I\'ve installed yesterday so the problem lies in my server and probably in mysql. Do anyone have any suggestion what it could be? Thx in advance.. <? $dbHost = \"localhost\"; $dbUser = \"*\"; $dbPass = \"*\"; $dbDatabase = \"forum\"; if(isset($posta)) { mysql_connect(\"$dbHost\", \"$dbUser\", \"$dbPass\") or die (\"Error connecting to database.\"); $datum=date(\"Y-m-d H:i:s\"); $query = \"INSERT INTO forum(amne,namn,epost,inlagg,datum) VALUES (\'$amne\',\'$namn\',\'$epost\',\'$inlagg\',\'$datum\')\" or die(\"jek\"); mysql_db_query($dbDatabase,$query); echo \"The post have been registered!\"; } else { ?> <html> <body> <form action=\"<?\"aaa.php\"?>\" method=\"POST\" name=\"formen\"> Ämne:<br> <input type=\"text\" name=\"amne\"><br> Namn:<br> <input type=\"text\" name=\"namn\"><br> Epost:<br> <input type=\"text\" name=\"epost\"><br> Inlägg:<br> <textarea name=\"inlagg\" rows=\"5\" cols=\"40\"></textarea><br> <input type=\"submit\" value=\"Skicka\" name=\"posta\"> <input type=\"reset\" value=\"Återställ\"> </form> <? } ?> </body> </html>
×
×
  • 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.