Jump to content

curbsy

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by curbsy

  1. "./include/session.php"

    does it really have to be that? why can't I have 'http://www.rl6.org/~curbsy/include/session.php'?As I said before, it will always return as the error. Even if I'm logged in it says I'm not.
  2. index.php

    <?php$username = 'curbsy';$password = 'Removed';$hostname = 'localhost';$dbh = mysql_connect($hostname, $username, $password) or die('Unable to connect to MySQL');print 'Connected to MySQL<br><br>';$selected = mysql_select_db('curbsy',$dbh) or die('Could not select to selected database');$result = mysql_query( "SELECT * FROM people" )or die("SELECT Error: ".mysql_error());$num_rows = mysql_num_rows($result);print "There are $num_rows records.<P>";print "<table width=200 border=1>\n<tr><td><font face=arial size=1/>Edit Number:</font></td><td><font face=arial size=1/>First Name:</font></td><td><font face=arial size=1/>Last Name:</font></td><td><font face=arial size=1/>Age:</font></td></tr>";while ($get_info = mysql_fetch_row($result)){ print "<tr>\n";foreach ($get_info as $field) print "\t<td><font face=arial size=1/>$field</font></td>\n";print "</tr>\n";}print "</table>\n";mysql_close();?><html><head><title>People Database</title></head><body><br /><br />Edit The Database<form action='action.php' method='post'>Edit Number: <input type='text' name='num' /><br />First Name: <input type='text' name='fname' /><br />Last Name: <input type='text' name='lname' /><br />Age: <input type='text' name='age' /><br />Password <input type='password' name='pword' /><br /><input type='submit' value='Submit' /></form></body></html>
    action.php
    <?php// Variables$num = $_POST['num'];$fname = $_POST['fname'];$lname = $_POST['lname'];$age = $_POST['age'];$username = 'curbsy';$pass = $_POST['pword'];$hostname = 'localhost';$dbh = mysql_connect($hostname, $username, $pass) or die('Unable to connect to MySQL');print 'Connected to MySQL<br><br>';$selected = mysql_select_db('curbsy',$dbh) or die('Could not select to selected database');// Add Person To Database$result = mysql_query("UPDATE people SET fname = '$fname', lname = '$lname', age = '$age' WHERE num = '$num'");mysql_close();echo "<a href='http://www.rl6.org/~curbsy/db/index.php'>Back To Database</a>";?>
    Can anybody tell me why this doesn't update properly?
  3. Yes, the topic of the day is: Comments! I'm trying (but failing miserably) to set up a comment system on my website. Does anybody have experience with this?

  4. I did happen to get this fixed:<?php//Importinclude ("dbhndl.php");//Re-assign$name=$_POST['uname'];$pass=$_POST['pword'];$db="curbsy";$link = mysql_connect("localhost", "curbsy", "emerson");if (! $link)die("Couldn't connect to MySQL");mysql_select_db($db , $link)or die("Couldn't open $db: ".mysql_error());mysql_query ("INSERT INTO users (u_id, u_name, u_pswd, u_ses_id) VALUES (NULL, '$name', '$pass', NULL)");mysql_close($link);?>

  5. regproc.php:

    (01) <?php(02) //Import(03) include ("dbhndl.php");(04)(05) //Make user(06) mysql_query(INSERT INTO "users" (07) ("u_id", (08) "u_name", (09) "u_pswd", (10) "u_ses_id") (11) VALUES ("null", (12) "$_POST['uname']", (13) "$_POST['pword']", (14) "null"));(15)(16) echo "<meta http-equiv='refresh' content=1;URL=index.php>";(17) ?>

    Error: Parse error: parse error, unexpected T_STRING in /home/users/curbsy/public_html/login/regproc.php on line 6

×
×
  • Create New...