Jump to content

ash992

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by ash992

  1. Yep, If i remove the header so it stays on that page, and try to echo $_SESSION['CNAME'] Then it works fine, but if i try to echo it on the file that it re-directs to then there is no output. :s Thank-you for the help and the fast reply,
  2. Hey guys, Before I say my problem I'de just like to say that I'm new to PHP So there's a good chance it's a simple mistake. On my index there's a form with a text input that takes someones organisations name, there's also a select in the same form, this form redirects to a PHP file that decides what page you will be redirected to, depending on what you chose in the select box, The organisation name is set on the main page through the text input, and the session is set on the form's action, but when it re-directs to the new header the session is not working. $Companyname = $_POST['Companyname']; $_SESSION['CNAME'] = $_POST['Companyname']; That's the pieces of code that should set it, after that it redirects to the header sucsessfully, but when i try to echo the session variable, or even add it to a normal variable to echo it, It doesn't work. Additional information includes, I have started the session on the Index, and again on the form's action file, and again on the header of that file, so the session is started on all of them. Anyone got any Ideas? I really don't know what's wrong with it really.. Thank's in advanced everyone.
  3. Where should I be putting $end = 1? or are you just saying that it needs a variable somewhere in the else tag?
  4. Hey guys, I've got a problem and I'm really not sure what's causing it.. I've only just finished learning PHP so it could be something simple but I can't seem to find what's wrong with it.. Thanks in advance if ($pass == $pass2) { $okay = 1 }else{ die "the passwords do not match"; } The error I'm getting is.. Line 12 is, }else{ So... If anyone could please help, What have i done wrong? :s Thanks guys
  5. Well... Not a clue how I missed that, thank-you good sir! It's working fine.
  6. Hey guys, before I start I'm new to php and mysql, so apologies if I was just being silly. mysql_query("CREATE TABLE users( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), Emailadress VARCHAR(30), Companyname VARCHAR(30), Password VARCHAR(30), RegisteredIP INT, LastvisitedIP INT, test12 INT, test INT,)") or die(mysql_error()); There's more put I didn't paste it all, The error I'm getting is, 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 10 Line ten is, Companyname VARCHAR(30), that line. Can anyone help? :s Thanks in advance.
×
×
  • 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.