Jump to content

can_i_say

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

can_i_say's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I can't get my data to insert using PDO if the data contains a question mark character. It works if I strip them out, but this is a far from ideal soloution. Any suggestions? Thanks.
  2. Hi, I'm new to sessions and keep getting "Warning: session_start() [function.session-start]:" Any help would be great. <?php require_once('webpage.class.php'); require_once('myPHPfunctions.php'); $page = new webpage("New Student Entry Form", array("test.css", "main.css")); echo $page->getPage(); session_start(); if (!isset($_SESSION['firstname'])) { if(isset($_POST['email'])){ $email = $_POST['email']; $password = $_POST['password']; //connect $db = mysql_connect('localhost','root',''); mysql_select_db("internetcase"); $sql = "SELECT users.firstname, users.email, users.firstname, password.password FROM users, password WHERE users.email = '".$email."' AND password.password = '".$password."' AND password.user_id = users.user_id LIMIT 1"; $queryresult = mysql_query($sql) or die("Query error: ". mysql_error()); if (mysql_num_rows($queryresult) == 1){ $_SESSION['name'] = mysql_result($queryresult,0,"firstname"); $_SESSION['email'] = mysql_result($queryresult,0,"email"); echo "You are logged in"; } } else { header("Location: index.php"); } } else{ $firstname = $_SESSION['firstname']; echo "Welcome back, $name!"; } echo $page->footer(); ?>
×
×
  • 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.