Search found 11 matches

by bobaloo
Fri Feb 28, 2003 12:58 pm
Forum: PHP General
Topic: Dynamic sites - title change
Replies: 4
Views: 1633

like a random title? you could use something like:

<?
$title[1] = "Title one";
$title[2] = "Title two";
$title[3] = "Title three";
$random = mt_rand(1,3);

echo "<title>$title[$random]</title>";
?>
:D
by bobaloo
Fri Feb 28, 2003 12:51 pm
Forum: PHP Scripts
Topic: limit a string to a certain number of characters
Replies: 2
Views: 1909

limit a string to a certain number of characters

this is a function i wrote to do this, because apparently php doesn't have one built-in. <? function limit_string ($string, $limit){ echo substr($string, 0, (strlen($string)*($limit/strlen($string))));} //this: limit_string("12345",3); //displays "123" // this: limit_string("12345",6); //displays "1...
by bobaloo
Wed Feb 05, 2003 9:39 am
Forum: PHP coding => General
Topic: how do i get a users ip address?
Replies: 3
Views: 1412

or you could put:

<?PHP
$ip_addy = $_SERVER['REMOTE_ADDR'];
echo $ip_addy;
?>
by bobaloo
Tue Feb 04, 2003 9:16 pm
Forum: PHP General
Topic: php and searches?!?
Replies: 3
Views: 1719

I made a non-database PHP search engine for my site (that works quite nicely) with the wonderful get_meta_tags() function, and a while loop. But, I'm not gonna post it, sorry.
by bobaloo
Mon Feb 03, 2003 11:37 pm
Forum: PHP General
Topic: While loops crash PHP locally
Replies: 10
Views: 3239

I don't even think it's my computer. I've tried it on my home computer (HP/Celeron/Windows ME) and my work computer (Pre-merger Compaq/Pentium 4/Windows 2000) with the same result.
by bobaloo
Sun Feb 02, 2003 12:20 pm
Forum: PHP General
Topic: While loops crash PHP locally
Replies: 10
Views: 3239

There is no error. It works just fine online. The problem is that it crashes PHP on my computer when I run it offline. And it's not just this one page...it's anytime I use a while loop in any page....
by bobaloo
Sun Feb 02, 2003 2:48 am
Forum: PHP General
Topic: While loops crash PHP locally
Replies: 10
Views: 3239

Huh?
by bobaloo
Sat Feb 01, 2003 10:59 pm
Forum: PHP General
Topic: how do you print a webpage without popping up the printerbox
Replies: 5
Views: 2250

Well, if something like that is possible, I would think it'd be client-side, not server-side, so PHP wouldn't be the answer. Perhaps try a JavaScript forum? Out of curiosity, why would you not want someone to print something more than once? And besides, even if you WERE able to do what you want to d...
by bobaloo
Sat Feb 01, 2003 5:19 pm
Forum: PHP General
Topic: how do you print a webpage without popping up the printerbox
Replies: 5
Views: 2250

I simply wouldn't use a website that had something like that on it. No one in their right mind would. There's a reason that box pops up...so people can choose THEIR OWN SETTINGS! Very user-unfriendly :wink:
by bobaloo
Sat Feb 01, 2003 5:16 pm
Forum: PHP General
Topic: While loops crash PHP locally
Replies: 10
Views: 3239

Oh, come now.

I'm not that dumb. It actually adjusts itself based on the number of files I have in a particular directory, and, as it stands, the loop only goes around six times. Anyone else?
by bobaloo
Sat Feb 01, 2003 11:37 am
Forum: PHP General
Topic: While loops crash PHP locally
Replies: 10
Views: 3239

While loops crash PHP locally

When I execute a script with a while loop in it locally, it causes a 500 Internal Server Error and crashes php4ts.dll. I am running Apache on WinME (::shudders:: I know)...is there some way of correcting this? Thanks...