473,623 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Notice: Undefined index:..

1 New Member
Hi all i am new here!
I take a look on forum but i don't found a the answer for my problem
ok this is my problem:


Notice: Undefined index: name in C:\wamp\www\reg ister.php on line 47

Notice: Undefined index: code in C:\wamp\www\reg ister.php on line 48

Notice: Undefined index: title in C:\wamp\www\reg ister.php on line 49

Notice: Undefined index: name in C:\wamp\www\reg ister.php on line 99
Expand|Select|Wrap|Line Numbers
  1. Line47:$user = $_GET['name'];
  2. Line48:$pass = $_GET['code'];
  3. Line49:$char = $_GET['title'];
  4. Line99:if ( $_GET['name'] <> "" )
  5. {
  6.  
  7.  if(file_exists("C:\\Documents and Settings\\User1\\Desktop\\Accounts\\$user.ini"))
  8.  {
  9.  
  10.     echo '<span style="font-weight: bold;">Account already in use!</span>';
  11.  }
  12.  else
  13.  {
  14.      $handle = fopen ( "C:\\Documents and Settings\\User1\\Desktop\\Accounts\\$user.ini", "a+" );
  15.     fwrite ( $handle, $data );
  16. fclose ( $handle );
  17.  
  18.     echo '<span style="font-weight: bold;">Account sccefuly created!</span>';
  19.     echo ' </br> <a href="javascript:history.back()">Back</a>';
  20.  
  21.     exit; 
  22.  
  23. a alittle mor from line 99 :P 
  24. Detail: I have this code in same page with form :|
  25.  Form: 
  26. <form action="register.php" method=GET enctype="multipart" >
  27.       <p><span style="font-weight: bold;">Username:</span><br>
  28.       <input type="Text" name="name" >
  29.       </p>
  30.  
  31.       <p><span style="font-weight: bold;">Password:</span><br>
  32.       <input type="password" name="code" ></p>
  33.  
  34.       <p><span style="font-weight: bold;">CharName:</span><br>
  35.       <input type="text" name="title" ></p>
  36.   <input type="Submit" name="" value="Register"></form>
May 16 '10 #1
3 5990
phobia
5 New Member
The notices are issued because you're trying to access indexes not currently set in the $_GET variable. Most likely because the form hasn't been submitted, so you should probably create a check for that, but one way to define a default value for the variables is by using ternary statements:
Expand|Select|Wrap|Line Numbers
  1. $user = (isset($_GET['user'])) ? $_GET['user'] : '';
Here the $user variable will be set to the contents of $_GET['user'] if that is set, otherwise to '' (blank).
May 16 '10 #2
manee1982
4 New Member
Hi , i have a same above proublem. but the proublem of mine it's giving me ablank page.
i hope u help me too
Jul 18 '10 #3
TheServant
1,168 Recognized Expert Top Contributor
@manee1982
When you say a blank page what do you mean? This one recorded some PHP errors, are you saying you have no errors, just a blank page? If so, how do you know your problem is the same? Did you try the solution?
Jul 19 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3007
by: sam | last post by:
HI, I installed php4 for apached and restart apache afterward. but my little php script generated error followint error: PHP Notice: Undefined index: myname in /usr/local/www/data-dist/www.authtec.com/php-test.php on line 2 I was trying to run the following php script in apache: <?php
1
2670
by: Hal Halloway | last post by:
How do I fix this error message below? Thanks. Notice: Undefined index: key_word in C:\Program Files\Apache Group\Apache2\htdocs\search010.php on line 55 .... if( $_GET ) { // line 55 // connect to the database
12
3803
by: bb nicole | last post by:
I have do a update profile for company where they can update after view their profile, but it cannot function... I need to submit the whole job portal soon, but still got many problem in my coding, could someone help me... Thanks a lot.. Below is the error: Notice: Undefined index: company_ID in C:\Apache2\Apache2\htdocs\comProfile_update.php on line 28 where line 28 is if(is_numeric($_GET)) { My whole coding as below: <?php ...
6
20845
by: jsgoodrich | last post by:
I am looking for some help if anyone can lend a hand. I have a simple php website that displays a table from my mysql database. To prep for my MCSE I moved my home server to Windows 2003 Standard, I installed mysql and php 5 to run some of my databases and websites. Under Linux the site worked fine, under windows I keep getting Notice Undefined Index error on line 67
3
5490
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice: Undefined index: FriendName in D:\Yan\Over_8\SendEmail.php on line 4, Notice: Undefined index: FriendEmail in D:\Yan\Over_8\SendEmail.php on line 5, Notice: Undefined index: Name in D:\Yan\Over_8\SendEmail.php on line 6, Notice: Undefined index: Email...
3
3865
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if (empty($info)) { $info='noinfo'; } changeinfo($info); Hey everyone, I keep getting an error regarding the above code. These are the errors: Notice: Undefined index: channels in /home/forcefed/public_html/index.php on line 5
1
2735
by: francsutherland | last post by:
Notice: Undefined index: send in D:\Domains\workingdata.co.uk\wwwroot\contact_text.php on line 7 Hi, I've started getting this error in the contact page form of my website. The web hosting company did an upgrade and it seems to coincide with that. The Notice is at the top of the page, but the rest of the page displays normally and form still works. I don't get the Notice when I test the page on the local Apache server in the XAMPP...
10
3260
by: FutureShock | last post by:
I have since recently turned up my error reporting on a production site to E_ALL to ensure I am using 'best practices' when writing out code. So far it has helped me discipline myself with initializing my variables. I am running into a problem with my $_POST array though. I am self-referencing a form page for processing, so at the beginning I am looking for the existence of certain $_POST variables for processing. I am setting an...
11
6725
by: stealthmode666 | last post by:
New to .php so need script help. I want to know how to stop this being displayed when I click submit. Notice: Undefined index: homeowner in E:\domains\r\...\user\htdocs\...\form.php on line 166 I have an array which takes filled in fields and blank fields and sends them via email. I DON'T need the user to fill in all the fields which is resulting in this notice on every field that is not filled in. I do need the fields to be sent tho'...
4
2903
by: complearn | last post by:
Do you know why I got these errors for status_bar.php in some webhost, but work perfectly on other webhost? Whats wrong? here are the codes from line 18, our webhost is running php5. $dmg = ($_GET == 0 || $_GET == '22') ? $_GET : $_GET+$_GET;
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.