Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2004, 12:26 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default i am learning

complete Newbie ....
need help on this

is it becos my php installation is not complete???
or the variable is not define???

complete blur look

Notice: Undefined variable: id in c:\inetpub\wwwroot\php\smart1.php on line 11
Notice: Undefined variable: PHP_SELF in c:\inetpub\wwwroot\php\smart1.php on line 33
Notice: Undefined variable: PHP_SELF in c:\inetpub\wwwroot\php\smart1.php on line 33
Notice: Undefined variable: PHP_SELF in c:\inetpub\wwwroot\php\smart1.php on line 33

i use the windows binaries installer from this webby..
http://www.php.net/downloads.php

pls help.
 
Old March 25th, 2004, 10:35 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

What is your code? This looks really weird....

----------
---Snib---
----------

<><
 
Old March 25th, 2004, 08:13 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i think i am having some installation problem...
pls help...

this is the webby that i got the php installer from http://www.php.net/downloads.php
i have install the installer instead of the zip file, which contains more features...
after uninstalling the installer version, i unzip the zip file and follow the instruction given from the install.txt file.

Now i am face with a problem of not being able to loadup any of the php files that i have created. not even the simpel helloworld.php...

do i need to change any other settings beside this 3???
doc_root = c:\inetpub\wwwroot // for IIS/PWS
browscap = c:\winnt\system32\inetsrv\browscap.ini
extension_dir = c:/php4/extensions/

i have unzip the file and put it in c:\php4
 
Old March 25th, 2004, 09:21 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Snib,

this is my code


<html>
<body>

<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);

if ($id) {
  // query the DB
  $sql = "SELECT * FROM employees WHERE id=$id";
  $result = mysql_query($sql);
  $myrow = mysql_fetch_array($result);

?>
  <form method="post" action="<?php echo $PHP_SELF?>">
  <input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
  First name:<input type="Text" name="first" value="<?php echo $myrow["first"] ?>"><br>
  Last name:<input type="Text" name="last" value="<?php echo $myrow["last"] ?>"><br>
  Address:<input type="Text" name="address" value="<?php echo $myrow["address"] ?>"><br>
  Position:<input type="Text" name="position" value="<?php echo $myrow["position"] ?>"><br>
  <input type="Submit" name="submit" value="Enter information">
  </form>

<?php
} else {
  // display list of employees
  $result = mysql_query("SELECT * FROM employees",$db);

  while ($myrow = mysql_fetch_array($result)) {
    printf("<a href=\"%s?id=%s\">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["first"], $myrow["last"]);
  }
}
?>

</body>
</html>
 
Old March 29th, 2004, 04:33 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Answer in your other (crosspost) thread:
  http://p2p.wrox.com/topic.asp?TOPIC_ID=11606

Please limit all further replies to that thread.


Take care,

Nik
http://www.bigaction.org/




Similar Threads
Thread Thread Starter Forum Replies Last Post
learning expectations Oreo BOOK Beginning Linux Programming, 3rd Edition 0 January 19th, 2007 08:01 PM
E-learning dineshv Flash (all versions) 1 January 4th, 2007 01:35 AM
Learning C# Jael C# 1 October 19th, 2005 07:54 PM
E-Learning dineshv Flash (all versions) 1 April 1st, 2005 03:12 PM
Help me In Learning PHP raman1 Beginning PHP 1 March 27th, 2005 10:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.