473,396 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Notice: Undefined index: rand in .....

Do you know why I got these errors for status_bar.php in some webhost, but work perfectly on other webhost?

Notice: Undefined index: re in /usr/home/daniel/domains/thehornyguy.com/public_html/criminalonline/status_bar.php on line 18

Notice: Undefined index: rand in /usr/home/daniel/domains/thehornyguy.com/public_html/criminalonline/status_bar.php on line 18
Whats wrong? here are the codes from line 18, our webhost is running php5.


Expand|Select|Wrap|Line Numbers
  1. $dmg = ($_GET['re'] == 0 || $_GET['re'] == '22') ? $_GET['rand'] : $_GET['diff']+$_GET['rand'];
Jan 5 '09 #1
4 2886
Dormilich
8,658 Expert Mod 8TB
it looks like neither "re" nor "rand" were defined in the URL, that's why it is always a good idea to check for their existance first:
Expand|Select|Wrap|Line Numbers
  1. // expand for all required vars
  2. if (isset($_GET['re'], $_GET['rand'])) 
  3. {
  4.     // code coming here
  5. }
Jan 5 '09 #2
what is " // code coming here" please? The full line is there, and I dont know php at all.. please show me the exact line to put back to the file.....
Jan 5 '09 #3
Dormilich
8,658 Expert Mod 8TB
the meaning of
Expand|Select|Wrap|Line Numbers
  1.  // code coming here
is as follows:
I don't have a clue*, what code you use on these values, thus replace "// code coming here" with your actual code.

(btw. // indicates a one line comment)

* it might be more than line 18.....

alternatively, you may abort the function if the requirement is not met:
Expand|Select|Wrap|Line Numbers
  1. if (!isset($_GET['re'], $_GET['rand']))
  2. {
  3.     // any default actions
  4.     return false;
  5. }
Jan 5 '09 #4
RedSon
5,000 Expert 4TB
If you don't know PHP why are you trying to program in it? Don't you think you would be better served by looking over a few tutorials first and trying to learn the language before you try something more advanced?
Jan 5 '09 #5

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

Similar topics

6
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...
3
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:...
2
by: Reggie | last post by:
am trying to create a a upload file.am uploading files ok but i recieve this message. Notice: Undefined variable: uploaded_size in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php on...
3
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...
5
by: Pseudonyme | last post by:
Dear All : Ever had an httpd error_log bigger than the httpd access log ? We are using Linux-Apache-Fedora-Httpd 2006 configuration. The PHP lines code that lead too tons of errors are : ...
1
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...
10
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...
11
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 ...
2
by: Smellydog | last post by:
I'm having a strange issue with PHP version 5.2.8 running on Windows Vista with Lighttpd. I receive a Notice that says the following: Notice</b>: Undefined index: name in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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,...

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.