473,598 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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 2902
Dormilich
8,658 Recognized Expert Moderator Expert
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
complearn
2 New Member
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 Recognized Expert Moderator Expert
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 Recognized Expert Expert
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
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
5488
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...
2
10624
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 line 7 Notice: Undefined variable: uploaded_type in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php on line 14 Notice: Undefined index: uploadedfile in /home/fhlinux169/c/
3
3863
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
5
7354
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 : $http_ref= $HTTP_REFERER; $prog = $_COOKIE;
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
3259
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
6723
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'...
2
4579
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 <b>E:\LightTPD\htdocs\go\go\form.php</b> on line <b>160</b> Here is the odd part. No matter what I do, no matter how many times I change the script, add lines, remove lines, the notice keeps referencing the same file and line number. Even when I comment out the line,...
0
7981
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
7894
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8284
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8392
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
8046
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
8262
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
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2410
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1245
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.