Formal Debugging, Why Do You Think It Doesn't Exist?
First of all, I feel that the debate between ASP and PHP is irrelevent, I think they are different enough that there is no comparrison or need for comparrison. However, what the article did bring up about debugging made me wonder why PHP doesn't have any. Why do you think the Zend Engine doesn't spit back more information for debugging?
I have never really found a need for more debugging options in PHP, good old "echo" and trial and error work for me, but I can imagine that it would be nice for those who are new to the language etc... Besides, would it take that much more time to include some kind of decent debugging? Just wanted to see what the community had to say about it.
View Complete Forum Thread with Replies
Related Forum Messages:
$GET Doesnt Exist
A while back, when I was using PHP4 with IIS, I had a problem getting my PHP scripting to pickup the post data via GET and POST. I solved it by going into the php.ini and setting register_globals to On. Now Im working on PHP 5 with Apache. I m having the same problem, my scripts are definetley not picking up the posted variables, like $GET and $POST dont exists no matter how many times I submit. I have gone to the php.ini and changed the register_globals value to ON but still nothing is happening, have I missed anything out?
View Replies !
If Page Doesnt Exist
I did the mistake of writing my whole website on one index page The problem is, each page uses if ($_GET['pg']==page){ #code } But if it is not a page, it doesn't execute anything. and the whole site is messed up. Is there anyway to make it so if $_GET['pg'] is not a valid page, then go to a 404 script?
View Replies !
Wrong Error Line That Doesnt Exist?
I got the wrong Parse error: parse error, unexpected $ in /web/www/frac/users/ultimadark/train.php on line 104. But i counted the rows three times and i have only got exactly 104 rows in the page, and the 104th row is only </html>. Why do i get that wrong message
View Replies !
Default Value Of Formal Arguments
<?php function callme($parameter1="DefaultValue") { echo"value of parameter1 is".$parameter1."<br />"; } callme("ValluedPassed"); callme(""); ?> As c++ ,I expected "DefaultValue" as output when I called callme(""); Why I am not getting that? my output is given bellow value of parameter1 is value of parameter1 isValluedPassed Hope your prompt replay.
View Replies !
Doesnt Iterate
I'm trying to do write a multiple update routine but its not looping , just runs once and stops. if ($REQUEST_METHOD=="POST") { if (isset($num)){ $i=0; while ($i<=$num){ ($result = mysql_query ("UPDATE data SET valid = '$valid' WHERE id = '$id' ")); $i++; } echo ("<P><center> Successfully validated<center></P> "); } } else {..... BTW, $num is valid and comes from data in other part of the script.
View Replies !
Db4 Dba_replace Doesnt Seem To Work For Me
I am trying to write to a dba and the result is creating a database file, but not writing anything to it. The relevant function is being called, and my variables are populated, but the database file remains empty. Am I writing the string arguments wrong, please ? function addplayer($realname,$pokername){ $dbh=dba_open("../pokeraliases","n","db4") or die ("Couldnt make the database"); dba_replace("$realname","$pokername",$dbh); dba_close($dbh); print ("PERFORMING ADD FUNCTION <br />"); print ("posted variables are $realname and $pokername <br /><br />"); } if ($addplayer=="add") { addplayer($name,$alias); }
View Replies !
Posix_setuid Doesnt Work
I've got problem with posix_setuid(). I've compiled php with --enable-posix. Everythin like posix_getpwuid() works fine except posix_setuid and posix_setgid. Configuration: php 4+mysql 4+apache 1.3.31. System - FreeBSD 5.3
View Replies !
Use A Session It Doesnt Display Anything
I have an index.php page that I have a login form on. I have another page (login.php) that checks to see if the username and password is valid from my database. The login.php redirects them back to the index.php page. Instead of the login form, i want it to say something like hello <username>. someone told me to use sessions but every time i try to use a session it doesnt display anything. I dotn know if the variable is beign carried over or if its even possible to be carried over to a different php page. I have the start_session() thing on top of each of the pages. I define the $_SESSION['user'] variable on the login.php page but when i get redirected back, it doesnt have a value and its not showing up.
View Replies !
Unlink Doesnt Work
i have this image "a.jpg" under directory "image/product/a.jpg". whenever i do unlink("image/product/a.jpg");. it says that permission denied... i dont know why i have done chmod("image/product/a.jpg",0777) before i do unlink. anyone know why?
View Replies !
Set Cookie In IE Doesnt Work In FF
i am facing problem in Firefox which is working fine in IE. This code doesnt set a Cookie in FF but it does in IE.. $id = $_POST['sendmobID']; $var = $_POST['vote']; setcookie ($id+1, $id, $time + 7776000); header("Location: specs_".$var."_".$id.""); so what could be wrong?
View Replies !
Info That Doesnt Print
I am querying a table and i dont want to print some information if the table doesnt contain any information. my code: $query="SELECT * FROM items WHERE name='john doe' $result=mysql_query($query); $row=mysql_fetch_array($result,MYSQL_BOTH); if($row{$k}!=""){ echo 'I should only be here if $row{$k} not empty' echo $row{$k}; } This will sometimes print even when $row{$k} contains nothing. The table value it is returning should be null or empty and therefore shouldnt print anything? Is it carriage returns or something? When I view the HTML source it will print a new line where the $row{$k} is at.
View Replies !
Data Doesnt Get Updated
I am working on a club software which will allow me to manage players and get a list of all the registerd players, i can add, get list of all of the players, but when i try to modify any one of them i cant .
View Replies !
Script Doesnt Work
if ($AB == 'On') { if ($line == 'Front Sideline') { $yc = 204; } if ($line == 'Back Sideline') { $yc = 85; } if ($line == 'Front Hash' || $line == 'Back Hash') { $yc = 206; } } For some reason,this part of my code is causing me problems. I know this,because I tested it over and over and figured out THIS is where the problem is coming from,and nowhere else. the script doesnt work The problem is this: IF: $AB is On and $line is Front Hash or Back Hash
View Replies !
Debugging PHP
My boss and I are fairly new to PHP and would love to hear suggestions on how to debug PHP with ease and efficiency. Thank you for your time and consideration.
View Replies !
PHP Debugging
I have been programming in php for few years but have never used anything but free hosting to run php. My programming requirements have evolved and now I am in need of a debugger to understand how code is functioning (so I want to be able to step through the lines of code, watch variable values and object contents etc.)Code:
View Replies !
Debugging In Php
What is the best way to debug in php? What is the best way to see the value of your variables? I'm coming from the Flash MX world, and in there, you can do a trace() and it traces out the value of your variables to the message window. PHP has print and echo but that seems to mess up the page layouts too much. Is there a way to print variables to a log file?
View Replies !
Debugging PHP In OS X
if there are any other mac users out there who have managed to get a debugger up and running in OS X. Im not finding any decent tutorials that let you use a stand alone debugger (i.e. not integrated with zend studio or komodo). I generally use textmate for editing and would like to find something i can use along with that.
View Replies !
Debugging
how to set the error handling in the ini file to E_ALL, E_ERROR, E_WARNING etc. We had everything setup and working then we had to restart the server and it for some reason, reset the ini file back to the way it was. SO we went back to the ini file and set it back up but now it does not work. We even set it to just E_ALL. And nothing. We just get a white page. Code:
View Replies !
Preg And Why [^word) Doesnt Work?
I was trying to write a script to replace some text inside some tags. Lets say I had <tag stuff=stuff><tag stuff=otherstuff><another> I wanted it to find all the <tag and remove them. So I tried to write it so that it would go forward until it reached [<^another] came. But when I tried that it would respond to another as single characters and not as the word. How can I do this with regular expressions, matching up against words using [^ ] ? I know I can do what Im trying to do other ways, but when it didnt work with [^ ], it got me thinking about how to do it that way. Because there might come other times when I want to 'NOT' against a word, and there has to be a way of doing this with Regular expressions?
View Replies !
Odbc_fetch_array Doesnt Return Any Values
My problem is odbc_fetch_array returns no value at all, but the scripts returns no error and all i can see in the page is the html table without any data in it.. the connection to oracle via odbc works, and in my other scripts i used odbc_fetch_row to retrieve data, but this one is kinda slow in getting massive amount of data from oracle. im now testing which is faster, odbc_fetch_row or odbc_fetch_array? but odbc_fetch_array returns no value at all. PHP Code:
View Replies !
Redirect Different Server Doesnt Work
i am having a problem with redirect. the page which works fine with my localhost, when copied to a different server doesnt work. the code is below: <? session_start(); if(!session_is_registered(myusername)){ header("location:template.php"); } ?> <html> <body> <?php header( 'Location: showrec.php' ) ; ?> </body> </html> when copied to a differnt server it stops redirecting the page and sits there.
View Replies !
Integer Doesnt Subtract Fully
I have a variable set at 10,800 and im trying to subtract it in my query like here: $Price = 10,800 in this example. Â Â Â Â Â Â Â Â Â $subtractMoney = "UPDATE userregistration SET MoneyInHand=MoneyInHand-'$Price' WHERE UserID='{$_SESSION['Current_User']}'"; $result = mysql_query($subtractMoney) or die(mysql_error()); if (mysql_affected_rows() == 0) { die('Error ID 0001A, contact admin on the forums immediately about this error!'); } But the subtraction is only going down by 10. Not 10,800.. although this 10,800 could be any value this was what i used for this example.
View Replies !
Email Validation Doesnt Work?
How come: if(!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+.[A-Z]{2,6}$", $email)){ echo 'Incorrect'; } doesnt work? Tried with things like "name", "name@name.com" and it comes back as valid?
View Replies !
Include A Function Doesnt Work
I have this big spaghetti code (my first real PHP project) file and I want to move my functions out of the big ass 12k php file. Well. I moved a function called "listprojects" to listprojects.php <?php function listprojects($conn) { . . . .function stuff } ?> . . . and in the main program I put the include statement . . . . include "listprojects.php"; but when I run the program in the browser nothing happens. The files are in the same directory by the way .
View Replies !
Cookies Doesnt Appear In Cookie List
hi, what's wrong in the next code? The cookies doesnt appear in cookie list, cookies are enabled for sure. if (blabal) { ... } else { $status = "ok"; $newdata2 = "1:5689741"; setcookie ('userdata', $newdata2, $time+604800);header("Location: login.php"); }; This piece of code appears above all html, and I run the script at the localhost at my own computer, there are other cookies set on localhost.
View Replies !
Php5 - Phpmyadmin Doesnt Work
I am useing apache 1.3.x (someing like that) and I Just Installed php 5. And Now phpmyadmin doesnt work. I was reading on php.net and mysql support doesnt com enabled in php 5. How Do I Enable this to allow php and mysql to work together in harmony and not problems.
View Replies !
Comparison Operators Doesnt Work
But here we go: My problem is that the comparison operators fail in some situations. I've got an input field where the visitors enter a number. I have limited the size of the number to 10 000 by doing the following: Code:
View Replies !
Help Debugging Query
I was wondering if anyone can help me here? The following code sends out an email alert to members of my site when a matching result is found....
View Replies !
Debugging Query
I can't for the life of me work out why I keep getting this error: ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username='billybob')' at line 76 PHP Code:
View Replies !
Installation Debugging
1)I get startup error messages: "Unable to load dynamic library c:phpphp_curl.dll - the specified file cannot be found" although the file is very much there at exactly that location Not only for this file but for many extension files like php_mysql.dll, php_oracle.dll, php_mssql.dll, php_exif.dll etc. 2)the extensions_dir setting is "c:php" without an ending backslash. 3)The php.ini file is residing at c:php 4)The php.ini file in c:windows has all extensions disabled so it does not look as though that php.ini file is the source of the messages 5)There is a extension entry for php_win32api.dll which also gives a not found error. Is it the older version of php_win32std.dll, php_win32service.dll and php_win32scheduler.dll files which are present but their names are not there by default in the php.ini ? ************************************************** ************************************************ 6)How do I debug PHP like you can debug Java in Eclipse or NetBeans and C/C++ in MS Visual Studio - with breakpoints and stepping? ************************************************** ************************************************ 7)database access through odbc works. 8)How do I install PHP as both a CGI extension under Apache 2.0.5x and as a module (php5apache2.dll with a LoadModule in httpd.conf) - Apd which is a part of PEAR requires that php be installed as a CGI binary - is apd good for interactive debugging?
View Replies !
Debugging In Komodo
Does anyone use Komodo from activestate to write their PHP? If so, have you used the debugger? I'm new to debugging with an actual debugger (I'm kinda old school and have always relied on echo and print...). When I'm running it, the debugger stops at EVERY SINGLE line of PHP code... I'm debugging a pretty long script and it just takes WAY too long. Is there a way to tell the debugger to just execute the code up to a certain point?
View Replies !
XOOPS Debugging
I am working with this XOOPS CMS and started having problems. Everything was working fine all pages, modules displayed, then it just went blank. Now I tried doing some trouble shooting following the advice on their site about what to do if I am ending up with blank pages. The thing is I cannot even get to the admin login page to set the debugging options from there. Anyway I changed the debugging options via the database and still no errors are being displayed.. just the blank page. I look at the error logs form the server and went through each module folder and looked to see if there was any error logs. 2 of the error logs state that that there was an unexpected $ in one the XOOPS common.php file and it pointed out the line number. I have looked there and see nothing and I know that the error does have to occoured there it's just where the script halted. My question is that the error could have orignated from any module.. How can I get some errors to show on screen so i ca do a trace. I here it could be possible via .htaccess.
View Replies !
Debugging PHP4 With Dbg, Gdb, And Ddd
I want to create a debugging environment for PHP. I running Debian Woody and installed PHP4 from Debian's packaging system. I downloaded precompiled DBG from the webside and placed dbg.so in the same directory as mysql.so, Since MySQL works under PHP, I'm assuming I've got the right directory. I've updated php.ini per the DBG website. phpinfo() reports: 1. --disable-debug was part of the ./configure command. 2. ZEND_DEBUG=disabled, but the report does indicate that dbg is part of the Zend engine setup. 3. In the section on dbg, it reports dbg version 2.11.23, linked as a shared library; profiler compiled,enabled; debugger.enabled=on; etc. If I want to debug with dbg and gdb, do I have any options other than to recompile PHP omitting the "--disable-debug" switch? Once I do (or don't do) that, how does one hook gdb into dbg? How do most PHP developers who don't own a commercial IDE debug their programs?
View Replies !
PHP Error Debugging
I have been working with PHP for a while, but never gone through getting a good debugger - or debugging methodology. Can someone send me links to suggestions and possibly good (free) software? I am not hosting the website, so I cannot tell it to report all errors directly from the installation. I tried error_reporting(E_ALL ^ E_NOTICE); on top of the page, but that does nothing. So it always takes a while for me to fix the errors.
View Replies !
Debugging My Functions
I wrote this code to validate a few fields on a form which will be submitted when a customer wants a refill of their prescription medication. The first problem is none of the functions actually work properly. Both of the functions that validate names should throw an error if a name has less than 2 characters inputted in the field. Yet, it doesn't throw any errors if I insert only one letter in the field. The next function should verify a phone number. I can put a phone number with 6 numbers in it and it won't throw an error even though it is to short based on my regular expressions requirements which says it needs 7 to 14. The last function doesn't throw an error if I put <a href="bob"> in the comment box and it should throw an error if it finds a <a> tag. Code:
View Replies !
Debugging Error
I'm getting this error message after submitting a form in PHP: Fatal error: Call to undefined function sql_errno() in /home/jplane/ certcent/phpweb/phpnuke/html/admin/modules/quiz.php on line 542 It's suppose to write information to some sql tables. I'd like to further debug this message, maybe in mysql?
View Replies !
Installation, Debugging
(I am posting from a web interface- google groups, yet the message is not appearing on the group, so am posting again, if you get two of the same kindly ignore one) 1)I get startup error messages: "cannot load c:phpphp_curl.dll - the specified file cannot be found" although the file is very much there at exactly that location Not only for this file but for many extension files like php_mysql.dll, php_oracle.dll, php_mssql.dll, php_exif.dll etc. Code:
View Replies !
Debugging Charset
We've been building a pretty big web app here for internal use. SMS text messages come in from an aggregator and are stored in a MySQL 4 db. Our operators then deal with them using a web interface. The db is queried using PHP4 and the results output as XML which is then transformed using XSLT into XHTML. Now, in our testing environment everything works just fine. However, when we try and run it with actual live data, any incoming SMS message that contains a non-ASCII character breaks the system at the Sablotron stage (invalid token). Now the aggregating service is sending us the incoming messages UTF-8 encoded. The XML and XSL is all set up to be UTF-8. However, somewhere along the lines something is getting screwed up so that Sablotron barfs (typical examples are pound signs or euro signs). I'm having a hard time debugging this because as far as I can tell everything is set to be using UTF-8 by default. Clearly something isn't (MySQL possibly). I'd really appreciate some pointers for things to check.
View Replies !
Debugging Advice
syntax highlighting what methods or programs do people on here use to debug their php? I'm using linux so foss programs that run on both win and linux.
View Replies !
Debugging Rapidly
is there any program which shows all variable assignments during the running of a php script. im getting sick and tired of using echo $myvar to debug.
View Replies !
Mysql Doesnt Return All Results Of A Query
I have an sql query like this: SELECT column FROM table WHERE column1="3" AND column2="1" This query works perfectly if i run it in the command line, to be exactly it return two results. But if i run it from php i just get the first of the two results. Any ideas? Mysql 4.1.8 php 5.0.3 I have a second problem. But its more of a question. if i run the foreach loop on an array like this array("id" => "78"), then it splits 78 up in 7 and 8. Now you say its stupid to use a foreach for this array. But in the function there i use it the array could also be two dimensional. Is this behavior normal? I looked in the php manual but found nothing.
View Replies !
Form Validate, But User Doesnt Have To Retype
currently i have a form, and when users click on the submit button, the contents get validated, and if there is a mistake, the user is brought back to the form page. What i want is to free the user from having to retype the sections that they got correct, and only retype the sections that are wrong. I am thinking of getting the form to send the content to my validation page, and back to itself $PHP_SELF so that if there is an error, the message will still display. Is this the correct way to do it? Code:
View Replies !
Using Fopen() To Create New File - Works For A Few Then Just Doesnt
I am currently working on a content management system where a user can fill in a form (title, keywords, link text etc. - all the initial attibutes), which when submitted, will go onto create a web page. The code is as follows: $html = "<html> <body> <p>Hello World</p> </body> <html>"; $handle = fopen($_SERVER['DOCUMENT_ROOT']."/path/to/folder/".$filename, "w"); fwrite($handle, $html); fclose($handle); Pretty basic, I think. I works for a few and then it just stops. I get no error to say that 'could not create file' or 'file not found', it just submits. Any reason for this? I have tried searching the C: drive for the file but it cannot be found. At the moment Im trying to figure out when it actually occurs but for some annoying reason, it seems to be working now. I would prefer to be assured that it wont occur again so just thought I would still post something here just encase this problem is a known one. Is fopen() the best solution for creating files? I was aware that it was used to open an existing file but create one (?). Is this what it was intended to do? Im sure it is, but its new to me.
View Replies !
Php Upload Doesnt POST Any Info In Firefox
I am not sure why but I have had this problem for a while and havent really been able to solve it. A really simple php upload script works in IE but not in FF. FF just comes back to the page as if there is no POST information. For example code below will output when landing on the page, it outputs: Code:
View Replies !
Changed To PHP5 Now Script Doesnt Work
I had a dynamic img creation with gdlib and Right Alignment. I 'pinched' this script which worked well until my host upgraded to php5. Any ideas. the following error messages are received. ‰PNG IHDR�2ý~Ê Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in /home/clearcon/public_html/fonts/title.php on line 40 Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in /home/clearcon/public_html/fonts/title.php on line 40 Code:
View Replies !
Preg_replace? AddSlashes Doesnt Seem To Work Properly
Im accepting user input from a text-box on a webpage. I am then wanting to echo that back into the same box when the page is submitted. The problem I have is that the input COULD contain multiple quotes and double-quotes. AddSlashes doesnt seem to work properly, as it turns ' into ' ....and " just into (removing everything after) I thought of using single-quotes for the Value='' and then use preg_replace to replace all occurances of ' with ' ...but I cant figure-out how to do it. Code:
View Replies !
Uploading Image Name Doesnt Get Rid Of The Space By Script
I use the below code to upload images: $target_path = "images/"; $target_path = $target_path . basename( $_FILES['Image1']['name']); $_FILES['Image1']['tmp_name']; $target_path = "images/"; $filename = basename( $_FILES['Image1']['name']); if (file_exists($target_path . $filename)) { $filename = time() . '_' . $filename; } $target_path .= $filename; if(move_uploaded_file($_FILES['Image1']['tmp_name'], $target_path)) { echo "Image1: was uploaded successfully!"; } else{ print "Image1: could NOT be uploaded!";} The above code renames the images too However, when a user uploads images which the name has spaces The code doesnt get rid of the space, and i get trouble displaying them later What part can i add to to the code to take space from the image name, then rename it.
View Replies !
|