[PHP] Re: can't call htpasswd using PHP
more information in Red Hat 7.2, i was using PHP 4.1.2 while in Red Hat 8.0, it is PHP 4.2.2 thx a lot~ HPS Billy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear all, i can't call the htpasswd command after i used RedHat 8 ( which i can do so in Red Hat 7.2) do u have any idea/ suggestion? thx a lot HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] status of current online users
Display Users Online Based On Page Viewing http://articles.weberdev.com/ViewArticle.php3?ArticleID=254 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Miranda, Joel Louie M [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:50 AM To: [EMAIL PROTECTED] Subject: [PHP] status of current online users Hello, I was wondering how did some people do that they can display current active users on a webpage? I was hoping to find even simple info about this even on a first site basis only. Any ideas and howto's/docs will be great. Thanks, Louie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] stripping newlines from a string
How to remove new line / CrLf from a string http://examples.weberdev.com/get_example.php3?count=3577 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Charles Kline [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:44 AM To: [EMAIL PROTECTED] Subject: [PHP] stripping newlines from a string Hi all, How would i go about stripping all newlines from a string? Thanks, Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Where to start?
Try this : http://www.weberdev.com/index.php3?GoTo=search.php3%3Fcategory%3DEcommer ce%26searchtype%3Dcategory Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Simon Thurtle [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Where to start? Hi all, I am looking into learning PHP, I have a good understanding of HTML, JS and I know a little Perl. Firstly I know PHP is all server side and so a damn sight different from the above, but will they help me at all? Secondly where do I start? Are there any good on-line resources and or books that anyone knows? I am plannig to develop an E-comm solution us Oscommerce, does anyone know if this is any good or is naff? Any hints, tips or pointers would be greatly appreciated. Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hi I get some problems while using eregi_replace
Try these : A function that parses a string and replaces http://whatever with a link, and email addresses with a mailto link. This function was designed for the motd package. But will work freely on its own. http://examples.weberdev.com/get_example.php3?count=1235 How to change all of the links in a string to be HTML links. http://examples.weberdev.com/get_example.php3?count=1567 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: winst0n [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 5:23 AM To: php Subject: [PHP] Hi I get some problems while using eregi_replace Hi, so first of all, I'm sorry for my bad english. I'll try to write as better as I can, but I think it will be readable ;) So, this is 3 code unsing eregi_replace, but they dont work as well... If some one can give me a help, it's will be great. Many thx ! / code / /* transform [color=FF]colored text[/color] to font color=FFcolored text/font */ $message = eregi_replace ([color=(.*)](.*)[/color],font color='\\1'\\2/font,$message); /* transform [url=xxx]link![/url] to a href=xxxlink!/a */ $message = eregi_replace ([url=(.*)](.*)[/url],A HREF=\\\1\ TARGET=\blank\\\2/A,$message); /* transform [b]big text[/b] to bbig text/b */ $message = eregi_replace (.*([b]).*([/b]).*,\\1b\\2/b\\3,$message); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexp for URL
Try this : How to use regular expressions to get the list of links from an HTML page http://examples.weberdev.com/get_example.php3?count=1401 extract_links(); Extract all local links from a URL http://examples.weberdev.com/get_example.php3?count= Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Mattia [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:14 AM To: [EMAIL PROTECTED] Subject: [PHP] regexp for URL Does anyone have a good regular expression for capturing all http URL in a string? now i'm using ?(http://[a-z0-9-/_;=+-\.\?:@]+)\b?mi in one of my programs, that is, all strings beginning with http:// and contain chars like a-z0-9 ... does anione have something better? thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re:[PHP] Re: What program do you use to Create PHP Application?
hi, fongming£¡ What about HTML-KIT? === 2003-05-28 00:12:00 you wrote£º=== Yes, I also use PHPEd to program, I've been using it's free verison until now. I've been search another better, but PHPEd is the best for me after all. Fongming from Taiwan. PHPEd is absolutely fantastic It colours everything so you don't forget to close brackets or quotes and helps you keep an eye on escaped chars. I think you have to pay for it now though. Shame. Grant [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What program do you use to Create PHP Application? I am tired of doing this in notepad or other editor and Front page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Fongming from Taiwan. -- ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X... http://fonn.fongming.idv.tw [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = = = = = = = = = = = = = = = = = = = = poetbox [EMAIL PROTECTED] 2003-06-09 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re:[PHP] Re: What program do you use to Create PHP Application?
hi, fongming£¡ table width=460 style=TABLE-LAYOUT:fixed;word-wrap:break-word border=1 bordercolor=black trtdpoetbox,this is the test11abcccff /table === 2003-05-28 00:12:00 you wrote£º=== Yes, I also use PHPEd to program, I've been using it's free verison until now. I've been search another better, but PHPEd is the best for me after all. Fongming from Taiwan. PHPEd is absolutely fantastic It colours everything so you don't forget to close brackets or quotes and helps you keep an eye on escaped chars. I think you have to pay for it now though. Shame. Grant [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What program do you use to Create PHP Application? I am tired of doing this in notepad or other editor and Front page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Fongming from Taiwan. -- ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X... http://fonn.fongming.idv.tw [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = = = = = = = = = = = = = = = = = = = = ¡¡Thanks for any suggestions. poetbox [EMAIL PROTECTED] 2003-06-09 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checkboxes and put value in db
Hi, Maybe you can help me with the following: I have a list of visitors that want some documentation.. I'm displaying a list with a checkbox so i can check the one's that received the documentation. So what is must do; it must update a table called prospects and set the value of a field called prbrochverst to 1 . Only problem it doesn't work; can you have a look? // includes include(../../conf/config.php); include(../../conf/functions.php); // open database connection $connection = mysql_connect($host, $user, $pass) or die (Unable to connect!); // select database mysql_select_db($db) or die (Unable to select database!); // generate and execute query $query = SELECT prospectid, praanhef, prvoorletter, prtussenv, prnaam, pradres, prhuisnummer, prpostcode1, prpostcode2, prplaats, premail, printresse, prbrochure, prdatumaanv, prbrochverst FROM prospects WHERE prbrochverst = ' ' ORDER BY prdatumaanv; $result = mysql_query($query) or die (Error in query: $query. . mysql_error()); $_REQUEST[submit]=isset($_REQUEST[submit])?$_REQUEST[submit]:; if($_REQUEST['submit']!=) { $idlist=$_POST['idlist']; $sep=$_POST['sep']; echo $idlist; $array_id = explode(,, $idlist); foreach($array_id as $id){ if(${id . $id} == 1){ $query2 = UPDATE prospects SET prbrochverst = '1'; $result2 = mysql_query($query2) or die (Error in query: $query. . mysql_error()); } } // close connection mysql_close($connection); } ? form method=post enctype=multipart/form-data action=? $_SERVER['PHP_SELF']? ? // if records present if (mysql_num_rows($result) 0) { // iterate through resultset // print title with links to edit and delete scripts while($row = mysql_fetch_object($result)) { ? b? echo formatDate($row-prdatumaanv); ?/b br font size=-1? echo $row-praanhef . . $row-prtussenv . . $row-prnaam; ?br ? echo $row-pradres . . $row-prhuisnummer; ?br ? echo $row-prpostcode1 . . $row-prpostcode2 .. $row-prplaats; ?brbr ? echo $row-premail; ?brbr ? echo $row-printresse; ?br ? echo $row-prospectid; echo input type=\checkbox\ name=\id . $row-prospectid . \ value=\1\br; $idlist .= $sep . $row-prospectid; $sep = ,; } } // if no records present // display message else { ? font size=-1Geen Prospects aanwezig/fontp ? } echo input type=\hidden\ name=\idlist\ value=\$idlist\; ? input type=submit name=submit value=Toevoegen /form Thanks, Frank
Re: [PHP] stripping newlines from a string
Yes. Is weird. I thought this would work too, but for some reason it was not removing them all. I wonder if re-saving the files with UNIX linebreaks (or try DOS) would have any effect. Will report back. - Charles On Monday, June 9, 2003, at 02:24 AM, Joe Pemberton wrote: http://www.php.net/str_replace $newstr = str_replace(\n, , $oldstr); - Original Message - From: Charles Kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:44 PM Subject: [PHP] stripping newlines from a string Hi all, How would i go about stripping all newlines from a string? Thanks, Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stripping newlines from a string
On Sun, 2003-06-08 at 22:44, Charles Kline wrote: Hi all, How would i go about stripping all newlines from a string? Thanks, Charles Something like this: ?php error_reporting(E_ALL); $str = This string has unix\n and Windows\r\n and Mac\r line endings.; $new_str = preg_replace('/[\n\r]+/', '', $str); echo $str; $new_str; ? Good luck, Torben -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stripping newlines from a string
On Mon, 9 Jun 2003, Charles Kline wrote: Yes. Is weird. I thought this would work too, but for some reason it was not removing them all. I wonder if re-saving the files with UNIX linebreaks (or try DOS) would have any effect. Will report back. $str = str_replace (array(\r, \n), '', $str); Regards, Philip On Monday, June 9, 2003, at 02:24 AM, Joe Pemberton wrote: http://www.php.net/str_replace $newstr = str_replace(\n, , $oldstr); - Original Message - From: Charles Kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:44 PM Subject: [PHP] stripping newlines from a string Hi all, How would i go about stripping all newlines from a string? Thanks, Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] post data?
Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] project users manual howto
if you dont mind an example would be nice the site is totally confusing of course i have read the documentation -Original Message- From: Armand Turpel [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2003 11:06 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] project users manual howto With phpdoc you can also make user level docs. Read the manual. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 11:38 AM Subject: [PHP] project users manual howto hi there i have nearly completed a project in php and need to find different approaches in creating user manuals , is there any tutorials or howtos out there and i am not talkin about phpdoc this is code doc level i need to find a good approach at creating the users level documentation let me know thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] post data?
What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Execute command which has root privileges
Probably you should look over here for info about suexec http://httpd.apache.org/docs/suexec.html, or check the 'sudo' man pages... With that you could gain root privilages.. -Oorspronkelijk bericht- Van: vijaypatel [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 6:06 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] Execute command which has root privileges Hello, I am using FreeBSD 4.7 ,PHP 4.2.3 Apache 1.3 I want to execute shell script which contains few IPFW commands. I have tried with system(),exec(),passthru() command to execute script but i can't do that. Apache has created www user on FreeBSD. I found that www user has not privilege for IPFW. How can i execute script which contains IPFW commands with PHP? I have given 777 permission to script file. Thanking You. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: urldecode problem :(
Thanks, But how can I understand when to decode string and when not ? Rosen Seairth Jacobs [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rosen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] HI, I'm using urldecode function to decode string from getenv(QUERY_STRING);, but part of it is in cyrrilic (windows-1251) charset. I have following code: $a=%D1%81%D1%87%D0%B5%D1%82%D0%BE%D0%B2%D0%BE%D0%B4%D0%BD%D0%B0+%D0%BA%D1%8 A%D1%89%D0%B0; $b=%d1%ee%f4%f2%f3%e5%f0; echo a= . urldecode($a); echo brb= . urldecode($b); On the second string it works correctly, but on first it don't. These two vars are getted from two different pages ( as refferers ). I think the problem could be in encoding used in two pages. When I run the code without setting a charset (defaulting to UTF-8), I get back the following: a=?? b=ody When I run the code setting the charset to windows-1251, I get: a=????µ????° ??° b=??? I'm guessing you want a from the first one and b from the second one. In which case, you are correct. Two different character encodings are being URL encoded. You could convert the first string using: convert_cyr_string(mb_convert_encoding(urldecode($a), 'ISO-8859-5', 'UTF-8'), 'i', 'w') -- --- Seairth Jacobs [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending output to audio device from PHP
Hi, I have written an MP3 Jukebox server with PHP and MySQL, that runs on Linux server with Apache. To play music, I use the external program plaympeg from the SDL package. It works fine, but I cannot have any control over the player. To play the next song, I have to wait for the player to complete its current task and can then start a new player. This creates some pause between the songs, and is a bit annoying. To make my app more suffisticated, I'd like to be able to have more control over the stream. So I was wondering, how can I send something to the audio device without using an external program? I think I need to convert the MP3 stream first. Is there someone out there who would be interested in joining me in this little project? (If I may compliment myself, it is a nice piece of work, but needs some more scripting) Contact me directly per email, if you want me to send the sources. Any input would be appreciated. Cheers, Edwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Good Hosting company
anyone knows any good cheap hosting company in UK/US?? with good support. Many thanks awlad ___ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax:01582 522 328 ___ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd.
[PHP] Re: Good Hosting company
http://www.meubox.net is a good hosting company. Check out the prices, and if you would like to setup an account contact me at [EMAIL PROTECTED] Awlad Hussain [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] anyone knows any good cheap hosting company in UK/US?? with good support. Many thanks awlad ___ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax:01582 522 328 ___ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reading a file into variable for using in a javascript
you could try using file() or readfile(). while file reads the content of the file in to an array, readfile reads a file and writes it to the output buffer. - Madhu Charles Kline wrote: Hi all, I am reading the content of a text file into a variable to be used in a javascript. I am reworking some code that was originally done using ColdFusion and the jsStringFormat(var) function. What is the PHP equivalent string function? Is there one? I have searched the docs, but can't figure out which to use. Thanks Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No input file specified
I'm running a couple of php scripts from the cgi-bin directory on Slackware linux 8.1, under apache 1.3.20. The most simple example of a script is: #!/usr/local/pkg/php4.3-withsnmp/bin/php ?php printf(Bob\n); ? If I install php-4.3.0, this will run fine, however compiling php-4.3.2 with the same options: ./configure --with-mysql --with-gd --with-zlib --with-snmp=/usr/local/pkg/net-snmp-5.0.8 --prefix=/usr/local/pkg/php4.3-withsnmp Gives the error 'No input file specified', in the browser window. This is not browser specific: pc055$ telnet conc1 80 Trying 144.32.40.21... Connected to conc1. Escape character is '^]'. GET /cgi-bin/testphp No input file specified. Connection closed by foreign host. The script will run from the command line without a problem: [EMAIL PROTECTED]:$ ./testphp Content-type: text/html X-Powered-By: PHP/4.3.2 Bob Any ideas what could be going wrong, or further debugging suggestions? I'm assuming it is not the web server install, as it works fine with 4.3.0. I need version 4.3.2, due to the snmpset bug in earlier versions. Thanks for any advice Dave Hartburn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post data?
the form tag is form action=syn2.php method=post onSubmit=return checkform(this); Thx! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.....\none.php on line 286
Hi Thomas and All, why are you using sql_query through your code? its mysql_query for mysql! I use phpnuke and it have a sql_layer.php. You are correct, for mysql is mysql_query. But this dont is the problem, I change it and the problem continue! Any tip?? Thanks Marcelo - Original Message - From: Thomas Seifert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 6:50 PM Subject: Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.\none.php on line 286 why are you using sql_query through your code? its mysql_query for mysql! and the result, needed for mysql_fetch_row is returned from that function. read the docs again. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.....\none.php on line 286
Hi Janet, I dont have know how in php. I inserted the function mysql_error() in my code and it dont return any message! Thanks Marcelo This means that when you did: $result = mysql_query($sql); $result did not end up with a valid resource in it. Then, when you do the fetch row command using $result, it fails with this message. In general, the reason in that there is something wrong with the query so it either fails or doesn't return any results. You can use mysql_error() to find out what went wrong if it failed. Janet --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] project users manual howto
i'll make this a bit more clear i'm looking for tutorials or howtos on technical writing , and maybe structures of laying out technical documentation , phpdoc is for developer documentation , phat chance i'm gonna put user level documentation embedded into the comments of the scripts thats just rediculous ! -Original Message- From: electroteque [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 6:13 PM To: Armand Turpel; [EMAIL PROTECTED] Subject: RE: [PHP] project users manual howto if you dont mind an example would be nice the site is totally confusing of course i have read the documentation -Original Message- From: Armand Turpel [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2003 11:06 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] project users manual howto With phpdoc you can also make user level docs. Read the manual. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 11:38 AM Subject: [PHP] project users manual howto hi there i have nearly completed a project in php and need to find different approaches in creating user manuals , is there any tutorials or howtos out there and i am not talkin about phpdoc this is code doc level i need to find a good approach at creating the users level documentation let me know thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] categorise list
I am dispalying data from mysql database using the codes below: $while($row=mysql_fetch_array($result)) { echo $row[name]; } How can i format the above data in this format as shown below? in alphabetical order A ---click to go up Apple Armchair B ---click to go up Basket Baseball C ---click to go up Car and so on any suggestions?? Many thanks, awlad ___ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax:01582 522 328 ___ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd.
[PHP] what is the OOP structure for PHP
Dear Experts, Is there an OOP (object oriented programming) structure for PHP? If so, could someone show me the basic structure of such an object? An exmple with definition and implementation would be great. Thanks! Yours sincerely, Mr See Kok Boon
[PHP] $HTTP_POST_VARS
Whats the advantage (or shall i say disadvantage )of passing form variables to a function like shown below: function function_name($var,$var1,$var2) { } rather than passing the $HTTP_POST_VARS array to the fuction like: function function_name($HTTP_POST_VARS) { } Is any better than other? or both the same? awlad
[PHP] Yearbook script?
Anyone know of a good yearbook script? One that will show a listing of photos, that when clicked on, will bring up a page with more info on the individual? TIA ++ Mike Yrabedra (President) 323 Incorporated Home of MacDock, MacAgent and MacSurfshop ++ W: http://www.323inc.com/ P: 770.382.1195 F: 734.448.5164 E: [EMAIL PROTECTED] I: ichatmacdock ++ Whatever you do, work at it with all your heart, as working for the Lord, not for men. ~Colossians 3:23 {{{ ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Yearbook script?
Anyone know of a good yearbook script? One that will show a listing of photos, that when clicked on, will bring up a page with more info on the individual? I'm sure any gallery type script could be used for this. Just get one that allows comments for the pictures. Maybe adapt the commenting a little to support certain fields. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] condensing a list from MySQL
Hi all, not sure where to start with this. I have a keywords field in a mysql database - allows up to 100 characters of words seperated by spaces. at a late stage in the development process the client would now like a summary list of keywords that they've entered. I guess what I need to do is open each keyword field, extract the words, add them to an array, remove duplicates and sort alphabetically. sounds easy but I'm still finding my way - anyone got a sample script or some helpful hints they'd care to share? thanks Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_POST_VARS
Hi AH Whats the advantage (or shall i say disadvantage )of passing form variables to a function like shown below: AH function function_name($var,$var1,$var2) AH { AH } AH rather than passing the $HTTP_POST_VARS array to the fuction like: AH function function_name($HTTP_POST_VARS) AH { AH } AH Is any better than other? or both the same? AH awlad Use $_POST and pass nothing to the function. It is superglobal array. -- Regards Anton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] post data?
in that case,.. I guess something is going wrong in your checkform javascript function .. probably you attach the name and value (by mistake) to eachother in there -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 12:16 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] post data? the form tag is form action=syn2.php method=post onSubmit=return checkform(this); Thx! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] post data?
It's an Apache2 / PHP bug. Upgrade to the latest versions of each (although Apache2 and PHP are still not recommended). ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: esctoday.com | Wouter van Vliet [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:21 AM To: HPS; [EMAIL PROTECTED] Subject: RE: [PHP] post data? in that case,.. I guess something is going wrong in your checkform javascript function .. probably you attach the name and value (by mistake) to eachother in there -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 12:16 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] post data? the form tag is form action=syn2.php method=post onSubmit=return checkform(this); Thx! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] categorise list
$letter=''; $while($row=mysql_fetch_array($result)) { if($letter!=$row[name][0]) { echo $row[name][0].'br'; $letter=$row[name][0]; } echo $row[name].'br'; } Op maandag 09 juni 2003 12:41, schreef u: I am dispalying data from mysql database using the codes below: $while($row=mysql_fetch_array($result)) { echo $row[name]; } How can i format the above data in this format as shown below? in alphabetical order A --- click to go up Apple Armchair B --- click to go up Basket Baseball C --- click to go up Car and so on any suggestions?? Many thanks, awlad ___ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax:01582 522 328 ___ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filter out with date?
John W. Holmes [EMAIL PROTECTED] wrote Wouldn't it be smarter to only fill this array with items matching the date you want in the first place?? How? Anyhow...now you'll have to loop through each ingress Object and see if substr($obj-publisert,-2) matches the month you want. Dont know if I understood that one :( Regards, A. Lyse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] condensing a list from MySQL
I have a keywords field in a mysql database - allows up to 100 characters of words seperated by spaces. at a late stage in the development process the client would now like a summary list of keywords that they've entered. I guess what I need to do is open each keyword field, extract the words, add them to an array, remove duplicates and sort alphabetically. sounds easy but I'm still finding my way - anyone got a sample script or some helpful hints they'd care to share? How about just fixing this so it'll be easier in the future? You should have a separate table where each keyword is in it's own row, with or without duplicates (depends if you want a count of how often the keyword is used), and an ID relating back to the article or whatever you have. The process of creating the table and creating the array are about the same. The table will give you more flexibility, though, when the client starts asking for more stats. To use the array method, like you originally asked: $var = array(); $query = SELECT keyword FROM table; $rs = mysql_query($query); while($row = mysql_fetch_assoc($rs)) { $ar = explode(' ',$row['keyword']); array_merge($var,$ar); } $var = array_unique($var); $final_array = sort($var); To INSERT everything into a second table: $query = SELECT keyword FROM table; $rs = mysql_query($query); while($row = mysql_fetch_assoc($rs)) { $keywords = explode(' ',$row['keyword']); $insert_string = ' . implode(',',$keywords) . '; //assumes no ' characters in $keywords $query = INSERT INTO keywords_table VALUES ($insert_string); $rs2 = mysql_query($query); } Make the keywords column UNIQUE if you don't want duplicates, although it would probably be better to just leave duplicates in there and do a SELECT DISTINCT to remove them. Leaving them in there will allow you to produce more stats on which keywords are most popular, etc. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $PHP_AUTH_USER question...
On Fri, 6 Jun 2003 11:36:51 +0100, [EMAIL PROTECTED] wrote: How can I get that to talk to $PHP_AUTH_USER? I'm not sure this is exactly what you want (actually, I'm pretty sure this is coming at it from the opposite end), but here is a way I used it for a very simple / low security situation. I set up the index.php to check for $_SERVER[PHP_AUTH_USER] (actually, I started out just using $PHP_AUTH_USER with RegisterGlobals on, but I figured out that it could be inserted via the get method and totally defeat my security) where I wanted to add links that only administrators have access to. I also check for it at the top of the admin only modules. This way a normal user might see a list of items with Details buttons next to them, but admins would see those buttons and Edit buttons. Edit would also check to see if the variable was set. At the bottom of the main page I have a link to login.php. This is simply a redirect back the index.php but I have that file listed in the .htaccess file as password protected. Once the login.php file has been password checked, all of the programs from that directory down inherit the $_SERVER[PHP_AUTH_USER] value. Here is the .htaccess file I used: Files login.php AuthType Basic AuthUserFile /www/sbudir/.htpasswd AuthName MyAuthName Require valid-user /Files Here is the login.php file ?PHP header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified header(Cache-Control: no-store, no-cache, must-revalidate); // HTTP/1.1 header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); // HTTP/1.0 header(Location: http://www.mydomain.com/subdir/;); ? And in my index.php I have lines similar to the following: a href=show.phpDetails/a ?PHP if( isset( $_SERVER[PHP_AUTH_USER] ) ) { echo a href=\edit.php\Edit/a; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] filter out with date?
Wouldn't it be smarter to only fill this array with items matching the date you want in the first place?? How? I don't know. You do create this array at some point, right? How do you do it? How do you create the date field in the ingress Object ? Whenever/However you're creating this list, look at the date field in the object and only add it to your array if it matches the dates your looking for. Anyhow...now you'll have to loop through each ingress Object and see if substr($obj-publisert,-2) matches the month you want. Dont know if I understood that one :( You have a variable called publisert in the ingress Object inside of your array, right? The format is DD/MM, it appears. Odd as that may be, if you use substr() to just pull the last two characters, the month, and then match that to the month your looking for, you'll see if this object is one that you want to keep or not. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] what is the OOP structure for PHP
Is there an OOP (object oriented programming) structure for PHP? If so, could someone show me the basic structure of such an object? An exmple with definition and implementation would be great. Thanks! http://us2.php.net/manual/en/language.oop.php ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] categorise list
I am dispalying data from mysql database using the codes below: $while($row=mysql_fetch_array($result)) { echo $row[name]; } How can i format the above data in this format as shown below? in alphabetical order A -- -click to go up Apple Armchair B -- -click to go up Basket Baseball You need an ORDER BY name in your query to get the results sorted alphabetically, first. Then, as you loop through the results, you need to remember the current letter you're on. If the letter changes, then output the header and line showing the next letter. Something like this: $old_letter = ''; $query = SELECT name FROM table ORDER BY name; $rs = mysql_query($query); while($row = mysql_fetch_assoc($rs)) { $current_letter = strtoupper(substr($row['name'],0,1)); if($current_letter != $old_letter) { echo $current_letterbr /hr\n; $old_letter = $current_letter; } echo $row['name'] . 'br /'; } Untested... adapt to your needs. Oh, add in your go to top link, also. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Automatic Headers and Footers
[snip] The reasonn for my difficult answer was because the criteria for his solution indicated that he did not want to modify the html pages themselves. Thus the above solution is invalid :| [/snip] I see what you are saying, but how much modification is too much? :) OK, another waythe HTML could be read into a page (fopen()) containing the header/footer stuff. You'd have to deal with identification of which page you want loaded, but shouldn't be too hard. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Yearbook script?
I agree, this would be like most gallery type pages... I also did a small demo page for a used vehicle dealership that could be usedyou just substitute the people for the cars...:) http:\\www.peloke.webhop.org -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:12 AM To: 'MIKE YRABEDRA'; 'PHP List' Subject: RE: [PHP] Yearbook script? Anyone know of a good yearbook script? One that will show a listing of photos, that when clicked on, will bring up a page with more info on the individual? I'm sure any gallery type script could be used for this. Just get one that allows comments for the pictures. Maybe adapt the commenting a little to support certain fields. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] This is NOT the right place to ask this but I am desperate
Hi all, I know this is not the right group to this but I am desperate. I have just got Apache and I am a total newbie to Apache and to playing with servers, so as u can imagine I am floundering a tad at the mo!! I have set-up and cofig'd apache 2.0.46 on a Windows XP machine on a LAN with ADSL net access.. Now I know the server is working fine as I can interact with it on a command line and it is showing as started on its ickle control panel. Now the problem is that I let the server decide on it's own IP address by leaving Listen in the config file as just a port no of 8080 (80 is already used on this machine), but I have no idea how to actually access the server from a browser as I have no URL or IP to type in!!! Help!! How do I find the IP? Or is there something that I have missed/done wrong/broken? I am sure that this is really simple but at the moment the only simple thing around here is me!! All thought or comments welcome. Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] This is NOT the right place to ask this but I am desperate
Have you tried typing localhost? Hi all, I know this is not the right group to this but I am desperate. I have just got Apache and I am a total newbie to Apache and to playing with servers, so as u can imagine I am floundering a tad at the mo!! I have set-up and cofig'd apache 2.0.46 on a Windows XP machine on a LAN with ADSL net access.. Now I know the server is working fine as I can interact with it on a command line and it is showing as started on its ickle control panel. Now the problem is that I let the server decide on it's own IP address by leaving Listen in the config file as just a port no of 8080 (80 is already used on this machine), but I have no idea how to actually access the server from a browser as I have no URL or IP to type in!!! Help!! How do I find the IP? Or is there something that I have missed/done wrong/broken? I am sure that this is really simple but at the moment the only simple thing around here is me!! All thought or comments welcome. Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Randum Ian [EMAIL PROTECTED] DancePortalGlobal Webmaster http://www.danceportalglobal.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] This is NOT the right place to ask this but I am desperate
Run 'ipconfig' from a command prompt to get your IP address. (or as mentioned, localhost will work) -Brad Hi all, I know this is not the right group to this but I am desperate. I have just got Apache and I am a total newbie to Apache and to playing with servers, so as u can imagine I am floundering a tad at the mo!! I have set-up and cofig'd apache 2.0.46 on a Windows XP machine on a LAN with ADSL net access.. Now I know the server is working fine as I can interact with it on a command line and it is showing as started on its ickle control panel. Now the problem is that I let the server decide on it's own IP address by leaving Listen in the config file as just a port no of 8080 (80 is already used on this machine), but I have no idea how to actually access the server from a browser as I have no URL or IP to type in!!! Help!! How do I find the IP? Or is there something that I have missed/done wrong/broken? I am sure that this is really simple but at the moment the only simple thing around here is me!! All thought or comments welcome. Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating Images
Greetings learned PHP(eople), I am using the code below to create buttons based on entries that are inserted into a text field from the preceding page. I got this code from my trusty tome PHP and MySQL Web Development by Luke Wellign/Laura Thomson. Problem is this : If I type in more than 18 characters the image creation fails with : The image http://xx..xx.xx/Generic/Admin/make_buttons.php; cannot be displayed, because it contains errors When I view the HTML page source code, it simply states Text given is too large for button Any ideas on how to make it so that the error I specified comes up and not the The image http://xxx.xxx.xxx.xxx.x blah blah part. Here`s the code : --- ?php Header('Content-type: image/png'); //Posted from previous page //Button text and colour $button_text = $HTTP_POST_VARS['button_text']; $colour = $HTTP_POST_VARS['colour']; if (empty($button_text) || empty($colour)) { echo 'Could not create button'; exit; } //Create image from existing image $image = imagecreatefrompng ('images/purple.png'); $image_width = ImageSX($image); $image_height = ImageSY($image); //Image needs 18 pixel margin in from the edge image $image_width_wo_margins = $image_width - (2 * 18); $image_height_wo_margins = $image_height - (2 * 18); //Work out if the font size will fit and make it //smaller until it does. Start with large size and scale down $font_size = 33; //Set font name and location $fontname = /home/data/ClientWebs/chrisplay/Generic/Admin/a_d_mono.ttf; do { $font_size--; //Find out the size of the text at that font size $bbox = imagettfbbox ($font_size, 0, $fontname, $button_text); $right_text = $bbox[2]; //Right co-ordinate $left_text = $bbox[0]; //Left co-ordinate $width_text = $right_text - $left_text; //How wide is it ? $height_text = abs($bbox[7] - $bbox[1]); //How tall is it ? } while ($font_size 8 ($height_text $image_height_wo_margins || $width_text $image_width_wo_margins) ); if ($height_text $image_height_wo_margins || $width_text $image_width_wo_margins) { //No readable font size will fit on button echo 'Text given is too large for button'; } else { //The font size fits //Now where to put it $text_x = $image_width/2.0 - $width_text/2.0; $text_y = $image_height/2.0 - $height_text/2.0; if ($left_text 0 ) $text_x += abs($left_text); //Factor for left overhang $above_line_text = abs($bbox[7]); //How far above the baseline $text_y += $above_line_text; //Add baseline factor $text_y -= 2; //Adjustment factor for shape of our template $white = ImageColorAllocate($image, 0,0,255); ImageTTFText ($image, $font_size, 0, $text_x, $text_y, $white, $fontname , $button_text); ImagePng($image); } ImageDestroy($image); ? Thanks in advance for any assistance.. Regards -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 All most men really want in life is a wife, a house, two kids and a car, a cat, no maybe a dog. Ummm, scratch one of the kids and add a dog. Definitely a dog. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SAFE MODE Restriction in effect
Getting the below error from a php site I am developing. I am using a new server so I guess it is a php configuration thing, but how do I fix it. Ben Warning: SAFE MODE Restriction in effect. The script whose uid is 510 is not allowed to access /home/virtual/site4/fst/var/www/html/test owned by uid 0 in /home/virtual/site4/fst/var/www/html/test/lib/misc.inc on line 219 * Ben Edwards Tel +44 (0)1179 553 551 ICQ 42000477 * * Webhosting for the masses http://serverone.co.uk * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Fun corporate graphics http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Yearbook script?
on 6/9/03 8:58 AM, Edward Peloke at [EMAIL PROTECTED] wrote: What script is this based off? I agree, this would be like most gallery type pages... I also did a small demo page for a used vehicle dealership that could be usedyou just substitute the people for the cars...:) http:\\www.peloke.webhop.org -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:12 AM To: 'MIKE YRABEDRA'; 'PHP List' Subject: RE: [PHP] Yearbook script? Anyone know of a good yearbook script? One that will show a listing of photos, that when clicked on, will bring up a page with more info on the individual? I'm sure any gallery type script could be used for this. Just get one that allows comments for the pictures. Maybe adapt the commenting a little to support certain fields. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ++ Mike Yrabedra (President) 323 Incorporated Home of MacDock, MacAgent and MacSurfshop ++ W: http://www.323inc.com/ P: 770.382.1195 F: 734.448.5164 E: [EMAIL PROTECTED] I: ichatmacdock ++ Whatever you do, work at it with all your heart, as working for the Lord, not for men. ~Colossians 3:23 {{{ ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] This is NOT the right place to ask this but I am desperate
Hi, Apache is a fantastically written server/program, thats why it has its own mailing list. why not write there? You will get a lot more answers to the point plus you wont bug others on this list. Cheers, -Ryan - Original Message - From: Simon Thurtle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:09 PM Subject: [PHP] This is NOT the right place to ask this but I am desperate Hi all, I know this is not the right group to this but I am desperate. I have just got Apache and I am a total newbie to Apache and to playing with servers, so as u can imagine I am floundering a tad at the mo!! I have set-up and cofig'd apache 2.0.46 on a Windows XP machine on a LAN with ADSL net access.. Now I know the server is working fine as I can interact with it on a command line and it is showing as started on its ickle control panel. Now the problem is that I let the server decide on it's own IP address by leaving Listen in the config file as just a port no of 8080 (80 is already used on this machine), but I have no idea how to actually access the server from a browser as I have no URL or IP to type in!!! Help!! How do I find the IP? Or is there something that I have missed/done wrong/broken? I am sure that this is really simple but at the moment the only simple thing around here is me!! All thought or comments welcome. Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SAFE MODE Restriction in effect
$dp = opendir( $currdir ); Basically it seems like I need to turn 'SAFE MODE' off but I dont really know what it it or how to turn it off. In fact I am not sure where the config file is on a *nix box or what is it called. Ben At 15:58 09/06/2003 +0200, winst0n wrote: what does the line 219 in misc.inc ?! * Ben Edwards Tel +44 (0)1179 553 551 ICQ 42000477 * * Webhosting for the masses http://serverone.co.uk * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Fun corporate graphics http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: This is NOT the right place to ask this but I am desperate
http://127.0.0.1:8080 Simon Thurtle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I know this is not the right group to this but I am desperate. I have just got Apache and I am a total newbie to Apache and to playing with servers, so as u can imagine I am floundering a tad at the mo!! I have set-up and cofig'd apache 2.0.46 on a Windows XP machine on a LAN with ADSL net access.. Now I know the server is working fine as I can interact with it on a command line and it is showing as started on its ickle control panel. Now the problem is that I let the server decide on it's own IP address by leaving Listen in the config file as just a port no of 8080 (80 is already used on this machine), but I have no idea how to actually access the server from a browser as I have no URL or IP to type in!!! Help!! How do I find the IP? Or is there something that I have missed/done wrong/broken? I am sure that this is really simple but at the moment the only simple thing around here is me!! All thought or comments welcome. Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SAFE MODE Restriction in effect
Changed it to dir but not made any difference. I have root access to the server so could change php.ini. However ; Safe Mode ; safe_mode = Off ; By default, Safe Mode does a UID compare check when ; opening files. If you want to relax this to a GID compare, ; then turn on safe_mode_gid. safe_mode_gid = Off So not quite sure why there is a phoblem Ben At 16:23 09/06/2003 +0200, winst0n wrote: Ok, I think the php comand opendir is blocked for security reason. Try with this : $dp = dir($currdir ); dir() and opendir() are the same for client. A lot of hostserver disable opendir(), I dont know why, but they do ;) * Ben Edwards Tel +44 (0)1179 553 551 ICQ 42000477 * * Webhosting for the masses http://serverone.co.uk * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Fun corporate graphics http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not avalid MySQL result resource in f:\.....\none.php on line 286
On Mon, 9 Jun 2003 07:35:16 -0300 [EMAIL PROTECTED] (Marcelo Luiz De Laia) wrote: I use phpnuke and it have a sql_layer.php. You are correct, for mysql is mysql_query. But this dont is the problem, I change it and the problem continue! Any tip?? I think you are mixing the layer and native functions. You should use ONE of these, either the layer from phpnuke OR the native functions. I don't know how the layer handles the results but from the layout you had it looks just wrong. The standard-way using native mysql_*-functions for a select (with some basic error checking) is as follows: [... connection and so on ...] $result = mysql_query(select * from ...); if(!mysql_error()) { echo mysql_error(); } while($row=mysql_fetch_row($result)) { [... output ...] } You are either not transferring the result-identifier correctly or your query returns an error. Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] difference twixt mod_php_memory_usage and top size/res
I'm trying to get reliable values for memory usage on my php scripts, some of which are making big pdfs using PDFlib. I've set up a CustomLog in my apache config file using the PHP memory usage note to apache and I'm trying to understand the discrepancies between the peak memory usage value logged via %{mod_php_memory_usage}n and the values that are displayed via SIZE and RES when using the unix command top. EXAMPLES of mod_php_memory_usage VS top: php_log_peak_mem top(SIZE) top(RES) 72408 12404K 7156K 371464 12404K 7900K 45240 12576K 8160K 126112 12452K 7968K 1073304 13840K 9596K 2678008 17620K12724K 3094000 18796K13892K I've had a hard time finding resources to perform proper testing and capacity planning for my Virtual Private Server hosting setup. For the most part, I've been successful getting some guidelines with load testing using JMeter but I've been requested to provide some sort of outlook on my scripts memory consumption and how that translates into scaling numbers of concurrent users. Any info on the reliability of utilizing the top command would be helpful because I have some non-php CGI scripts that I need to track as well. It's easy to throw hardware/memory/money at things but I'd like to provide options that are sensible and affordable AND have the reasons why changes are necessary. The big question: Why is there a difference and what is the difference between the figures logged by mod_php_memory_usage and the numbers reported by the SIZE and RES columns of the top command? Any suggestions on how I can get up to speed on planning server requirements around my existing scripts would be extremely helpful as well. (Useful testing experts/how-to's/books/websites etc.) Thanks much. Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] access a static variable of a class
Hello, One line to say this is my first post here, I thought about posting in php-general, but ZE2 is in development, so... I want to access a static variable of a class, but I CANNOT use directly the class name, so class name is in a variable. To be clear: ?PHP class foo { static $conf = 'configuration variable'; } $var = 'foo'; echo $var::$conf ; ? this produces a parsing error... How could I do ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good Hosting company
Hi, you can go to www.3shost.com very cheap and very good! My collegue's have their website running their.. Due to some specific settng's i'm hosting in the Netherlands.. Regards, Frank - Original Message - From: Awlad Hussain [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 11:10 AM Subject: [PHP] Good Hosting company anyone knows any good cheap hosting company in UK/US?? with good support. Many thanks awlad ___ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax:01582 522 328 ___ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mutile select search engine
I have a advance search page, similar to this http://www.shaadi.com/partner_search/matrimonial_search/advancedmarriagesearch.php (mine on local server). I can create the sql statement for it ...the only problem i have is passing the all variables from page to page in record navigation..(I use function for the record navigation) for example if the query retrive 20 records and i am dispalying 10 records per page... when i click on next page.. the search result would be completely different from the first page.. :( Has anyone done similar search page?? any help would be greatly appriciated... and many thanks for responding to my early question. Regards, Awlad ___ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax:01582 522 328 ___ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd.
RE: [PHP] Mutile select search engine
I have a advance search page, similar to this http://www.shaadi.com/partner_search/matrimonial_search/advancedmarriage se arch.php (mine on local server). I can create the sql statement for it ...the only problem i have is passing the all variables from page to page in record navigation..(I use function for the record navigation) for example if the query retrive 20 records and i am dispalying 10 records per page... when i click on next page.. the search result would be completely different from the first page.. :( Has anyone done similar search page?? any help would be greatly appriciated... and many thanks for responding to my early question. Well, you need to maintain the search criteria somewhere. You can use either GET, POST, COOKIE, or SESSION. You can include all of the criteria as hidden fields and use POST, or attach them all into a QUERY_STRING in the URL of a link and use GET, or put them all into COOKIEs to retrieve on the next page, or finally, put them all into the SESSION to retrieve on the next page. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post data?
wouter, the checkform should be alright, coz i had been using Redhat 7.2+apache 1.3 + php 4.1.2 for a year and the program is working very good thx a lot! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] ??? news:[EMAIL PROTECTED] ???... in that case,.. I guess something is going wrong in your checkform javascript function .. probably you attach the name and value (by mistake) to eachother in there -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 12:16 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] post data? the form tag is form action=syn2.php method=post onSubmit=return checkform(this); Thx! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post data?
Thx a lot John. Red Hat 8.0 is bundled with Apache 2 + php 4.2 if i needed to use Red Hat 8.0, except upgrading both program to the latest version (which as u saidnot recommended) , any other combination of apache + php do u recommend? thx a lot! HPS John W. Holmes [EMAIL PROTECTED] ??? news:[EMAIL PROTECTED] ???... It's an Apache2 / PHP bug. Upgrade to the latest versions of each (although Apache2 and PHP are still not recommended). ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: esctoday.com | Wouter van Vliet [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:21 AM To: HPS; [EMAIL PROTECTED] Subject: RE: [PHP] post data? in that case,.. I guess something is going wrong in your checkform javascript function .. probably you attach the name and value (by mistake) to eachother in there -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 12:16 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] post data? the form tag is form action=syn2.php method=post onSubmit=return checkform(this); Thx! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE Pagelength issue
I found the problem. The script was creating each table within the previous table. Apparently there is a limit of 25 nested levels for IE. I separated each table and it loads all of them ok. Thanks John, Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2003 8:48 PM To: PHP List Subject: RE: [PHP] IE Pagelength issue Yes, the entire page is visible when selecting view source. And again, it does view ok in Mozilla. I will try breaking the table into smaller tables and see if that is it. I won't have access till Tuesday. If anyone has any other ideas feel free to throw in. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:37 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue If you view source in IE, do you see the entire page? If so, then it's an IE display issue. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 7:30 PM To: [EMAIL PROTECTED]; PHP List Subject: RE: [PHP] IE Pagelength issue Example is a page that displays the concerts and bands at each concert for a given spectator. Table one gives information on the spectator and has a field that lists the concert events he/she has been to. Table two lists concerts along with location information and date along with bands and then another table that lists band information. There are several loops, the first one is while $spectator... and within it a while $concert... and within it a while $band... So the resulting page can have user information then a list with concert bands, concert bands, concert bands, for each he/she has been to. The one we are having a problem with has 27 concerts and IE stops at 25 and Mozilla goes all the way to the 27th. I will try and split each concert into its own table. Just as a not each concert listed gives the option to edit the concert information and a way to edit the band information in addition to removing any one of them. So there are various buttons throughout. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 6:08 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue I am running into a strange problem. I have a script that parses a database for results. It cycles through the data one record at a time looking for matches to the query. Up til now I haven't had any problems as the results have been limited in length. Now I have one that has a significant length and the bottom is cut off on IE6. I haven't tried any earlier versions of IE but Mozilla loads the entire page without this problem. Has anyone run across this? Is there a way around it? Just as an additional note: the page has one continuous table so another potential problem would be a limit to the length of a table? Probably and IE feature of only being able to handle a certain table size. The way around it would be to end the table and start another every so many rows... or split your rows up into Prev/Next pages... Did I read correctly that you're selecting an entire database and then using PHP to match criteria? Are you using a WHERE clause to do the sorting? Sounds like you may be going about this the wrong way... if not, carry on. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not avalid MySQL result resource in f:\.....\none.php on line 286
On Mon, 9 Jun 2003, Thomas Seifert wrote: On Mon, 9 Jun 2003 07:35:16 -0300 [EMAIL PROTECTED] (Marcelo Luiz De Laia) wrote: I use phpnuke and it have a sql_layer.php. You are correct, for mysql is mysql_query. But this dont is the problem, I change it and the problem continue! Any tip?? I think you are mixing the layer and native functions. You should use ONE of these, either the layer from phpnuke OR the native functions. I don't know how the layer handles the results but from the layout you had it looks just wrong. The standard-way using native mysql_*-functions for a select (with some basic error checking) is as follows: It's one way, not standard imho :) My additions below are of course just one way out of many. In a production environment you won't be printing out mysql errors, or sql statements, but instead will give the user some pretty error. The code below is for a development environment and doesn't include a debug mode. The reason I use @ is because we are implementing our own error handling so having PHP print out the errors too isn't needed. So choose one or the other, PHP's errors or your own, or, turn down error reporting for the entire script but I'll just use @. The reason for the error is your are assuming $result is a valid MySQL result resource when it's not, it's most likely boolean false because for some reason (like the connection failed, couldn't select database, invalid query, etc) it's not valid. phpnuke is known for having crappy code so that's unfortunate for you but anyway the words below will explain how to avoid this error, or why it may exist. [... connection and so on ...] Making sure the connection and database selection works is pretty important too: $conn = @mysql_connect(host, user, pass); if (!$conn) { echo Could not connect to MySQL; exit; } if ([EMAIL PROTECTED]('dbname')) { echo Could not select database: . mysql_error(); exit; } $result = mysql_query(select * from ...); if(!mysql_error()) { echo mysql_error(); } Instead of calling mysql_error() twice, it's more common and efficient to check the return value of mysql_query() (in this case we put it in $result) as mysql_query returns boolean false on failure: $sql = SELECT foo, bar FROM sometable; if (!$result = @mysql_query($sql)) { echo Could not run query ($sql): . mysql_error(); exit; } And next, before fetching rows, make sure there are actually rows to fetch. Instead of my silly echo statement, consider including the search form again, or have them press the back button, or whatever: if (mysql_num_rows($result) 1) { echo No results match your query, please try again; exit; } Now it's finally time to fetch some rows as we now know that $result is a valid mysql resource and rows exist. This is the basic idea of checking if everything worked instead of just assuming everything will be perfect 100% of the time because it won't. Regards, Philip while($row=mysql_fetch_row($result)) { [... output ...] } You are either not transferring the result-identifier correctly or your query returns an error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post data?
Apache-1.3.x with whatever version of PHP you want. -Rasmus On Tue, 10 Jun 2003, Billy wrote: Thx a lot John. Red Hat 8.0 is bundled with Apache 2 + php 4.2 if i needed to use Red Hat 8.0, except upgrading both program to the latest version (which as u saidnot recommended) , any other combination of apache + php do u recommend? thx a lot! HPS John W. Holmes [EMAIL PROTECTED] ??? news:[EMAIL PROTECTED] ???... It's an Apache2 / PHP bug. Upgrade to the latest versions of each (although Apache2 and PHP are still not recommended). ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: esctoday.com | Wouter van Vliet [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:21 AM To: HPS; [EMAIL PROTECTED] Subject: RE: [PHP] post data? in that case,.. I guess something is going wrong in your checkform javascript function .. probably you attach the name and value (by mistake) to eachother in there -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 12:16 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] post data? the form tag is form action=syn2.php method=post onSubmit=return checkform(this); Thx! HPS Esctoday.Com | Wouter Van Vliet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What does your form tag look like? -Oorspronkelijk bericht- Van: HPS [mailto:[EMAIL PROTECTED] Verzonden: maandag 9 juni 2003 9:32 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] post data? Dear all, i am using PHP 4.2.2 with Red Hat 8.0 i had a form in form.php, which has a form like this input class=text type=text name=course_id size=10 maxlength=10 value= say, i enter 6 in the text box. After i click the submit button and i echo the value of course_id, it returned 6course_id=6, NOT 6 do you have any idea? thx a lot! HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Little help
Hi, I have a script that records the languange and time zone of every user that comes to the site. Currently I am testing this and need some people to just surf a couple pages in the site, from around the world. If you don't mind, please just see a page or two on this site. It doesn't matter anything else (you like it, do anything, etc) , I just need some browsers from outside the US to surf a page or two. www.basementideas.com/index.php TIA Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Yearbook script?
not based off anything...wrote it -Original Message- From: MIKE YRABEDRA [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 9:38 AM To: PHP List Subject: Re: [PHP] Yearbook script? on 6/9/03 8:58 AM, Edward Peloke at [EMAIL PROTECTED] wrote: What script is this based off? I agree, this would be like most gallery type pages... I also did a small demo page for a used vehicle dealership that could be usedyou just substitute the people for the cars...:) http:\\www.peloke.webhop.org -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 7:12 AM To: 'MIKE YRABEDRA'; 'PHP List' Subject: RE: [PHP] Yearbook script? Anyone know of a good yearbook script? One that will show a listing of photos, that when clicked on, will bring up a page with more info on the individual? I'm sure any gallery type script could be used for this. Just get one that allows comments for the pictures. Maybe adapt the commenting a little to support certain fields. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ++ Mike Yrabedra (President) 323 Incorporated Home of MacDock, MacAgent and MacSurfshop ++ W: http://www.323inc.com/ P: 770.382.1195 F: 734.448.5164 E: [EMAIL PROTECTED] I: ichatmacdock ++ Whatever you do, work at it with all your heart, as working for the Lord, not for men. ~Colossians 3:23 {{{ ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Automatic Headers and Footers
On Mon, 9 Jun 2003 07:21:45 -0500, Jay Blanchard wrote: I see what you are saying, but how much modification is too much? :) OK, another waythe HTML could be read into a page (fopen()) containing the header/footer stuff. You'd have to deal with identification of which page you want loaded, but shouldn't be too hard. Here is what I ended up doing http://marc.theaimsgroup.com/?l=php-generalm=105484835424858w=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Automatic Headers and Footers
On Mon, Jun 09, 2003 at 12:26:24PM -0500, Wendell Brown wrote: OK, another waythe HTML could be read into a page (fopen()) containing the header/footer stuff. You'd have to deal with identification of which page you want loaded, but shouldn't be too hard. Here is what I ended up doing http://marc.theaimsgroup.com/?l=php-generalm=105484835424858w=2 That works. I did something similar, not to add headers and footers, but to implement a simple templating system -- the HTML pages had text like __FIRSTNAME__ and __LASTNAME__ which had to be replaced with session variables. The site owner had some very strange ideas about how they wanted to design their site, and wanted to do the whole thing in FrontPage, yet customize pages using data from a PHP-based login. The basic idea is that the customer uploads pages (a few hundred of 'em) all under their DocumentRoot. I've got stuff like: $base=http://www.example.com;; // URL *without* trailing backslash $qu=' . ''; $href=(a href=[$qu ]*)($base)?/?([^$qu ]+\.html?); $repl=\\1/show.php?what=\\3; if (!file_exists($f)) { header(Location: $base/show.php?err=missing%20file:%20$f); } else if ($fd=file_get_contents($f)) { $fd = str_replace(__FIRSTNAME__, $_SESSION['fname'], $fd); $fd = str_replace(__LISTNAME__, $_SESSION['lname'], $fd); print $fd; } You could of course hide the URLs behind mod_rewrite with something like RewriteEngine On RewriteRule ^/.+\.php - [L] RewriteRule ^/(.+\.html) /show.php\?f=$1 [L] You could also make the arrays of the str_replace search and replace fields, if you had multiple things to change. But back to your issue -- Instead of __FIRSTNAME__ and __LASTNAME__, just manipulate body and /body, as you did with output buffering. I'm not sure if either solution has a performance edge over the other. In both cases, each of the HTML and PHP file get loaded once per page view, and whether the translation happens in PHP's output buffering or via mod_rewrite is probably insignificant. As always, multiple solutions to every problem. :) -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions, IE and pop-up windows
I'm working on a Calendar script right now that uses sessions. When a user clicks on the edit button a pop-up window appears so that the full calendar is still available along with the new event that's being editted. It works fine in Mozilla but in IE the pop-up window appears to log out the user. I've tried starting a new session_name in the pop-up window, but it doesn't seem to be working. It looks (basically) like this: edit.php session_name(edit); include(validate.php); if (session_name != edit) { session_name(website); } session_start(); Any suggestions on how I can use pop-up windows for editing and maintain a person's logged in status? thanks! emma -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session not working?
Hi, I'm I missing something? I'm trying to get data into a session (booking.php) and then print it off by a second page (test3.php). booking.php: $_REQUEST[submit]=isset($_REQUEST[submit])?$_REQUEST[submit]:; if($_REQUEST['submit']!=) { $dater=$_POST['$dater']; $aantalvol=$_POST['$aantalvol']; $aantalkind=$_POST['$aantalkind']; $aantalvol=addslashes($_POST['aantalvol']); session_start(); $_SESSION['dater'] = $dater; $_SESSION['aantalvol'] = $aantalvol; $_SESSION['aantalkind'] = $aantalkind; $_SESSION['1pk'] = $eenpk; $_SESSION['2pk'] = $tweepk; header( Location: test3.php ); } test3.php ? session_start(); echo $_SESSION['aantalvol']; ? I get page not be displayed... Even with the full URL in the HEADER section it doesn't work.. Some one can help me please? Txs, Frank
Re: [PHP] Session not working?
On Mon, Jun 09, 2003 at 08:08:18PM +0200, Frank Keessen wrote: I get page not be displayed... Even with the full URL in the HEADER section it doesn't work.. What's the URL of the page it's trying to find? i.e. what does the location bar on your browser say? Is it the right URL, or is it looking in the wrong directory for test3.php? emma -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
Hi, It's pointing towards the booking.php (which is the 'sender' page..) Exact error message: The Page cannot be displayed.. So it's no 404.. I think.. Frank - Original Message - From: Emma Jane Hogbin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 8:10 PM Subject: Re: [PHP] Session not working? On Mon, Jun 09, 2003 at 08:08:18PM +0200, Frank Keessen wrote: I get page not be displayed... Even with the full URL in the HEADER section it doesn't work.. What's the URL of the page it's trying to find? i.e. what does the location bar on your browser say? Is it the right URL, or is it looking in the wrong directory for test3.php? emma -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post data?
On Mon, 9 Jun 2003, Michael A Smith wrote: Get Apache 1.3.27 (I think). and PHP. Follow the instructions on the PHP site! I found that those are the only one's I could get to work. Any PHP version using --with-apxs=/usr/local/apache I couldn't get to work. Also take a look at what you'll need first and make sure you know what to compile with! You have to specify the full path to the apxs script. ie. --with-apxs=/usr/local/apache/bin/apxs or wherever it is. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to count memory used by a script
How do I count the memory usage of a script/page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
Use a browser that displays errors properly, like Mozilla. Frank Keessen wrote: Hi, It's pointing towards the booking.php (which is the 'sender' page..) Exact error message: The Page cannot be displayed.. So it's no 404.. I think.. Frank - Original Message - From: Emma Jane Hogbin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 8:10 PM Subject: Re: [PHP] Session not working? On Mon, Jun 09, 2003 at 08:08:18PM +0200, Frank Keessen wrote: I get page not be displayed... Even with the full URL in the HEADER section it doesn't work.. What's the URL of the page it's trying to find? i.e. what does the location bar on your browser say? Is it the right URL, or is it looking in the wrong directory for test3.php? emma -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/Apache - Problem with REMOTE_USER var.
Hello everyone, I have installed apache and PHP (using Windows :o(() on two computers, where httpd.conf and php.ini seem to be same. But, on one mashine is variable REMOTE_USER working well and on the second it is empty all the time, however apache auth.-function works well on both of them. (The computer, whitch is OK is using apache 1.32 and the bad comp. is using apache 2.0.X(?)... - if this information can help anyone to find the mistake)... Any idea, where is the problem? Thank you very much for any help!!! Pavel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Little help
I've just visited your web from Czech rep... Does your script work OK? :o)) Pavel Mike Mannakee [EMAIL PROTECTED] pí¹e v diskusním pøíspìvku news:[EMAIL PROTECTED] Hi, I have a script that records the languange and time zone of every user that comes to the site. Currently I am testing this and need some people to just surf a couple pages in the site, from around the world. If you don't mind, please just see a page or two on this site. It doesn't matter anything else (you like it, do anything, etc) , I just need some browsers from outside the US to surf a page or two. www.basementideas.com/index.php TIA Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote: It's pointing towards the booking.php (which is the 'sender' page..) Exact error message: The Page cannot be displayed.. So it's no 404.. I think.. Ah. So it's not even moving off the original page... I don't have your original script and it's not in the archives yet; however, are you using the right syntax for the header function? header(Location: http://www.example.com/;); Note that the Location must be uppercase L. -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to count memory used by a script
On Mon, 9 Jun 2003, Peter Berglund wrote: How do I count the memory usage of a script/page. As of 4.3.2, if you compile PHP with --enable-memory-limit you may use memory_get_usage(). This is documented and will show up when the next PHP manual is built. Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
Hi, The orignal code was in the first mail; again; $_REQUEST[submit]=isset($_REQUEST[submit])?$_REQUEST[submit]:; if($_REQUEST['submit']!=) { $dater=$_POST['$dater']; $aantalvol=$_POST['$aantalvol']; $aantalkind=$_POST['$aantalkind']; $aantalvol=addslashes($_POST['aantalvol']); session_start(); $_SESSION['dater'] = $dater; $_SESSION['aantalvol'] = $aantalvol; $_SESSION['aantalkind'] = $aantalkind; $_SESSION['1pk'] = $eenpk; $_SESSION['2pk'] = $tweepk; header( Location: test3.php ); } test3.php ? session_start(); echo $_SESSION['aantalvol']; ? Txs for the help, Frank - Original Message - From: Emma Jane Hogbin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 8:49 PM Subject: Re: [PHP] Session not working? On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote: It's pointing towards the booking.php (which is the 'sender' page..) Exact error message: The Page cannot be displayed.. So it's no 404.. I think.. Ah. So it's not even moving off the original page... I don't have your original script and it's not in the archives yet; however, are you using the right syntax for the header function? header(Location: http://www.example.com/;); Note that the Location must be uppercase L. -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
Hi, The original code: - Original Message - From: Emma Jane Hogbin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 8:49 PM Subject: Re: [PHP] Session not working? On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote: It's pointing towards the booking.php (which is the 'sender' page..) Exact error message: The Page cannot be displayed.. So it's no 404.. I think.. Ah. So it's not even moving off the original page... I don't have your original script and it's not in the archives yet; however, are you using the right syntax for the header function? header(Location: http://www.example.com/;); Note that the Location must be uppercase L. -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] condensing a list from MySQL
How about just fixing this so it'll be easier in the future? You should have a separate table where each keyword is in it's own row, with or without duplicates (depends if you want a count of how often the keyword is used), and an ID relating back to the article or whatever you have. I think, that the problem with duplicates can be solved by using distinct parametr in SQL-query whitch count each keyword only once, however it is there ten times... Pavel The process of creating the table and creating the array are about the same. The table will give you more flexibility, though, when the client starts asking for more stats. To use the array method, like you originally asked: $var = array(); $query = SELECT keyword FROM table; $rs = mysql_query($query); while($row = mysql_fetch_assoc($rs)) { $ar = explode(' ',$row['keyword']); array_merge($var,$ar); } $var = array_unique($var); $final_array = sort($var); To INSERT everything into a second table: $query = SELECT keyword FROM table; $rs = mysql_query($query); while($row = mysql_fetch_assoc($rs)) { $keywords = explode(' ',$row['keyword']); $insert_string = ' . implode(',',$keywords) . '; //assumes no ' characters in $keywords $query = INSERT INTO keywords_table VALUES ($insert_string); $rs2 = mysql_query($query); } Make the keywords column UNIQUE if you don't want duplicates, although it would probably be better to just leave duplicates in there and do a SELECT DISTINCT to remove them. Leaving them in there will allow you to produce more stats on which keywords are most popular, etc. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions, IE and pop-up windows
On Mon, Jun 09, 2003 at 09:26:45PM +0200, winst0n wrote: Hi, try to write a @session_start(); in ur popup windows... it will call the last session opened by the client. I already do thatboth the parent and the main window call a file which has the session_start in it. I believe the problem is that I have two windows open with the same session information. According to this page, tha'ts a problem: http://ca.php.net/manual/en/function.session-start.php benja at benja dot be 15-Apr-2003 12:45 Just for info, session_start() blocks if another PHP using the same session is still running in background. It seems it's waiting the other PHP to finish... and sometimes it can be a problem. Create 2 different sessions by setting 2 different names : session_name() solve the problem. Benja. -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
On Mon, Jun 09, 2003 at 09:01:49PM +0200, Frank Keessen wrote: The orignal code was in the first mail; again; $_REQUEST[submit]=isset($_REQUEST[submit])?$_REQUEST[submit]:; if($_REQUEST['submit']!=) { $dater=$_POST['$dater']; $aantalvol=$_POST['$aantalvol']; $aantalkind=$_POST['$aantalkind']; $aantalvol=addslashes($_POST['aantalvol']); session_start(); $_SESSION['dater'] = $dater; $_SESSION['aantalvol'] = $aantalvol; $_SESSION['aantalkind'] = $aantalkind; $_SESSION['1pk'] = $eenpk; $_SESSION['2pk'] = $tweepk; header( Location: test3.php ); } test3.php ? session_start(); echo $_SESSION['aantalvol']; ? It looks to me like you must have an error somewhere else. I pasted this PHP into a blank page and then tested it with: http://localhost/testing/test.php?submit=you the page correctly re-directed to test3.php The header() function can ONLY re-direct the browser to another page if *nothing* else has been printed/echoed to the browser. Can you check to make sure that this is the very first thing that is called on the page? emma -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading/writing the value of an UL/LI text value
Hi. I have a question regarding the DOM model. Does anyone know how to write to the UL/LI text value using the DOM model. I more or less can write to select/option attributes of the DOM. but I can't figure out how to write (or read) the text of a UL-LI attribute I'd like to be able to do something like: echo document.foo.element.LU.LI.text = dfdgd; ; (of course, using whatever the appropriate doument string would be...) Any pointers/code samples/web sites would be helpful Thanks Bruce [EMAIL PROTECTED] (925) 866-2790 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not working?
Dear all, Fixed it! Typed again the Header syntax and it worked! Also installed Mozilla! Thanks for the help! Frank - Original Message - From: Frank Keessen [EMAIL PROTECTED] To: Emma Jane Hogbin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, June 09, 2003 8:59 PM Subject: Re: [PHP] Session not working? Hi, The original code: - Original Message - From: Emma Jane Hogbin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 8:49 PM Subject: Re: [PHP] Session not working? On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote: It's pointing towards the booking.php (which is the 'sender' page..) Exact error message: The Page cannot be displayed.. So it's no 404.. I think.. Ah. So it's not even moving off the original page... I don't have your original script and it's not in the archives yet; however, are you using the right syntax for the header function? header(Location: http://www.example.com/;); Note that the Location must be uppercase L. -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading/writing the value of an UL/LI text value
This has nothing to do with PHP! Bruce Douglas wrote: Hi. I have a question regarding the DOM model. Does anyone know how to write to the UL/LI text value using the DOM model. I more or less can write to select/option attributes of the DOM. but I can't figure out how to write (or read) the text of a UL-LI attribute I'd like to be able to do something like: echo document.foo.element.LU.LI.text = dfdgd; ; (of course, using whatever the appropriate doument string would be...) Any pointers/code samples/web sites would be helpful Thanks Bruce [EMAIL PROTECTED] (925) 866-2790 -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: access a static variable of a class
Do you try with the global sentence ? . . . global $conf; $var = 'foo'; echo $var::$conf ; ? EF. On Mon, 09 Jun 2003 18:34:33 -0200 [EMAIL PROTECTED] (Aberindei) wrote: Hello, One line to say this is my first post here, I thought about posting in php-general, but ZE2 is in development, so... I want to access a static variable of a class, but I CANNOT use directly the class name, so class name is in a variable. To be clear: ?PHP class foo { static $conf = 'configuration variable'; } $var = 'foo'; echo $var::$conf ; ? this produces a parsing error... How could I do ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another Session Question
Hello all, I have php ver 4.1.1 running with register_globals() ON on my site. I am trying to use sessions to maintain state during a visit to the site. I have read thru the manual, but my mind is still cluttered with doubts. I understand that use of the $_SESSION global array will greatly add to the security of the site and will prevent variable poisoning. How do I register a session? The manual (http://www.php.net/manual/en/print/ref.session.php) says that there are 2 methods: Example 1. Registering a variable with $_SESSION. ?php session_start(); // Use $HTTP_SESSION_VARS with PHP 4.0.6 or less if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } ? --- Example 4. Registering a variable with register_globals enabled ?php if (!session_is_registered('count')) { session_register(count); $count = 0; } else { $count++; } ? - This is a snippet of the code that I am testing: ? session_start(); require_once('../Connections/MasterStream.php'); if ( $_POST['validuser'] ($_POST['password']) ) { mysql_select_db($database_MasterStream, $MasterStream); $query_Recordset1 = SELECT * FROM `admin` WHERE `admin`.username = $_POST['validuser'] AND `admin`.password = $_POST['password']; $Recordset1 = mysql_query($query_Recordset1, $MasterStream) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); if ($totalRows_Recordset1) { echo Success!br; if(!isset($_SESSION['validuser'])) $_SESSION['validuser'] = 0; else $_SESSION['validuser']++; } else{ echo Please try again laterbr; } } ? Thanks in advance, Pushpinder
[PHP] howto write a DOS file output into a file...
Hi, When I use my system command in PHP I can run a old EXE file. It makes an output and output is automaticly printing on the web browser. I wanna save this output at the same time into a txt. Anyone knows howto do it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another Session Question
So does your code work? Here's a tip: Try a simple example, like what's in the manual, and see which method works for you. If they both work, which one do you understand? Use that one... ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 4:23 PM Subject: [PHP] Another Session Question Hello all, I have php ver 4.1.1 running with register_globals() ON on my site. I am trying to use sessions to maintain state during a visit to the site. I have read thru the manual, but my mind is still cluttered with doubts. I understand that use of the $_SESSION global array will greatly add to the security of the site and will prevent variable poisoning. How do I register a session? The manual (http://www.php.net/manual/en/print/ref.session.php) says that there are 2 methods: Example 1. Registering a variable with $_SESSION. ?php session_start(); // Use $HTTP_SESSION_VARS with PHP 4.0.6 or less if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } ? --- Example 4. Registering a variable with register_globals enabled ?php if (!session_is_registered('count')) { session_register(count); $count = 0; } else { $count++; } ? - This is a snippet of the code that I am testing: ? session_start(); require_once('../Connections/MasterStream.php'); if ( $_POST['validuser'] ($_POST['password']) ) { mysql_select_db($database_MasterStream, $MasterStream); $query_Recordset1 = SELECT * FROM `admin` WHERE `admin`.username = $_POST['validuser'] AND `admin`.password = $_POST['password']; $Recordset1 = mysql_query($query_Recordset1, $MasterStream) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); if ($totalRows_Recordset1) { echo Success!br; if(!isset($_SESSION['validuser'])) $_SESSION['validuser'] = 0; else $_SESSION['validuser']++; } else{ echo Please try again laterbr; } } ? Thanks in advance, Pushpinder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions, IE and pop-up windows
- Original Message - From: Emma Jane Hogbin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 1:08 PM Subject: Re: [PHP] sessions, IE and pop-up windows On Mon, Jun 09, 2003 at 09:26:45PM +0200, winst0n wrote: Hi, try to write a @session_start(); in ur popup windows... it will call the last session opened by the client. I already do thatboth the parent and the main window call a file which has the session_start in it. I believe the problem is that I have two windows open with the same session information. According to this page, tha'ts a problem: http://ca.php.net/manual/en/function.session-start.php benja at benja dot be 15-Apr-2003 12:45 Just for info, session_start() blocks if another PHP using the same session is still running in background. It seems it's waiting the other PHP to finish... and sometimes it can be a problem. Create 2 different sessions by setting 2 different names : session_name() solve the problem. Benja. I'll bet you're using an onLoad command to launch the popup aren't you. Use Output Buffering to keep stdout from flushing before the parent script dies. If my assumption about onLoad is correct then that'll solve your problem. HTH, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: howto write a DOS file output into a file...
look at ob_start() function. HTH R'twick Ferhat Bingol [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, When I use my system command in PHP I can run a old EXE file. It makes an output and output is automaticly printing on the web browser. I wanna save this output at the same time into a txt. Anyone knows howto do it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions, IE and pop-up windows
On Mon, Jun 09, 2003 at 02:27:50PM -0600, Kevin Stone wrote: I'll bet you're using an onLoad command to launch the popup aren't you. Use Output Buffering to keep stdout from flushing before the parent script dies. If my assumption about onLoad is correct then that'll solve your problem. Um not onload the link looks like this: a onclick='openEdit(add=eventamp;cellid=10); return false;' onkeypress='openEdit(add=eventamp;cellid=10); return false;'href='edit.php?add=eventamp;cellid=10'Add an event/a and the javascript looks like this: // its goal is to EDIT any type of content in a pop-up window function openEdit(params) { var url = editsmall.php?+params; var ewin = window.open(url, ewin, width=500,height=300,toolbar=0,resizable=1,scrollbars=1); ewin.focus(); } -- Emma Jane Hogbin [[ 416 417 2868 ][ www.xtrinsic.com ]] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and flash chat program
Hey, I need some advice if anyone is willing to offer it. I have a chat program I am working on. The interface is built in flash, and it uses PHP also. There is a main chat area where the users type their messages back and forth, and there is also a smaller area which displays all of the currently logged-in users. When a user logs into the chat room, it adds their nickname to a users.txt file, which creates a list of all the online users and is then displayed in the chat page. I also have a logoff button that will search for the users nickname in the users.txt file and remove it, so that it won't be displayed in the chat window anymore. The only problem I am having is that if a user doesn't click on the logoff button and instead just closes the internet window or shuts off their computer, then their nickname will still appear in the list of users, since it wouldn't get a chance to be removed by the logoff button. I'm not sure how to accomplish this, I would appreciate any help you can offer me. Thanks a lot. Matt
Re: [PHP] Re: move_uploaded_file 1MB
Another thing a noticed was that when I comment the line wich uploads the file, it still give me the same error, saying server was not found. I think, maybe, the amount of memory enabled for each object of the form is limited by 1Mb. I got that idea because I use the following script: print path: $fuploadbr\n; print name: $fupload_namebr\n; print size: $fupload_size bytesbr\n; print type: $fupload_typep\n\n; if ( $fupload_type == image/gif ) { copy ( $fupload, $file_dir/$fupload_name) or die (Couldn't copy); } The fupload is the file object from the previous form page. Maybe if that object cannot be more than 1mb so it shows that page. Is it right or I am going crazy with it??? If so (i'm right :) ), where can I change it? I tried to set LimitRequestFieldSize to 1024000 but when i restarted Apache it said Iniciando httpd: Syntax error on line 139 of /etc/httpd/conf/httpd.conf: LimitRequestFieldsize 1024000 must not exceed the precompiled maximum of 8190 If this is the way i have to go... what can I do? Thaks!!! Maurício Valente Mike Ford [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] -Original Message- From: Maurício Valente [mailto:[EMAIL PROTECTED] Sent: 05 June 2003 21:56 I couldn't find the option max_body_request somebody knows where it is? There's no such option -- you could be looking for post_max_size in php.ini, or the LimitRequestBody directive in Apache's httpd.conf or a .htaccess file. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about current() and key()
Does anybody know any benifits to using current() and key() I will show two examples of what I mean. ?php echo PRE; $arr1 = array(array(1 = 10), array(2 = 12), array(3 = 13), array(4 = 14), array(5 = 15), array(6 = 16), array(7 = 17), array(8 = 18), array(9 = 19) ); foreach ( $arr1 AS $value ) { echo pow(key($value) , current($value)).\n; } $arr2 = array(1 = 10, 2 = 12, 3 = 13, 4 = 14, 5 = 15, 6 = 16, 7 = 17, 8 = 18, 9 = 19 ); foreach ( $arr2 AS $key = $value ) { echo pow($key , $value).\n; } ? Now for me, these return the same results. I would think that it would be overhead to use current() and key() in the above example. Can anybody point out why the first one would be better to use and why. Jim Lucas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP using Linter...
Hi Everyone! Have anyone here ever use the Linter software? What is your opinion on this? Have anyone experienced compiling Apache/PHP with Linter and was it easy to use? Have anyone experienced writing a PHP script to access the Linter? All of those questions, is it giving you a headache or is it a very nice experience? I already downloaded the Linter demo and been using it for a day or two. I'm having trouble trying to make the SQL query work for the sample database that come with the demo. I have not yet compile Apache and PHP to Linter yet because I want to become familiar with Linter first. It's like playing with database software to understand how to use it and manage it. Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about current() and key()
On Mon, 2003-06-09 at 14:38, Jim Lucas wrote: Does anybody know any benifits to using current() and key() See below: I will show two examples of what I mean. ?php echo PRE; $arr1 = array(array(1 = 10), array(2 = 12), array(3 = 13), array(4 = 14), array(5 = 15), array(6 = 16), array(7 = 17), array(8 = 18), array(9 = 19) ); foreach ( $arr1 AS $value ) { echo pow(key($value) , current($value)).\n; } $arr2 = array(1 = 10, 2 = 12, 3 = 13, 4 = 14, 5 = 15, 6 = 16, 7 = 17, 8 = 18, 9 = 19 ); foreach ( $arr2 AS $key = $value ) { echo pow($key , $value).\n; } ? Now for me, these return the same results. I would think that it would be overhead to use current() and key() in the above example. Can anybody point out why the first one would be better to use and why. No, you're right. There are situations where you might want to use these two functions, but this isn't one of them. Doesn't buy you a thing in this situation. :) There are times I've found them useful, though, although I won't contrive an example for you...you'll usually know when you've found one. Jim Lucas -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php