Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

49 users online



Tutorial/Guide: Error and basic debugging

Tutorial/Guide: Error and basic debugging

Currently viewing this thread: 1 (0 members and 1 guests)


Thread closed

Page 1 out of 2
Jeb

Jeb

Status: Offline!

Tutorial/Guide: Errors and basic debugging

http://home.iprimus.com.au/jeb99/debugging.html

First tut I've written on PHP. It doesn't go into the indepth stuff, but it does explain how to avoid infinite ****ing loops, parse errors, index errors, the or die() syntax, trigger_error(), error types, etc.

Might be a bit tricky to understand....*shrug* No it doesn't go into output buffering, you want to learn that: [[ link ]]

___________________

Adam Goossens -- PHP is my mother tounge.

Linux: ( kernel.org | winehq ) -- f33l the p0w3r.

Nobody replying to your questions? Getting flamed? Getting told to RTFM? Ask your questions the right way.

Last edited by Jeb, September 28th, 2002 11:16 AM (Edited 1 times)

CDude

CDude

nothing
Status: Offline!

Too long :confused:

Goodjob however Grin

Did you talk about the if else statements structure??

PHP:

<?php

if($this){
// is very annoying
}
else
{
// to read
}

?>

Also, if you get an error, look on the line ABOVE to see if you're missing any semi colons. If you are getting parse errors on the LAST line when you KNOW there are no errors on that line, it's a loop error, you are probably missing some brackets.

One thing I do is read my code in english.

PHP:

<?php

'/[^(\[.+)\])][\s]((http:\/\/)|(www\.))([[:alnum:]]+)([\S]+)[^(\[.+\].+)]/si',

?>

who'd understand that?? So i just read to myself. "Find something that starts with any character, or a space, has either http:// or www in the beginning then some alphanumeric characters plus any non-return line characters to avoid an "Enter", plus something. Do all this without worrying about the case of the text (/si)"

By reading things, you'll find your error better.

Like this one in the other thread

PHP:

<?php

$open_directory 
= @opendir($af_gallery);
    while(
$r=readdir($open_directory)) {
      if(
$r != "." && $r != "..") {
        
$col "2";
        print 
"<tr>";
        for(
$x=0$x $col$x++) {
            print 
"<td><img src=\"".$af_images_url."/folder.gif\"><a href=\"".$af_url."animeFolio.php?dir=".$unique."\">".$unique."</a></td>";
        }
        print 
"</tr>";
      }
    }

?>

You get a printout TWICE, your suspect is a loop. I spy with my little eyes, TWO loops, bam, answer right there.
::bandit::

___________________

http://celerondude.com

CDude

CDude

nothing
Status: Offline!

man, my hands feel STICKY!!

___________________

http://celerondude.com

ikellen

ikellen

dude
Status: Offline!

God job Jeb, now we won't get posts like "Help me, I've got a parse error on line ?? and I can't figure it out!!!"

Smile

___________________

http://www.kellenholt.com/images/eg_sig.gif
:: KellenHolt.com
:: KellenHolt.com Forums - No Frills Discussion
:: Need Small Hosting Plan? CLICK

Jeb

Jeb

Status: Offline!
Quote:

Originally posted by CDude
Too long :confused:

I know, I thought it was a bit long myself. But, oh well. Maybe I'll condense it when dreamweaver stops being a biznitch.

___________________

Adam Goossens -- PHP is my mother tounge.

Linux: ( kernel.org | winehq ) -- f33l the p0w3r.

Nobody replying to your questions? Getting flamed? Getting told to RTFM? Ask your questions the right way.

torrent

torrent

Status: Offline!

Very good Wink

___________________

Torrent
Ski-Info-Online.com
The complete ski and snowboarding information site

bryan

bryan

Neversidian
Status: Offline!
Quote:

Originally posted by CDude
man, my hands feel STICKY!!

Why's that? Grin

___________________

Mugging Scotty Good.
www.muggingscotty.com

CDude

CDude

nothing
Status: Offline!

i touched sticky stuff!!

___________________

http://celerondude.com

wesm22

wesm22

Status: Offline!

i don't know where i should post this question but here it goes I am following the tutorial on Robuks PHP login/registering tutorial and I do what the instructions says but i get this error message on the register.php

You have an error in your SQL syntax near 'VALUES ('', 'wes', md5('theman')' at line 1

I am fairly new to PHP and MySQL so i might not have entered the correct expressions in the script.

erod

erod

uh yea
Status: Offline!

did u create the table correctlly?

___________________

I code alot.

Page 1 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0196 seconds.