• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Reply to: php sessions

Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "php sessions"

Collapse

  • Sysman
    replied
    Stick it in a function so that you get a result back?

    Leave a comment:


  • xoggoth
    started a topic php sessions

    php sessions

    Cobble together a little bit of php occasionally but don't really understand the basics, like sessions.

    There's a freeware captha script that you can add to an HTML form:

    <img src="CaptchaSecurityImages.php?width=100&height=40 &characters=5" /><br />
    <input id="security_code" name="security_code" type="text" /><br />
    <input type="submit" name="submit" value="Submit" />

    The CaptchaSecurityImages.php PHP is:

    <?php
    session_start();
    blah blah
    $_SESSION['security_code'] = $code;
    blah blah
    session_write_close();
    ?>

    That works fine from a normal HTML form, but I want to use it in a form that is itself generated by php:
    <?php include 'header.php'; ?>
    <?php
    etc

    Removed the session start and close above and put session_start at beginning of php but can't access $_SESSION['security_code'] in the rest of the code.

    Any ideas, cheers.
Working...
X