Search found 73 matches

by mike
Sat Sep 18, 2004 10:33 am
Forum: mySQL & php coding
Topic: Creating Database dynamically
Replies: 6
Views: 1343

You can use the function: mysql_create_db(). Eg: <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } if (mysql_create_db('my_db')) { echo "Database cr...
by mike
Tue Sep 14, 2004 1:30 am
Forum: PHP General
Topic: Refresh a page in continuous mode ...
Replies: 19
Views: 5836

Perfect :)
by mike
Sun Sep 12, 2004 6:36 am
Forum: PHP General
Topic: Refresh a page in continuous mode ...
Replies: 19
Views: 5836

Hmm easy :-D put the following java thing into the page containing the "form" for posting messages. Assume that your frame or iframe is named as "msgbox" and its html source is "msgbox.php" eg: <iframe name="msgbox" src="msgbox.php" width="110" height="150" noresize frameBorder=0> So every time a me...
by mike
Fri Sep 10, 2004 1:52 pm
Forum: PHP General
Topic: Refresh a page in continuous mode ...
Replies: 19
Views: 5836

There are much more you should also do for your chat... think what will happen if someone will post a 100-character-long word like this:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

The table/frame will be streched out! You can make a small function cutting down long words
by mike
Fri Sep 10, 2004 12:13 am
Forum: PHP General
Topic: Refresh a page in continuous mode ...
Replies: 19
Views: 5836

Hmmm I forgot to write down this trick <body leftmargin="0" topmargin="0" onload=window.scrollTo(0,99999);> And also, if you want the newer messages shown from bottom to the top use something like this: $messages = file("data.txt"); $messages = array_rev...
by mike
Thu Sep 09, 2004 3:06 pm
Forum: PHP General
Topic: Refresh a page in continuous mode ...
Replies: 19
Views: 5836

An easy way of creating a Chat script is by using a file to store the 10 or 20 last messages in, and reading it on an iframe every 4" using the META Refresh function. The page stays static and the iframe keeps refreshing with new posts
by mike
Thu Sep 09, 2004 2:49 am
Forum: PHP coding => General
Topic: getting checkboxes checked
Replies: 0
Views: 702

Code: Select all

<input type="checkbox" name="checkbox" value="checkbox" <?if($RESULT['Field1']){echo"checked";}?>>


where $RESULT is the fetched array of your mysql query
by mike
Thu Sep 09, 2004 2:42 am
Forum: PHP General
Topic: any source?
Replies: 2
Views: 1003

by mike
Wed Sep 08, 2004 2:06 pm
Forum: PHP coding => General
Topic: data streaming
Replies: 4
Views: 965

Not really... just the broadcast "way". I want to have a php script that can "stream" data to the browser in real time. Eg: suppose you run a script like this: system("./install-a-program"); If this command is executed in SSH an installation proccess will begin the proccess will be shown in your scr...
by mike
Wed Sep 08, 2004 2:35 am
Forum: phpMyAdmin
Topic: PHPMyAdmin - Error Importing / Uploading SQL Files
Replies: 2
Views: 5332

I prefer SSH too. Its quicker and can handle large files
by mike
Wed Sep 08, 2004 2:19 am
Forum: PHP coding => General
Topic: data streaming
Replies: 4
Views: 965

No no... its not about an installation, this is only an example. I am trying to find a way of streaming data in a browser on real time and not with buffering. Any ideas?
by mike
Wed Sep 08, 2004 1:54 am
Forum: PHP coding => General
Topic: PHP Server deamons
Replies: 8
Views: 1769

Well I know the difference between them but I made my self misundertood. I have created a deamon to execute linux commands, commands given through a web application. This "deamon" is running constantly and every 2" is checking a single file for commands to execute. I was wondering if I can do that i...
by mike
Tue Sep 07, 2004 8:29 am
Forum: PHP coding => General
Topic: data streaming
Replies: 4
Views: 965

data streaming

I am trying (for some server apps) to create a "web-installer" with PHP. For that reason i looking for a way of streaming data from the server to the browser. An example: A php script contains the command system("/usr/local/apache-1.3.31/configure ; make ; make install"); . While the installation ru...
by mike
Tue Sep 07, 2004 7:15 am
Forum: PHP coding => General
Topic: PHP Server deamons
Replies: 8
Views: 1769

Yeap, but its always running on the background and its ready to execute commands... is this a "deamon"?
by mike
Tue Sep 07, 2004 6:31 am
Forum: PHP coding => General
Topic: PHP Server deamons
Replies: 8
Views: 1769

Thanks for the link! Seems very intresting... By the way I dont want to create an httpd deamon or something similar, just a small application to run some commands any time.

I think PHP is good for Server Apps, but not as best as possible. Plesk Control Panel is totally written in PHP.
by mike
Tue Sep 07, 2004 1:25 am
Forum: mySQL & php coding
Topic: Performance of connections to mysql
Replies: 3
Views: 829

I agree with that. Include the file, with a single connection in it, in your scripts. No need to use mysql_close() at the end
by mike
Tue Sep 07, 2004 1:22 am
Forum: PHP coding => General
Topic: PHP Server deamons
Replies: 8
Views: 1769

Why is that? I have already done this many times and works perfect. Now I am trying to create a child-proccess system and open sockets to communicate with. Of course it needs very high attention on security as well ...
by mike
Sat Sep 04, 2004 6:03 am
Forum: PHP coding => General
Topic: PHP Server deamons
Replies: 8
Views: 1769

PHP Server deamons

Does anyone have ever tried creating a php server deamon? If yes, have you used any sockets to communicate with it? I need some ideas/suggestions. Thanks :)
by mike
Mon Jul 28, 2003 1:38 am
Forum: PHP General
Topic: PHP Script as... deamon
Replies: 1
Views: 777

PHP Script as... deamon

Has anyone ever developed a PHP Script to run as a deamon? I have created an infinite while loop with a 1-2sec delay and placed it on the background on linux using php as CGI. (#php -q script &). The consuming mem is too low ... about 0.3% of total so the script is not very heavy for the server. I w...
by mike
Mon Jul 28, 2003 1:31 am
Forum: PHP General
Topic: How do I get the text look like I typed it in...
Replies: 6
Views: 1688

Well I used both ways many times and I prefer str_replace... for many reasons. Everyone has his own way :wink:
by mike
Sun Jul 27, 2003 3:07 am
Forum: PHP General
Topic: How do I get the text look like I typed it in...
Replies: 6
Views: 1688

you shouldn't forget the newline: str_replace("\n","<br>\n",$text).


This is useless... just replace \n with <br>. There is a post somewhere on this forum I m explaining what nl2br cant do and str_place can. Dont remember what was that...
by mike
Sat Jul 26, 2003 4:05 am
Forum: PHP Scripts
Topic: htaccess sub.Domainer and Manager
Replies: 1
Views: 1304

Why dont you change the background on your web page? I can't see anything! :roll: :roll:
by mike
Sat Jul 26, 2003 4:01 am
Forum: PHP Installation
Topic: Need Help Install PHP MySQL Apache In Windows XP
Replies: 9
Views: 7259

Simply install Appserv 2.1. A package with apache/mysql/php and easy installation. There is no need to install all these one by one. Just use this and will do all the work for you :wink:

http://prdownloads.sourceforge.net/apps ... e?download
by mike
Sat Jul 26, 2003 3:57 am
Forum: PHP General
Topic: How do I get the text look like I typed it in...
Replies: 6
Views: 1688

swirlee wrote:Browsers ignore newlines when reading HTML. Use nl2br() to convert newlines to HTML line breaks ("<br />").


Its better to use str_replace("\n","<br>",$text) instead of nl2br. Dont remember exactly why... but nl2br has some minor problems
by mike
Sat Jul 26, 2003 3:52 am
Forum: PHP General
Topic: GD problems
Replies: 5
Views: 1405

You should always clean your last configuration before making a new compile:

rm -rf config.cache
make clean

Use php-4.3.x where GD are already bunded in. Just use
--with-gd option to activate them on configure command.