Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Session Function Debug Assist
    primarykey
    data
    text
    <p>I know how to include external PHP pages and how to start sessions etc, but I think there is something messed up with my logic on what I am working on. Hoping someone could take a look...</p> <p>I have an html page that is a form that pulls up a PHP view page with the info it sends to it. I wanted to put my function in an external page, along with using sessions, but I keep getting a syntax error.</p> <p>When I send my form it goes to the following:</p> <pre><code>&lt;?php session_start(); include 'functs.php'; if ($_POST &amp;&amp; !empty($_POST['name'])) { $_SESSION['name'] = $_POST['name']; $_SESSION['time'] = $_POST['time']; confirmed(); } else { print unconfirmed(); } ?&gt; </code></pre> <p>My external page with the functions is this:</p> <pre><code>&lt;?php function confirmed() { echo "&lt;head&gt;"; echo "&lt;title&gt;Confirmation Page&lt;/title&gt;"; echo '&lt;/head&gt;"; echo "&lt;body&gt;"; PRINT &lt;&lt;&lt;HERE if (isset($_SESSION['name'])) { echo 'Thank you, '.$_SESSION['name']. ' your reservation is confirmed for ' . $_SESSION['time'] ; } else { echo 'There seems to have been an error processing your reservation. Please ensure that you have cookies enabled and try your request again' ; } HERE; echo "&lt;/body&gt;&lt;/html&gt;"; ?&gt; </code></pre> <p>The error I am getting is Parse error: syntax error, unexpected 'name' (T_STRING), expecting ',' or ';' in E:\Program Files\xampp\htdocs\cis\w2\functs.php on line 10. If I insert the function internally, it works, so I know its something with how I am formatting the include page.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload