WebmasterLingo
JustEdge Dedicated Servers

Go Back   WebmasterLingo > Programming Corner
User Name
Password

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old June 30th, 2009, 05:34 AM   #1
maahi
Registered User
 
Join Date: Jun 2009
Posts: 3
maahi is on a distinguished road
Send a message via AIM to maahi
php

please be nice as m new to php jus startd learnin d lang maself..
i came acrooss this prob..
wen i try runnin this

welcome
<?php
echo $_POST["fname"];
?> !<br />

you are<?php

echo $_POST["age"];
?>
years old...


it gives me an errorr:
welcome !
you are years old... PHP Notice: Undefined index: fname in C:\inetpub\wwwroot\formm.php on line 4 PHP Stack trace: PHP 1. {main}() C:\inetpub\wwwroot\formm.php:0 PHP Notice: Undefined index: age in C:\inetpub\wwwroot\formm.php on line 9 PHP Stack trace: PHP 1. {main}() C:\inetpub\wwwroot\formm.php:0
n it says undefined inde fname n age

so please temme d bug n i have created an html file too wid d same name
<html>
<body>
<form action="welcome.php" method="post">
name: <input type="text" name="fname" />
age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
ot went wrong?

Last edited by maahi : June 30th, 2009 at 05:36 AM.
maahi is offline   Reply With Quote
Old July 1st, 2009, 01:41 AM   #2
maahi
Registered User
 
Join Date: Jun 2009
Posts: 3
maahi is on a distinguished road
Send a message via AIM to maahi
Question

please indly temme d diff btwn dez two programs:

<?php
include("wrongfile.php");
echo "hello world!!!!";
?>

and
using require instead of include!

both are generating the same error as follows;

PHP Warning: require(wrong.php) [function.require]: failed to open stream: No such file or directory in C:\inetpub\wwwroot\req.php on line 3 PHP Stack trace: PHP 1. {main}() C:\inetpub\wwwroot\req.php:0 PHP Fatal error: require() [function.require]: Failed opening required 'wrong.php' (include_path='.;C:\php5\pear') in C:\inetpub\wwwroot\req.php on line 3 PHP Stack trace: PHP 1. {main}() C:\inetpub\wwwroot\req.php:0

An error occured in the script being debugged:
require() [<a href='function.require'>function.require</a>]: Failed opening required 'wrong.php' (include_path='.;C:\php5\pear')

and for include error was:



An error occured in the script being debugged:
include(wrongfile.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

maahi is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 03:02 PM.

JustEdge Dedicated Servers