Re: A few newbie questions
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: A few newbie questions

From: Justin Koivisto <justin@koivi.com>
Date: Fri Jul 22 2005 - 18:39:01 CEST

SOR wrote:

> Although i'm working on and about half way though building
> www.phpguestbook.co.uk i'm still a bit of a php newbie and theres lots
> of simple basic stuff I dont know .
>
> A few minutes of your time would save me ages on google .
>
> exit and exit() - is there a difference

http://us3.php.net/exit (see Example 2) "die" is also an alias for "exit"

> instead of include - how do I tell it to goto the new page like clicking
> on a link

header('Location: '.$url);
exit; // optional

> going back to exit - instead of exit and a complete php full stop &
> assuming its just a include file I want to break out of how do I do it

return

> strings - how do I strip carriage returns out of a string

$string=str_replace("\r",'',$string);

You could also use preg_replace if you are ok with using regular
expressions - especially if you want to take out newline ("\n")
characters or tab ("\t") characters as well.

> errors.txt - this gets save to whatever website folder i'm working on
> offline and as I dont want it I want to get rid of it or tell it to save
> the file somewhere else

This sounds like a web server feature if it isn't something that you
defined...

-- 
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
Received on Mon Oct 17 21:15:18 2005