Jump to content

php error


pyke96

Recommended Posts

its a Notice, not an error. its also more than likely caused by trying to index an associative array without having quotes around that index. Pretty hard to tell without seeing any code though.

 

<?php

$pagetitle= "Wellbeing medical clinic-add new patient";

include ('./templates/header.php'); // note file path

?>

<div id= "bodycontent">

<?php

$_SESSION['firstname'] = $_POST['firstname'];

$_SESSION['lastname'] = $_POST['lastname'];

$_SESSION['username'] = $_POST['user'];

$_SESSION['password'] = $_POST['pass'];

$_SESSION['address'] = $_POST['address'];

$_SESSION['county'] = $_POST['county'];

$_SESSION['country'] = $_POST['country'];

 

This is the code that is problematic

Link to comment
https://forums.phpfreaks.com/topic/90716-php-error/#findComment-464995
Share on other sites

can we see form part

 

<form method = "post" action = "add_pat.php">

<fieldset>

<legend>Add Patients Details</legend>

<p>

          <label for="firstname" class ="fixed_required">First Name: </label>

          <input type="text" name="firstname" id="firstname" value ="<?php if(isset($_POST['firstname'])) echo $_POST['firstname']; ?>"/>

      </p>

<p>

          <label for="lastname" class ="fixed_required">Last Name: </label>

          <input type="text" name="lastname" id="lastname"  value ="<?php if(isset($_POST['lastname'])) echo $_POST['lastname']; ?>"/>

</p>

        <p>

          <label for="username" class ="fixed_required">User Name: </label>

          <input type="text" name="username" id="username"  value ="<?php if(isset($_POST['username'])) echo $_POST['username']; ?>"/>

</p>

      <p>

          <label for="password" class ="fixed_required">Password: </label>

          <input type="password" name="password" id="password"  value ="<?php if(isset($_POST['password'])) echo $_POST['password']; ?>"/>

</p>

        <p>

          <label for="address" class ="fixed_required">Address: </label>

          <input type="text" name="address" id="address" value ="<?php if(isset($_POST['address'])) echo $_POST['address']; ?>"/>

</p>

        <p>

          <label for="county" class ="fixed_required">County: </label>

          <input type="text" name="county" id="county" value ="<?php if(isset($_POST['county'])) echo $_POST['county']; ?>"/>

</p>

        <p>

          <label for="country" class ="fixed_required">Country: </label>

          <input type="text" name="country" id="country" value ="<?php if(isset($_POST['country'])) echo $_POST['country']; ?>"/>

</p>

 

<p class="submitbuttonarea" id = "submit">

          <input type="submit" name ="submit" value="Submit" />

</p>

 

</fieldset>

</form>

 

This is the form section of the code

Link to comment
https://forums.phpfreaks.com/topic/90716-php-error/#findComment-465003
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.