mrdee
Jan 25 2008, 01:52 AM
Hi, when running a PHP script I keep getting the error: QUOTE Notice: Undefined variable: bret in c:\program files\easyphp1-8\home\poll.php on line 294
Notice: Undefined variable: bret in c:\program files\easyphp1-8\home\poll.php on line 294 (And, yes, I get it twice). The code related to the variable is as follows: CODE function LogString($string,$type) { $t_log = "\n"; $t_log .= $this->globaldata->server_vars['REMOTE_ADDR']."|"; $t_log .= date("Y-m-d h:i:s A|"); $t_log .= "$type| "; $string = str_replace("\n","\\n",$string); $t_log .= $string;
if($this->is_enabled) { $bret = $this->writeToFile($t_log); }
$this->whole_log .= $t_log; return $bret; } I must stress that I did not write this code myself, but a program called 'Simfatic Forms' which I am Beta testing. Can anyone spot where the mistake might be? Thanks for any help I might get.
Reply
truefusion
Jan 25 2008, 12:07 PM
I'm assuming $this->is_enabled is returning false. Since it's returning false, the bret variable will not be set. My only suggestion is to make the if statement have an else: CODE if($this->is_enabled){ $bret = $this->writeToFile($t_log); } else { $bret = FALSE; } And the only reason i can think of why the error appears twice is because the function LogString is be-ing called twice. I say all of this bearing ignorance of the rest of the script.
Reply
DarAngel
Feb 8 2008, 11:51 AM
Yes as what the truefusion said I think that the script is reporting a notice that the String is null you can set the error reporting to: CODE error_reporting(E_ALL ^ E_NOTICE); (add near the beginning of the script) This way you can continue to have the empty sting but you won't be told about it, I think that Notices shouldn't effect the functionality of your scripts. (I have notices turned off by default in my local PHP server environment) With the code the truefusion posted you can also clear the notice (I believe.) It all depends on your preference.
Reply
dave2win
Apr 8 2008, 05:25 AM
This is for Dar Angel If the guy mrdee is Beta testing some thing then he should not turn Error Reporting off. This will keep the errors hidden and the program will come out as a faulty program. Beta Tersting should be always be done with Error Reporting settings changed to all. And for your problem (@mrdee) The function is returning $bret without checking it's existance. Just do a check if it's set or not using. Try & use this code:::: CODE if(isset($bret)) { return $bret; } indtead of CODE return $bret; I think it error is being given twice because the function is being called twice by some other func. This is all that i could think of. Dave
Reply
Similar Topics
Keywords : script, required, undefined, variable
- Vb Variable Help
help with variable (1)
Phpizabi Social Network Script
(0) Hello everyone not been on for AGES! we had net problems and i had to move to qupis and now
I've got problems. I'm making a social networking site using this script and I cant get it
to install Everytime I go to the install page i get this QUOTE Warning: session_start() :
open_basedir restriction in effect. File(/home/kasiks1/tmp) is not within the allowed path(s):
(/home/karlos:/usr/lib/php:/usr/local/lib/php:/tmp) in
/home/karlos/public_html/phpazi/install/index.php on line 1 Fatal error: session_start() : Failed
to initialize storage module: file....
How To Make A View New Post Script?
(5) Ok so i'm still working on the forum software i posted about a while back, but I have no idea
how to do this. I want to make a view new post script, as this is one of the main things that my
forum software dose not have that all other forums have. so does any body have an idea on how i
would do this? Thanks.....
Guessing Php Script
(0) I am looking for: freeware php quess the person in the photo game script....
Webmail Server Script
(2) Hi Guys! A friend of mine came to me asking me to help him write code for his server so that
his clients can go on his site and create a webmail account. I told him I'm not a programmer but
I googled the subject. I ran into SquirrelMail and was impressed with what it could do. Going
through the documentation I saw this QUOTE There are only two requirements for SquirrelMail:
A web server with PHP installed. PHP needs to be at least 4.1.0. Access to an IMAP server which
supports IMAP 4 rev 1. I have php5 running on my XPproSP3 but I don't know....
Secure FTP information and assistance required
thanks for helping (1) how do i set up sftp on trap17 or do i just need to set it up in my transfer software. Im sorry for
asking this, but it kinda confuses me. so far i have ftp: ftp host: ftp.apolopedia.com username:
jjaenagle@apolopedia.com password: ******** ----------------------------------------------------
when i did it in filezilla as sftp, it gave me some kind of warning... the server's host key is
not cached in the registry. and then fingerprint and a bunch of stuff. trust? I canceled and came
here to ask. now do i need to go into cpanel and set up an ftp? ------------....
Changing Root Script
(0) I decided to go with paid hosting with computinghost.com. When I chose my initial installation, in
my ignorance, I didn't know you couldn't install both the Joomla installation and the
Soholaunch website builder, so I checked both. They installed the Joomla and not the Soho. Since I
have never looked at Joomla and know nothing about using it, I would like the other installation. I
first tried live chat, but they said contact sales. So I sent an email and got a ticket number.
BPM-881376 When I try to check on the status I get this message: Fatal error: ERROR: You ....
Linux Anti-virus Software
is it required? (6) Just installed Linux Ubuntu on a partition with Wireless access to the Internet and have a question
about the need for an Ani-virus software. Is it suggested to have it installed? and which one is
recommended by the Trap17 users? Ubuntu 8.04 installed via Wubi, if that matters. Both the LAN
hard-wire connection and the Wireless Adapter work, if that matters.......
Wysiwyg Jscript Editor
I need a good Java Script Editor (3) Can any of you guys give me a good Java Script Editor. I really need one badly. I make Java Script
goodies as an addon for my web site but it really takes a lot of my time to type all those similar
code blocks over & over again, Could any one please provide me such an editor as Microsoft Visual
Basic or Visual C++. I mean the IDE shold have similar features. ****Above all it should be a free
one**** Thanks in adv. Dave....
Need Help Installing Dolphin Community Script!
(5) I'm not sure if this is the right place to post this but I really need help in installing the
dolphin community script. I have absolutely no previous experience of scripts or programming. I
would really appreciate if someone could walk me through it step-by-step, or even do it for me by
logging into my cpanel. I have tried to install it my self but I'm a little confused. I'm
sure it won't take very long at all for someone who has done this before.....
Gimp Abstract Signature Tutorial
Brushes required (9) In this tutorial I will be showing you how to make a abstract signature in GIMP. I have a lot of
images for this so bear with the loading time. First, you need to make a new image. I think
400x100px is a good signature size. I used these settings. You should have a blank white canvas.
We will start out our sig by brushing up a quick background. I came out with this: Next, we will
make a new layer. We will do more brushing on this layer. I used these settings: Start brushing
with a different brush set. I ended up with this: Select your first brushed layer, th....
Loaing Script
(3) hello, I'm looking for a preloader script for my site. like it will display an loading
image while the site is loading and the once the page has loaded the image will disapear. i tryed
searching for one on google but i could not find one, i think i searched for the worng thing. if
some one knows how to make one or where i can find one that would be great. Thanks....
Invite Script..
(2) I didn't know where else to put it /sad.gif" style="vertical-align:middle" emoid=":("
border="0" alt="sad.gif" /> If moderators find another forum more suitable plz move this one
/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> I am looking
for some sort of sript or program that let's people on your website invite friends. Like they
put in their Emailadress and mails are send to everyone in their list.. I hope someone can help me
/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Greetzz....
Html Code Tester. Online Script
(15) Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
Current script: CODE <?php //Save this as something like htmltest.php function
CheckForm() { $html_unsafe=$_POST['code']; //Gives us our user
input $html_safe=str_replace("<?php"," ",$html_unsafe);
//Starts security measures $html_safe=str_replace("?>","
",$html_sa....
Jsp Or Java Chat Script Like Mig33
(4) so most of you guys know mig33. its a wap application,probaly java.most kindly to be java. does
anyone have java knowlege or knows where i can get a chat script like mig33? i also know this server
supports jsp so im planing to use it for my application. i was hosted here last year but moved
because i found a better host. now im back just to use the jsp on this server. Im planing to run
chat applictions so if any one wants to help me in my project let me know.....
Users Online
Looking for the best counter script (9) Hi people, I am wondering If do you know a good "users online" I know many remote hosted services
for this but I am looking for a counter script to install in my own website, If possible a counter
that displays my visitors information , like country or an image(flag) links where they come from
etc. something like this: Webpage I would SO appreciate any help! because I want to give to
my site a more professional and international look /cool.gif" style="vertical-align:middle"
emoid="B)" border="0" alt="cool.gif" /> ....
Javascript : No Right Click Script !@
This script will allow you to protect your source coad ! (12) This script will help you to protect your source code Add this to Section of your site
! HTML <script language=JavaScript> var message="Function Disabled!";
/////////////////////////////////// function clickIE4(){ if
(event.button==2){ alert(message); return false; } } function
clickNS4(e){ if
(document.layers||document.getElementById&&!document.all){ if
(e.which==2||e.which==3){ alert(message); return false; } } }
if (docume....
Free Myspace Script?!?
I didn't know that was possible . . . . (3) I was looking for scripts to put on my website one day, and it turned up this!
http://www.phpizabi.net/ It's a free open-source script, and it has most of the qualities of
myspace.com! And best of all, you can mend it the way you want! I might use it, but on one
of my subdomains . . . . My friend already tried it out, he said it works fine! His website is
under construction right now, but I'll give you the link to it when he's done . . .....
Make $10 Money Instantly Or Free Domain Of Your Choice!
Credit Card Required - I will pay via PayPal personally (17) Ok, first of all, this is a NO B.S. offer. This is how it works: Once you PM me, I will pay you
$5 USD upfront via PayPal. Along with the money, I will send you a referral link. You will
have to visit the site that the referral link points to and complete ONE offer. I RECOMMEND the
TICKLE offer which costs $5 - that's why I'm paying you the $5. If you are
uncomfortable with Tickle, you can choose Blockbuster, Netflix and other trusted companies! You
will need a credit card to signup with tickle and complete the offer. Once you complete the....
Free Hyip Script?
Where can I get a free Hyip script? (15) Hello. Do someone know where can I get a free hyip script?....
Watermark Your Image With Simple Php Script
found it on the net (34) This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
Scripts site. Just in case the site may not show, I will include the code here: List of things
needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
transparent gif image with the watermark - goes in the same directory as this script // ....
Parse: Error Unexpected T_lnumber
php parse error when running script (4) Hi. I've just created a php script. The main object of the script is to delete some old files
and replace it with a new file with some new content, effectively moving the contents from one file
to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) {
$a_B++; } $new_page_contents = " " . $_POST . " " . $_POST . "
include \"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen(&....
Guestbook (cgi-script) Problems
Do u know much bout chmod and cgi-cripts? (1) Hi! I'd like to make a guestbook with a cgi-script I found at Lissa Explains it All .
There were instruction bout how to install this gbook: click here QUOTE Active Guestbook
Unzip the file, you'll find 4 separate files: guestbook.cgi mail.gif url.gif readme.txt 1.
Open guestbook.cgi in a plain text editor like notepad. Find out your path to perl from your Web
host, and change the first line to reflect that. The default setting, #!/usr/bin/perl, usually
works for most servers. If not, you can try #!/usr/local/bin/perl. Save your changes. ....
[help] Java Script: Window.open
Works with Firefox, not IE (8) CODE <HEAD> var popUpWin=0; function popUpWindow(URLStr) {
if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); }
popUpWin = open(URLStr, 'GunBound Tactics: Screenshots',
'width=820,height=550,menubar=no,resizable=yes,scrollbars=yes,toolbar=no,top=90,left=90')
;; } </HEAD> <BODY> <a
href="javascript:popUpWindow('/f11/clipped.php');"><b>Clips&
#60;/b></a> This is a script for opening a new window. It works ....
Script: Php Jukebox
A one file script! (4) This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder
called 'songs' and put some audio files in it. Here is the whole page, I named it index.php
and put it in a folder called 'music': CODE <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head>
<title>PHP jukebox</title> </head> <body> <!-- ©2005 Craig
lloyd. All rights reserved. Visit cragllo.com for more sc....
Free Weather Feed Script
(1) If you are tired of providing your clients with weather feeds that take visitors off of their site
or slam their site with ads, I finally found one after searching for hours.
Here's a link to a
FREE php script that pulls the feed directly from any airport in the world to your site. It is easy
to customize and has simple, well documented installation instructions.
http://www.mattsscripts.co.uk/mweather.htm
hope you find it helpful... a good one for designers
to archive as you will most likely need it some day for a client.
Check out Matt's other free
scripts....
Toggle display in page script
(8) This is my very first script, before I knew what was out there. It works in IE 5 and up. Not sure
about netscape or mozilla. (I recently d/led mozilla and it's great for javascripts. Much less
typing.)
CODE <script language="javascript"> <!-- function
toggle(what){ if(document.all[what].style.display ==
"none"){ document.all[what].style.display = "block";
}else{ document.all[what].style.display = "none"; } }
//--> </sc....
Php Quiz Script
Make quizzes for your site. (20) Hello all, A little bit back I decided to make a quiz scriptjust out of no where lol. However it
doesnt do anything special but I am going to make an email mod for it so that it will email results
to your email address. So here is the basis of it. INSTRUCTIONS: Open a new page in your text
editor and paste in the following code. CODE <?php $qid = "Quiz ID-00"; ?>
<html> <head> <title><? echo "Gamers Pub $qid";
?></title> </head> <body> <p><h3><? echo "....
Java Script Drop Down Menu With Css
- a full code for a dynamic drop down (2) Introduction This is a code that I use to dynamically create the drop down menus. First, you have
to edit the following code and put it in your Javascript. Notice : /*** SET BUTTON'S FOLDER HERE
***/. Edit that to your folder. Also, the /*** SET BUTTONS' FILENAMES HERE ***/. This creates a
mouseover when the drop down is activated. Put all your onmouseover images under: oversources = new
array; and your onmouseout images under : upsources. Be sure to set your on and out images above
each other. CODE /*** SET BUTTON'S FOLDER HERE ***/ var buttonFold....
Could Someone Make A Php Script For Me?
Script to manage clans and players (3) Does someone know a script where you can 1. Add clans to a roster 2. Edit clans on a roster 3. Add
players too a clan 4. Edit players 5. Schedule matches 6. Add clan Leaders to manage their own clan
+ members 7. Add members to edit their own information And maybe some sort of scoreboard integrated
where you can put Wins, Draws and loses and that automaticly puts best clans on the top? If there
isnt such a script could someone create 1 for me? (its for a league ^^)....
Looking for script, required, undefined, variable
|
|
Searching Video's for script, required, undefined, variable
|
advertisement
|
|