SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old February 6th, 2004, 09:45 AM
BrencelJ BrencelJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 BrencelJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP problems

I'm new vith this programing.

How do you solve this problem?
And if you need to see whole script please tell me.

Notice: Undefined variable: name in G:\htdocs\Game Page\obrazec.php on line 2
Your name is .

Reply With Quote
  #2  
Old February 6th, 2004, 09:48 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
perhaps a little bit of code relating to the problem would help?

Off the top of my head, make sure your variable names begin a dollar sign, ex $name

Reply With Quote
  #3  
Old February 6th, 2004, 10:48 AM
BrencelJ BrencelJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 BrencelJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is file that reads PHP file prom other file.

<html>
<head>
<title>PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Vnašanje podatkov</h1>
<form action="obrazec.php" method="post">
Write your name: <input name="name">
<input type="submit">
</form>
</body>
</html>



This is saved in a diferent File

<?
echo "Your name is $name.";
?>

Reply With Quote
  #4  
Old February 6th, 2004, 11:04 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
The problem is that your PHP is set up with register_globals off, which means that you can't just use $name to get the value of a form field. In this case, you'll have to use $_POST["name"]. So youre code would need to look like this:

PHP Code:
<?
echo "Your name is " $_POST["name"] . ".";
?>
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #5  
Old February 6th, 2004, 11:10 AM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Or it could be that you are trying to see value of an undefined constant or variable.

For example you must be trying :

if( $DO == NULL )

You must change it to :

if( !isset( $DO ))

OR

if( empty( $DO ))

Hope that helps..
__________________
ExoHelpDesk
ExoCrew Free Services

Reply With Quote
  #6  
Old February 6th, 2004, 11:47 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Note also that this error is just a notice, which means that it's not fatal. You can prevent the display of notices by changing the log level in your php.ini.

Reply With Quote
  #7  
Old February 6th, 2004, 11:49 AM
BrencelJ BrencelJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 BrencelJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Tnx it works ))

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP problems


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

SlickEdit




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway