[PHP] Upload problem
Hi All, it's my first post here. I've got a problem with the upload. I want to upload a 4Mo file on the server but it refuses to work. I modified the max_upload_size in the php.ini but it continues to refuse the transfer. If I upload a smaller file it works fine. Someone told me to modify the MAX_FILE_SIZE constant but I don't find it. I need help, Thanks Fred from Paris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] best postgreSQl host
Hi, I am looking for Web host that offers the best deal plus postgreSQL support. Could anyone come up with the best one? The best deal would include Telnet access and cost as low as round $15/per month. Thanks. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: arguments against php / mysql?
We have just taken a contract for a dedicated server, and I tried rather hard to get it to be a Linux server. The killer for that was that we have a significantly complex site that will need to be migrated to the server which has been coded in asp - which leaves us rather stuck with Windows and IIS. I stared this hard in the face and asked questions about the cost of recoding before being reluctantly persuaded this had to be. So that being the case, am I picking up the message that the criticisms are basically correct? ie. no-one ought to start from here, but if you're forced to use IIS (because asp won't work with anything else) then php / mysql is not going to be the way to go (xxx are proposing coldfusion / sqlserver). But there is really no point in switching from ASP to CF. What are you hoping to gain? Going from one dead-end proprietary system to another which both try to lock you into their technologies seems pointless to me. Is ASP not working? Why not just stick with that? Why not get a low-cost Linux server as well and slowly start migrating things? -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: arguments against php / mysql?
Sorry - I'm being clear as mud! We have an existing site which will need to live on the server - I'm looking at new development. The two don't need to work on the same thing - there's no question of recoding that site as coldfusion. - M Rasmus Lerdorf [EMAIL PROTECTED] 04/11/02 08:37am But there is really no point in switching from ASP to CF. What are you hoping to gain? Going from one dead-end proprietary system to another which both try to lock you into their technologies seems pointless to me. Is ASP not working? Why not just stick with that? Why not get a low-cost Linux server as well and slowly start migrating things? -Rasmus This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] String?
see what's wrong here: ereg('(^[0-1231]$).jpg$',$file_name) [] meens a group of characters, so in your case 0,1,2 and 3 are valid characters. you haven't defined any modifer like ?,*,+ or{}, so one of this characters has to be found exactly one time. you're using ^ outside the [] so it meens the beginning of the string. in your case none of these characters inside the [] can be found at the beginning of the string. then you use $ after the []. $ meens the end of the string. none of the characters in the [] matches at the end of the string. so this would be right: ereg('_[0-9]{4}\.jpg$', $file_name); so this meens: the beginning of the string doesn't matter, because we have not specified ^ at the beginning. there has to be an underscore, followed by 4 characters between 0 and 9, followed by an dot, followed by j, followd by p, followed by g. g has to be at the end of the string, because of the $. or you can use: ereg('^\.*_[0-9]{4}\.jpg$', $file_name); this will meen : any characters at the beginning between 0 and unlimited times, then followed by an underscore, followed by 4 characters between 0 and 9, followed by a dot, followed by jpg. same as above though. But the * is a real performance eater so it could be slightly faster if you're using the first example. Jas [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I hate to say it but that didn't work, I have been trying different variations of the same ereg('_(^90-9{4}$).jpg$',$file_names) and nothing seems to work for me, I have also been looking at the ereg and preg_ereg functions but they don't seem to make sense to me, here is the code as a whole if this helps: // query directory and place results in select box $dir_name = /path/to/images/directory/on/server/; // path to directory on server $dir = opendir($dir_name); // open the directory in question $file_lost .= pFORM METHOD=\post\ ACTION=\done.php3\ NAME=\ad01\ SELECT NAME=\image_path\; while ($file_names = readdir($dir)) { if ($file_names != . $file_names !=.. ereg('_(^[0-9]{4}.jpg$)', $file_names)) // filter my contents { $file_lost .= OPTION VALUE=\$file_names\ NAME=\$file_names\$file_names/OPTION; } } $file_lost .= /SELECTbrbrINPUT TYPE=\submit\ NAME=\submit\ VALUE=\select\/FORM/p; closedir($dir); What I am trying to accomplish is to list the contents of a directory in select box but I want to filter out any files that dont meet this criteria *_.jpg and nothing is working for me, any help or good tutorials on strings would be great. Jas Erik Price [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday, April 11, 2002, at 05:59 AM, jas wrote: Is this a correct string to show only files that look like so: *_.jpg if ($file_names != . $file_names !=.. ereg('(^[0-1231]$).jpg$',$file_name)) Any help would be great. preg_match(/^_[0-9]{4,4}\.jpg$/, $file_name) should match any string that starts with an underscore, is followed by exactly four digits, and then a .jpg. It will not match anything but this exact string. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Getting values of duplicate keys in array
typo in the querystring, this should work, i suppose $queryString = SELECT count(m.*) parxdocs m.$sureName, m.$preName, m.$title, m.prax, p.$town, p.$zip, p.$phone, p.$description FROM $medTable m, $praxTable p WHERE m.$prax = p.$id GROUP BY m.prax, m.$preName, m.$sureName, m.$title, p.$town, p.$zip, p.$phone, p.$description ORDER BY m.$prax, m.$preName; Michael Virnstein [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ok, here we go. you normaly say this i suppose: while ($row = mysql_fetch_array($result) { //your html inserts here } if you'd use oracle, i'd suggest using a cursor, but you're using MySql, so you probably have to do it a bit different: (Not tested, could contain some errors!!!) // you'll now have the number of doctors in one praxis in praxdocs $queryString = SELECT count(m.*) parxdocs m.$sureName, m.$preName, m.$title, p.$town, p.$zip, p.$phone, p.$description FROM $medTable m, $praxTable p WHERE m.$prax = p.$id GROUP BY m.prax, m.$preName, m.$sureName, m.$title, p.$town, p.$zip, p.$phone, p.$description ORDER BY m.$prax, m.$preName; // then output the html while ($row = mysql_fetch_array($result)) { // we don't need the first one, because we already have it. echo {$row[title]} {$row[preName]} {$row[sureName]}br; for ($i = 1; $i $row[praxdocs]; $i++) { $doctor = mysql_fetch_array($result); echo {$doctor[title]} {$doctor[preName]} {$doctor[sureName]}br; } // rest of the output using $row here } hope that helps Christoph Starkmann [EMAIL PROTECTED] schrieb im Newsbeitrag B120D7EC8868D411A63D0050040EDA77111BE9@XCHANGE">news:B120D7EC8868D411A63D0050040EDA77111BE9@XCHANGE... Hi folks! The following problem: I got a db (mysql) with information about doctors. Name, adress, phone etc. Now I'm reading these information with a simple mysql-query: $queryString = SELECT DISTINCT m.$sureName, m.$preName, m.$prax, m.$title, ; $queryString .= p.$town, p.$zip, p.$phone, p.$description ; $queryString .= FROM $medTable m, $praxTable p WHERE ; $queryString .= m.$prax = p.$id; Normally, I print out the information like this: Dr. med. John Doe // $title, $preName, $sureName (shared practice) // description Elmstreet 13 // $street 666 Amityville 23 // $zip, $town phone: 0049 - 815 - 4711 // $phone Okay. Now some of these folks are sharing a practice ($description in the above code == shared practice). I would like to have these grouped together like this: Dr. med. John Doe // $title, $preName, $sureName Dr. med. Allan Smithee (shared practice) // description Elmstreet 13 // $street 666 Amityville 23 // $zip, $town phone: 0049 - 815 - 4711 // $phone I am starting to get a little confused right here and right now. This is the reason for being THIS detailed, too ;) Don't want to mix anything up. How would you achieve this goal fastest and best? Creating a temp array and checking for double $description-s which I store in the temp array and delete from the original one? Or check this with the original array? How? I found functions to get the value for one key in a hash, but not for several values with the same key... Sorry for the confusion, starting to get fuzzy... Any ideas, hints? Thanx alot, Kiko -- It's not a bug, it's a feature. christoph starkmann mailto:[EMAIL PROTECTED] http://www.gruppe-69.com/ ICQ: 100601600 -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD library
I have downloaded the GD library and I am wondering how do I install it.. I unzipped it and put it my root. I have PHP version 4.1.1...what else is there to do? Does anybody have any script for me to test it real quick? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache 2.0
How to install PHP on Apache 2.0 server? Sincerely Marcin Pasieka
[PHP] popen(); problem, the function don`t finds the command......
Hi!! i`ve wrote a little script to run under shell, so this script: #!/usr/bin/php $saslpasswd = /usr/sbin/saslpasswd -p $username; $saslproc = popen($saslpasswd,w); fputs($saslproc, $passwd); pclose($saslproc); php-parser gives me the following as output: # sh: /saslpasswd: No such file or directory # what i`m doing wrong?? please help. bye -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Making graphics
Here is what I want to do. I am taking a poll and I would like to display the results in a bar graph format. What is the best way to do this.hopefully you will not say GD library! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending HTML from PHP with 'mail' as a cron job
$headers = Content-type: text/html\n; $fromEmail = urlencode( $dbQuery-adminEmail ); $subject = Your new eStore is ready!; $message = img src=\somedomain.com/images/estore.jpg\brbr::name::, brYour new eStore is ready at a href=\http://woodenpickle.com/shop\;http://woodenpickle.com/shop/a.brY ou can open the admin panel for it at the following link:brbra href=\http://woodenpickle.com/shop/admin.php\; http://woodenpickle.com/shop/admin.php/a brbrYou should receive another email with the temp login and pass later today.\n; $result = mysql_query( SELECT * FROM customers ); while( $data = mysql_fetch_row( $result ) ) { print . ; $newMessage = str_replace( ::name::, $data-firstName, $newMessage ); $if( mail( $data-emailAddress, $subject, $newMessage, ${headers}From: $fromEmail ) ) { $count++; } } echo( Done. ); Stefen Lars [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello all I have a script called 'report.php' that generates a report in HTML. This report must be created at regular intervals; hence I have set up a cron job to call that script. The output of 'report.php' must be sent by e-mail. I use the following command: /usr/bin/lynx -source http://server.com/report.php | mail -s Report [EMAIL PROTECTED] This works fine. The result of report.php is sent to [EMAIL PROTECTED] However, the results do not appear as HTML in the e-mail client, but as text. This is due to the fact that the headers saying 'This is HTML' are missing from the e-mail message sent. Does anyone know how it is possible to get 'mail' to add suitable headers to the above command, so that the receiving e-mail client knows that it is getting an HTML and not a text message? Any help would be gratefully received. TIA. S. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] String?
and i'd suggest using eregi instead, because then also .Jpg or .JPG will be found. Michael Virnstein [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... see what's wrong here: ereg('(^[0-1231]$).jpg$',$file_name) [] meens a group of characters, so in your case 0,1,2 and 3 are valid characters. you haven't defined any modifer like ?,*,+ or{}, so one of this characters has to be found exactly one time. you're using ^ outside the [] so it meens the beginning of the string. in your case none of these characters inside the [] can be found at the beginning of the string. then you use $ after the []. $ meens the end of the string. none of the characters in the [] matches at the end of the string. so this would be right: ereg('_[0-9]{4}\.jpg$', $file_name); so this meens: the beginning of the string doesn't matter, because we have not specified ^ at the beginning. there has to be an underscore, followed by 4 characters between 0 and 9, followed by an dot, followed by j, followd by p, followed by g. g has to be at the end of the string, because of the $. or you can use: ereg('^\.*_[0-9]{4}\.jpg$', $file_name); this will meen : any characters at the beginning between 0 and unlimited times, then followed by an underscore, followed by 4 characters between 0 and 9, followed by a dot, followed by jpg. same as above though. But the * is a real performance eater so it could be slightly faster if you're using the first example. Jas [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I hate to say it but that didn't work, I have been trying different variations of the same ereg('_(^90-9{4}$).jpg$',$file_names) and nothing seems to work for me, I have also been looking at the ereg and preg_ereg functions but they don't seem to make sense to me, here is the code as a whole if this helps: // query directory and place results in select box $dir_name = /path/to/images/directory/on/server/; // path to directory on server $dir = opendir($dir_name); // open the directory in question $file_lost .= pFORM METHOD=\post\ ACTION=\done.php3\ NAME=\ad01\ SELECT NAME=\image_path\; while ($file_names = readdir($dir)) { if ($file_names != . $file_names !=.. ereg('_(^[0-9]{4}.jpg$)', $file_names)) // filter my contents { $file_lost .= OPTION VALUE=\$file_names\ NAME=\$file_names\$file_names/OPTION; } } $file_lost .= /SELECTbrbrINPUT TYPE=\submit\ NAME=\submit\ VALUE=\select\/FORM/p; closedir($dir); What I am trying to accomplish is to list the contents of a directory in select box but I want to filter out any files that dont meet this criteria *_.jpg and nothing is working for me, any help or good tutorials on strings would be great. Jas Erik Price [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday, April 11, 2002, at 05:59 AM, jas wrote: Is this a correct string to show only files that look like so: *_.jpg if ($file_names != . $file_names !=.. ereg('(^[0-1231]$).jpg$',$file_name)) Any help would be great. preg_match(/^_[0-9]{4,4}\.jpg$/, $file_name) should match any string that starts with an underscore, is followed by exactly four digits, and then a .jpg. It will not match anything but this exact string. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] constructors in derived classes
On Thursday, April 11, 2002, at 02:17 PM, Andrey Hristov wrote: In PHP the programmer has to call the constructor of the super class. The derived class has to know the name of his super(java syntax). In PHP5 the constructor will have unified name, there will not be a need the derived class to know super class name. Andrey, Thank you for the detailed explanation. So to sum it up, you need to call the base class's constructor from within the extended class's constructor if you want the effect of both constructors happening at once, as the extended class is instantiated into an object. I've noticed that it -is- possible to call the base class's constructor from the script, like this: // classes are Base and Extended $instance($arg1) = new Extended; // directly access the base class's constructor $instance-Base($arg2); and it seems to work. But this is really just shortchanging yourself the value of having a constructor in Base, since you are calling it as a method and not using its automaticness feature. Thanks again, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pass variables via URL
I'm trying to set $image = imageA via a URL: http://www.abc123.com/php001/image_switch.php?image=imageA Script is: html head titleImage Switch/title /head body div align=centerimg src=?php $image ?.gif width=150 height=100 border=0/div /body /html Image link ends up as: http://www.abc123.com/php001/.gif Link needs to be: http://www.abc123.com/php001/imageA.gif What am I doing wrong? Thanks Craig [EMAIL PROTECTED]
Re: [PHP] Image Uploading not taking place
At 10:53 AM +0800 12/4/02, Manisha wrote: if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { copy($HTTP_POST_FILES['userfile']['tmp_name'], /img); Check to see whether that copy function completed successfully. how ? I put one echo statement after copy which is displaying but never uploading the file. http://www.php.net/manual/en/function.copy.php I'd be surprised if you really want to move the file to /img. And if you're on a Unix system the web server certainly won't have write access to the / directory. i tried with complete path starting from root (/usr/web/html/img) and also with virtual (/img/). Is there any extra param setting ? any access rights ? The web server must have write and execute access to the directory in which you are creating the new file. In general the web server runs with no privileges, so the directory must be world-writable. This is the reason uploaded images are generally dumped into a database. Bad news having world-writable files/directories scattered all around. Try creating the file in /tmp as a test. ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image Uploading not taking place
On Friday 12 April 2002 10:53, Manisha wrote: I'd be surprised if you really want to move the file to /img. And if you're on a Unix system the web server certainly won't have write access to the / directory. i tried with complete path starting from root (/usr/web/html/img) and also with virtual (/img/). Is there any extra param setting ? any access rights ? Check that the webserver has execute rights to each of the directories from /usr, /usr/web/... through to .../html/img STILL NOT GETTING LOADED. ANYTHING ELSE ? Please don't shout. Am I ? I do not think so. It is just an EMPHASIS. Using ALLCAPS is considered rude. A word here and there is OK but a whole 2 sentences would annoy some people. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I don't wish to appear overly inquisitive, but are you still alive? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse Error using an include class
Hello, This is my first question to the list, I have included as much information as I feel will help someone find a solution to my problem. Server: RedHat Linux 7.0, Kernel 2.2.16-22 PHP Version: 4.1.0 Apache Version: 1.3.12 Class name: class.Htpasswd.php3 Problem I have just started using classes, downloaded from www.thewebmasters.net web site. I am working on user authentication and I am getting a parse error when the page loads. Only since I started using the class has this parse error occurred, but I am not sure if it the class that is causing the problem or not. I have included sections that I feel are relevant from my httpd.conf, php.ini and locations and contents of my .htpasswd files. File Locations: php config script - php.ini - /usr/local/lib/php.ini password flat file - .htpasswd - /var/www/html/private/.htpasswd include directory - - /var/www/html/php/includes include class name - class.Htpasswd.php3 ** start php file to validate user * html head titleQuick Validate Using Htpasswd Class/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body ?php include(class.Htpasswd.php3); $aHTPasswd = new Htpasswd(/var/www/html/private/.htpassd); if (!$aHTPasswd-EXISTS) { print(authentication errorbr); } else { // try to debug by printing to the screen // echo( passes check for aHTPasswd-EXITS); if ( $aHTPasswd-verifyUser( phpbook, phpbook ) ) { print( phpbook is a valid userbr ); } else { print( phpbook is not a valid userbr ); } } ? /body /html ** end php file to validate user * The following is from my http.conf file. ** start section of httpd.conf file * ### Section 1: Global Environment ServerType standalone ServerRoot /etc/httpd Port 80 User apache Group apache ServerAdmin andrew@fremont ServerName 192.168.2.2 DocumentRoot /var/www/html Directory / Options FollowSymLinks AllowOverride None /Directory Directory /var/www/html Options Indexes Includes FollowSymLinks # Changed 4-5-02 AllowOverride Limit # Changed 4-2-02 AllowOverride All #AllowOverride None AllowOverride Limit # # Controls who can get stuff from this server. # Order allow,deny Allow from all /Directory ** end section of httpd.conf file * My php.ini file listing all directives, include towards the end. ** start php.ini file * engine = On short_open_tag = On asp_tags = Off precision= 14 y2k_compliance = Off output_buffering = Off output_handler = zlib.output_compression = Off implicit_flush = Off allow_call_time_pass_reference = On safe_mode = Off safe_mode_gid = Off safe_mode_include_dir = safe_mode_exec_dir = safe_mode_allowed_env_vars = PHP_ safe_mode_protected_env_vars = LD_LIBRARY_PATH disable_functions = highlight.string = #CC highlight.comment = #FF9900 highlight.keyword = #006600 highlight.bg = #FF highlight.default = #CC highlight.html= #00 max_execution_time = 30 ; Maximum execution time of each script, in seconds memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) error_reporting = E_ALL ~E_NOTICE display_errors = On display_startup_errors = Off log_errors = Off track_errors = Off warn_plus_overloading = Off include_path = .:/php/includes doc_root = user_dir = extension_dir = ./ enable_dl = On file_uploads = On upload_max_filesize = 2M ** end php.ini file * Here is the details from my .htaccess file that I have installed inside the folder I want protected. The user ahelis has been added to the ../../private/.htpasswd successfully. ** start .htaccess file * AuthUserFile ../../private/.htpasswd AuthGroupFile /dev/null AuthName ByPassword AuthType Basic Limit GET require ahelis /Limit ** end .htaccess file * On a side note, if someone can check my .htaccess permissions as compared to the directives set in my httpd.conf file, I would appreciate knowing if I have other problems. I hope the solution is something that I have over looked or miss configured. Any assistance is appreciated. Andrew Schoenherr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chechking to see if a directory already exists
On Friday 12 April 2002 05:29, Kevin Stone wrote: Wouldn't it be more helpful to assume that the individual is simply uninformed? So isntead of flaming him and calling him stupid you could say, Check the PHP manual at www.php.net. Nobody called him/her stupid. In fact it's probably a very bright individual, getting others to do their work for them ;) -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Better dead than mellow. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] the document contained no data
odd, I copied your code, changed the dir to ./ and it works for me (php4.0.?, winnt) if dir() doesn't work for you, you might need to use opendir(), readdir(), etc -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 2:14 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data Sorry, the file has ; I retype it wrong, I did set error_reporting but no change, but in the httpd error log file I found exit signal segmentation fault (11) Martin Towell wrote: is that a direct copy of your code - if it is, you're missing a ; after $entry=$d-read() but that wound have stopped the first one... to set error level to E_ALL, use: error_reporting(E_ALL); or set it in your php.ini file error_reporting = E_ALL -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 12:31 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data I don't know how to set erro level to E_ALL, can you give me some sample. I did try different way ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; $entry=$d-read() echo $entry ; $d-close(); ? it is ok and the output is only a dot(.) if I add another read() statement then I got ... no data ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; $entry=$d-read() echo $entry ; $entry=$d-read() echo $entry ; $d-close(); ? can anyone tell me what has read() has and readdir() return. Martin Towell wrote: turn the displaying of errors on, and set the error level to E_ALL I'm thinking that you've got a error somewhere that's stopping the script prematurely -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] the document contained no data Hi, I am trying to read the files in the directory and display them . but I got the message the document contained no data this is my code ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; while($entry=$d-read()) { echo $entry.br\n; } echo hr; $d-close(); ? Can anyone tell me what should I do to correct it. I would like some help, thank in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error using an include class
On Thursday 11 April 2002 14:30, Andrew Schoenherr wrote: [snip] Problem I have just started using classes, downloaded from www.thewebmasters.net web site. I am working on user authentication and I am getting a parse error when the page loads. Only since I started using the class has this parse error occurred, but I am not sure if it the class that is causing the problem or not. I have included sections that I feel are relevant from my httpd.conf, php.ini and locations and contents of my .htpasswd files. [snip] Whilst it is commendable in providing detailed information about a setup when posting a question, it is best to restrict this to OS version, PHP version webserver version. You seemed to left out the MOST important piece of info which is what line the parse error occurs at. Post an extract of your code, just the 5-10 lines leading up to and including the line on which the error occurs. Also don't just say the error occurs at line 15, *indicate* which is line 15. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The mosquito exists to keep the mighty humble. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Forms in PHP
On Friday 12 April 2002 09:19, Jennifer Downey wrote: Actually after the submit button is clicked it returns a blank page. Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, Now I have a weird problem. I am using this code and can't understand why it doesn't work. When the script is run it returns a blank page, no error or done. here it is and any help would be appreciated. if(($type == book) or ($type == weapon)){ echo form action=\$PHP_SELF\ method=\post\; echo SELECT NAME=\sort\ SIZE=\1\; echo OPTION VALUE=\shop\Put in my shop/OPTION; echo OPTION VALUE=\locker\Put into my Footlocker/OPTION; echo OPTION VALUE=\discard\Discard this item/OPTION; echo OPTION VALUE=\donate\Donate this item/OPTION; echo /SELECT; echo INPUT TYPE=\submit\ VALUE=\Do It!\submit\; You haven't given your submit button a name... if(isset($submit)) Thus this test fails and you get no output. May I also suggest that you rewrite your echo statements as: echo 'OPTION VALUE=donateDonate this item/OPTION'; Vastly improves legibility. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* It was all so different before everything changed. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] the document contained no data
I also try the following code and still have the same problem. I am runing php4.0.?, solaris(linux) $dir_name = /export/home/phuynh/php/main/student/upload/; $dir = opendir($dir_name); while (false !== ($file_names = readdir($dir))) { echo $file_names; } closedir($dir); Martin Towell wrote: odd, I copied your code, changed the dir to ./ and it works for me (php4.0.?, winnt) if dir() doesn't work for you, you might need to use opendir(), readdir(), etc -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 2:14 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data Sorry, the file has ; I retype it wrong, I did set error_reporting but no change, but in the httpd error log file I found exit signal segmentation fault (11) Martin Towell wrote: is that a direct copy of your code - if it is, you're missing a ; after $entry=$d-read() but that wound have stopped the first one... to set error level to E_ALL, use: error_reporting(E_ALL); or set it in your php.ini file error_reporting = E_ALL -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 12:31 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data I don't know how to set erro level to E_ALL, can you give me some sample. I did try different way ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; $entry=$d-read() echo $entry ; $d-close(); ? it is ok and the output is only a dot(.) if I add another read() statement then I got ... no data ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; $entry=$d-read() echo $entry ; $entry=$d-read() echo $entry ; $d-close(); ? can anyone tell me what has read() has and readdir() return. Martin Towell wrote: turn the displaying of errors on, and set the error level to E_ALL I'm thinking that you've got a error somewhere that's stopping the script prematurely -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] the document contained no data Hi, I am trying to read the files in the directory and display them . but I got the message the document contained no data this is my code ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; while($entry=$d-read()) { echo $entry.br\n; } echo hr; $d-close(); ? Can anyone tell me what should I do to correct it. I would like some help, thank in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] the document contained no data
At 10:33 PM 4/11/2002 Thursday, Phieu Huynh wrote: I also try the following code and still have the same problem. I am runing php4.0.?, solaris(linux) $dir_name = /export/home/phuynh/php/main/student/upload/; $dir = opendir($dir_name); while (false !== ($file_names = readdir($dir))) { echo $file_names; } closedir($dir); Your while statement needs to read. while (false != ($file_names = readdir($dir))) { echo $file_names; } Not !== But != Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] the document contained no data
!== is correct - it's checking for type, as well as value strict non-equality -Original Message- From: Phillip S. Baker [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 3:38 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data At 10:33 PM 4/11/2002 Thursday, Phieu Huynh wrote: I also try the following code and still have the same problem. I am runing php4.0.?, solaris(linux) $dir_name = /export/home/phuynh/php/main/student/upload/; $dir = opendir($dir_name); while (false !== ($file_names = readdir($dir))) { echo $file_names; } closedir($dir); Your while statement needs to read. while (false != ($file_names = readdir($dir))) { echo $file_names; } Not !== But != Phillip -- 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] the document contained no data
does that code work if you set the directory path to ./ ? -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 3:33 PM To: Martin Towell Cc: [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data I also try the following code and still have the same problem. I am runing php4.0.?, solaris(linux) $dir_name = /export/home/phuynh/php/main/student/upload/; $dir = opendir($dir_name); while (false !== ($file_names = readdir($dir))) { echo $file_names; } closedir($dir); Martin Towell wrote: odd, I copied your code, changed the dir to ./ and it works for me (php4.0.?, winnt) if dir() doesn't work for you, you might need to use opendir(), readdir(), etc -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 2:14 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data Sorry, the file has ; I retype it wrong, I did set error_reporting but no change, but in the httpd error log file I found exit signal segmentation fault (11) Martin Towell wrote: is that a direct copy of your code - if it is, you're missing a ; after $entry=$d-read() but that wound have stopped the first one... to set error level to E_ALL, use: error_reporting(E_ALL); or set it in your php.ini file error_reporting = E_ALL -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 12:31 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] the document contained no data I don't know how to set erro level to E_ALL, can you give me some sample. I did try different way ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; $entry=$d-read() echo $entry ; $d-close(); ? it is ok and the output is only a dot(.) if I add another read() statement then I got ... no data ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; $entry=$d-read() echo $entry ; $entry=$d-read() echo $entry ; $d-close(); ? can anyone tell me what has read() has and readdir() return. Martin Towell wrote: turn the displaying of errors on, and set the error level to E_ALL I'm thinking that you've got a error somewhere that's stopping the script prematurely -Original Message- From: Phieu Huynh [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] the document contained no data Hi, I am trying to read the files in the directory and display them . but I got the message the document contained no data this is my code ? $d = dir(/export/home/phuy/www/test/upload); echo Handle: .$d-handle.br; echo Path: .$d-path.br; while($entry=$d-read()) { echo $entry.br\n; } echo hr; $d-close(); ? Can anyone tell me what should I do to correct it. I would like some help, thank in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- Phieu (phil) Huynh Computer System Officer Monash University Electrical Computer Systems Engineering Phone : +61 3 990 53469 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Variable wildcards
Following on the same subject (kinda) of Variable Variables... i have actually wondered this before... is there a difference between these 2 blocks?? (both should print worldhello if i am not mistaken, but is there a difference in how the nested variable is handled when it's inside curly braces?): $a = hello; $hello = world; print($$a.$a); -- and -- $a = hello; $hello = world; print(${$a}.$a); -Original Message- From: Jason Bell [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 7:33 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Variable wildcards This would certainly work, but I got a suggestion for using select name=array[] multiple that i think will be a much cleaner solution. Thanks! - Original Message - From: Philip Hallstrom [EMAIL PROTECTED] To: Jason Bell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 4:10 PM Subject: Re: Variable wildcards If you want to process the list when they submit the form you can do something like this: foreach($_REQUEST as $key = $value ) { if( ereg(user([0-9]*), $key, $match_ary) ) { #go crazy; } } ?? -philip On Thu, 11 Apr 2002, Jason Bell wrote: Yeah, I thought so too, but variable variables doesn't seem to provide for this to add a little bit of detail to what I am doing, it is a user list, and I want to have a check box next to each user so that you can select 1 or more users for deletion. Each checkbox will be named User$id ($id of course being the numerical id of the user in the database) I did try doing somehting like $User{ereg ([0-9])} but it doesn't seem to work, or I'm doing it wrong. I guess maybe an easier way is if I could somehow drop all of the selected id's into an array? Then I wouldn't need to worry about needing to determine which variables exist. - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: Jason Bell [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 3:44 PM Subject: Re: Variable wildcards Sounds like what you want is Variable Variables. http://www.php.net/manual/en/language.variables.variable.php - Original Message - From: Jason Bell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 4:24 PM Subject: Variable wildcards are there wildcard characters for variables? Lets say that I have a varable that always starts with $user but then has the 2 digit user id attached to the end, so it could be $user12 or $user28 is there a way to grab these? sort of like in unix standards, where I could use user?? or user* ? 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