[PHP] com obj from php
Hi all; Does anyone know if ti is possible or not to create a com object from php?? cheers :o) Steve. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search For File
Hello, I am trying to write a simple application using PHP on a Windows 2000 server. There is one text box for input and one search button. Basically the user would input a file name (for example "help.pdf") and then the php script would search a directory (for example "c:\help\") and subfolders for that file. If the file is found, I would like to automatically display the file using Adobe Acrobat. Ideally I would like to be able to use wildcards and obtain a list of results linking to the files. Any ideas on a good way to do this? I am mainly interested in how the search should work. Thanks Jamie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP CONTRACT ROLE IN BERKSHIRE, UK
PHP developer required with good SQL (MySQL preferred), HTML and Linux open source operating systems experience for contract in Berkshire. Experience of data analysis, requirements analysis and technical documentation an advantage as is any knowledge of Oracle databases. Role is to develop a cost accounting application which will sit on a web server linked to an oracle database. . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP5 for Fedora Core 2
C.F. Scheidecker Antunes wrote: > Hello all, > Are there any pre compiled rpm packages from Fedora Core 2 yet? > If not, I will most likely built it myself. > Thanks. Any chance you can send it to me when you finish? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Automatically run a php page once a day
Hello everybody, Can someone help me saying how i can run a php script automatically once in a day. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help with $HTTP_RAW_POST_DATA
Hi all, I am using a Debian server with all stable packages so PHP is version 4.1.2 I was developing a SyncML server and was using $HTTP_RAW_POST_DATA as a receiving container for incoming SyncML communication from my Sony Ericsson T-616. Recently finished writing the WBXML convertor and are working with the SyncML engine. Everything was working fine until i wanted to try to update to PHP5, but there aren't any officially unstable/experiment PHP5 from Debian. So i got mine from DotDeb.org. Everything worked but then $HTTP_RAW_POST_DATA suddenly is not receiving any data. I recall reading in the PHP manual that $HTTP_RAW_POST_DATA is disabled, i enabled it by setting always_populate_raw_post_data = On. It did not work, so i removed PHP5 and reinstalled the stable version of PHP which is 4.1.2 $HTTP_RAW_POST_DATA is still not receiving any data. I looked into PHP 4.1.2's php.ini file and didn't see any parameter setting for always_populate_raw_post_data which is not surprising since the default disable is only active after 4.2.0 I added that line anyway and restarted Apache, still the $HTTP_RAW_POST_DATA is not working. I know that XML RPC uses this global variable for parsing XML data as well, so it should be empty. Anyone know what is going on and how to fix it? It was working fine before i upgraded and then it was just broken after that. Since $HTTP_RAW_POST_DATA is going to be disabled by default, is there a better variable to be used for receiving communication data? I noticed php://input but that's going to be changed to php://filter, but i have never tried using that before either. So i have no idea how it works. If anyone can help me reactivate $HTTP_RAW_POST_DATA or find a better way to grab communication data, please HELP!! Thank you in advance Regards Mian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open all subdirectories in a directory
Hello Professionals, Can anybody help me to open all subdirectories in a directory, I used is_dir() to check whether it is a dir, and if yes, I recursively called it with the new dir name. But all subdirectories are not open the recursion is not working for more than 1 level. I tested it in windows server. Expecting your help, Jacob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open all subdirectories in a directory
Hello Professionals, Can anybody help me to open all subdirectories in a directory, I used is_dir() to check whether it is a dir, and if yes, I recursively called it with the new dir name. But all subdirectories are not open the recursion is not working for more than 1 level. I tested it in windows server. Expecting your help, Jacob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open all subdirectories in a directory
Hello Professionals, Can anybody help me to open all subdirectories in a directory, I used is_dir() to check whether it is a dir, and if yes, I recursively called it with the new dir name. But all subdirectories are not open the recursion is not working for more than 1 level. I tested it in windows server. Expecting your help, Jacob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] code
Codes attached. In this page i used filetype instead of is_dir. $file"; } } } closedir($dh); } } } getfiles($dir); ?> Hope you can help me. Thanks. John Holmes wrote: > PHPDiscuss - PHP Newsgroups and mailing lists wrote: > > Hello Professionals, > > Can anybody help me to open all subdirectories in a directory, > > I used is_dir() to check whether it is a dir, and if yes, > > I recursively called it with the new dir name. > > But all subdirectories are not open the recursion is not working for more > > than 1 level. > > I tested it in windows server. > > Expecting your help, > Expecting your code... > Have you looked at the opendir manual page to see if there are any > examples, there? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SOMETIMES, my SID gets embedded in the URL ???
I tried ini_set('session.use_only_cookies', "1"). I also tried ini_set('session.use-trans-sid', 0). Right after I made the change, the sid was gone, urls didn't contain it anymore, BUT, the next day, today, when I accessed the site from my office (another computer), the SID is there again! And this is exactly like when I first added ini_set('session.use_only_cookies', "1") : before the addition the sid was sometimes there, after the addition it wasn't. Few days later it was there again. Then I added ini_set('session.use-trans-sid', 0) and it was ok, today it's not. Don't know what to believe anymore... The strange thing is, phpinfo() says session.use_only_cookies is ON and session.use_trans_sid likewise. So if session.use_trans_sid is on, why do I lose my session after redirecting to a relative url ? The docs say that "relative URIs will be changed to contain the session id automatically". Also when I access the forums on my site (IPB), the sid isn't embedded. So my question is: if session.use_only_cookies is ON, why on earth is the sid present in the url ? PS: php is version 4.3.8. Marek Kilimajer wrote: > PHPDiscuss - PHP Newsgroups and mailing lists wrote: > > he problem is that SOMETIMES, my SID gets embedded in the URL, although at > > the begining of every page I have this code: > > > > ini_set(session.use_only_cookies, "1"); > The above sets sessionuse_only_cookies to 1. I did not miss a dot, > session and use_only_cookies are interpreted as constants. You need quotes: > ini_set('session.use_only_cookies', "1"); > > session_set_cookie_params(60*60); > > session_start(); > > session_register("blabla"); > > if (!$_SESSION["logged_in"]) > > session_destroy(); > > etc, etc; > > > > So there are days/times when the SID isn't embedded in the URL (and in the > > links of the page), and days/times when it is, regardless of what value > > $_SESSION["logged_in"] has. > > I tested the value returned by ini_set and it's always different from > > false. > > What gives ??? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SimpleXML: DOM, SAX or Other?
Hi, Does anybody have any depthful knowledge of the SimpleXML extension in PHP5?.. More accurately, do you know if the simpleXml->xpath() method uses DOM, SAX or some other method of parsing a loaded XML document? I ask because I am trying to parse arbitrary XML documents as efficiently as possible (avoiding DOM). Kieran -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOMETIMES, my SID gets embedded in the URL ???
he problem is that SOMETIMES, my SID gets embedded in the URL, although at the begining of every page I have this code: ini_set(session.use_only_cookies, "1"); session_set_cookie_params(60*60); session_start(); session_register("blabla"); if (!$_SESSION["logged_in"]) session_destroy(); etc, etc; So there are days/times when the SID isn't embedded in the URL (and in the links of the page), and days/times when it is, regardless of what value $_SESSION["logged_in"] has. I tested the value returned by ini_set and it's always different from false. What gives ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SOMETIMES, my SID gets embedded in the URL ???
Wow, thank you, it was so obvious! Marek Kilimajer wrote: > PHPDiscuss - PHP Newsgroups and mailing lists wrote: > > he problem is that SOMETIMES, my SID gets embedded in the URL, although at > > the begining of every page I have this code: > > > > ini_set(session.use_only_cookies, "1"); > The above sets sessionuse_only_cookies to 1. I did not miss a dot, > session and use_only_cookies are interpreted as constants. You need quotes: > ini_set('session.use_only_cookies', "1"); > > session_set_cookie_params(60*60); > > session_start(); > > session_register("blabla"); > > if (!$_SESSION["logged_in"]) > > session_destroy(); > > etc, etc; > > > > So there are days/times when the SID isn't embedded in the URL (and in the > > links of the page), and days/times when it is, regardless of what value > > $_SESSION["logged_in"] has. > > I tested the value returned by ini_set and it's always different from > > false. > > What gives ??? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] List() help
I'm using list like list($a,$b,$c,$d) = $MyArray MyArray holds more than three items, 0-4 more, my problem is that $d only gets one and I lose the others if more tha one extra. I know I can just add more $e,f,g,h,i but how do I get the extras into an array? TIA RGauthier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to verify PHP has been installed with ldap?
Bing, Run If you don't see a section for LDAP, it's not installed. In a Windows XP, PHP 4.3.6 environment, installed in C:/Program Files/PHP,I had to change a working default installation as follows to get it to work: Add to php.ini: extension_dir = C:/Program Files/PHP/extensions/ extension=php_ldap.dll ldap.max_links = -1 Copy C:\Program Files\PHP\php.ini to C:\WINDOWS Restart Apache to make sure your new ini file controls. You should see the options in your ini file reflected in the phpinfo display. Copy C:\Program Files\PHP\php4ts.dll to C:\WINDOWS. Copy from C:\Program Files\PHP\extensions to C:\Windows\System32 php_ldap.dll libeay32.dll ssleay32.dll Copy all the dlls in C:/Program Files to C:\Windows\System32 Good luck! Bing Du wrote: > Greetings, > I've installed PHP with ldap. But I got this error "Fatal error: Call to > undefined function: ldap_connect() in /home/me/public_html/test1.php on > line 5". Why ldap_connect() is undefined? > This is what I did: > == > # ./configure --with-apxs=/usr/local/apache/bin/apxs > --with-config-file-path=/usr/local/apache/php.ini --with-mysql --with-zlib > --with-ldap > # make > # make install > == > It went through without obvious errors. > And this is the PHP script test1.php that generates the above error: > > $dn="cn=john smith, ou=Users, ou=eng,dc=iastate, dc=edu"; > $password = "ok4now"; > if (!($ldap = ldap_connect("w2kdc1.eng.some.edu", 389))) { > die ("Could not connect to LDAP server"); > } > if (!($res = @ldap_bind($ldap, $dn, $password))) { > die ("Could not bind to $dn"); > } > echo "bind fine!"; > ?> > > So my question is how to verify PHP has been installed with ldap support? > Thanks in advance for any help, > Bing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 4.3.7 update - how to
Alan McDonald wrote: > > > I've downloaded the 4.3.7 tar ball and extractted it. I've run configure > > > (after deleting the cache), no errors. I've run make - no errors, I've > then > > > run make install.. no errors, it says it's updating and installing. > > > Now I've restarted my httpd service - I've even rebooted but I'm left > with > > > phpinfo telling me that version 4.2.2 is running. > > > I'm in RH9 and I have no idea why it doesn't install properly.. > > > Can someone shed some light on this? > > > > Not sure if it's relevant, but does httpd.conf point to the new version? > > It's all I have to tweak in Windows. > > > > -- > > Lester Caine > I must be missing something critical here... I was thinking that the make > install would overwrite the PHP executables but it obviously doesn't .. > Now where in the conf file does the PHP module get mentioned? I;ve searched > it with no mention of PHP! > Alan Did you remember to uninstall the RPM? I believe you must do this first before a source install. But I would use the same configuration options as your 4.2.2 install, as RH tends to have special places for special things. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DAYLIGHT SAVINGS TIME OR NOT
You could also use the php date() function. date('I'); If you need it for a specific date, then date('I',$timestamp); Curt Zirzow wrote: > * Thus wrote Chirag Shukla: > > > > This function can be used to know whether it is Daylight Savings time or > > not for the given date. It may not be the most optimized program, but > > may be helpful. > > > > If there is a modified code, please let me know. > ok. > > > > > > > // here is the date. We wont worry about the time. > > $processdate = "07/04/2004 14:45"; > What about different formats like 07-04-2004 14:45:00 > > > > // calling the function. > > // 1 means the date is in a daylight savings time > > // 0 means the date is not in a daylight savings time > one thing to note, not all zones, even in the US honor the > DST. this is a rather sepecific function. > > echo daylight($processdate); > > > > // now the function > > > > function daylight($mydate) > > { > > // separating the date and time > > $datetime = explode(" ",$mydate); > > > > // exploding the components of date > > $dateexplode = explode("/",$datetime[0]); > Instead of exploding stuff around, make your date argument compatible > with the strtotime() function, it will return a unix timestamp or > -1 if it fails to parse the date. > > > > // if the date is between Jan-Mar, NO DAYLIGHT > > // if the date is between Nov-Dec, NO DAYLIGHT > > if ($dateexplode[0]<4 or $dateexplode[0]>10) > > { > > return 0; > > } > > // if the date is not in the above zone, lets see > > // if the date is between May-Sep, DAYLIGHT > > elseif ($dateexplode[0]>4 and $dateexplode[0]<10) > > { > > return 1; > > } > Since you have a timestamp as I suggested above, you simply need > to pull the month out, and then check the month value: > $month = strftime('%m', $utimestamp); > swtich ($month) { > case '01': case '02': ... >return 0; > case '05': case '06': ... >return 1; > } > > else > > { > > // we are going to pull out what date is a sunday > > // then we compare our date's day-of-month with the > > day-that-is-sunday > > > > $interestday = 0; > > > > // lets see what happens in april - first sunday of the month > > if ($dateexplode[0]==4) > > { > > // looping the first seven days to see what day is a > > sunday > > for ($i=1; $i<=7; $i++) > > { > > $myday = > > > > date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2])); > > if ($myday==0) > > $interestday = $i; > > } > > > > // now that we got what day is a sunday, lets see > > // if our date's day-of-month is greater than this > > or not > > // if it is greater, then DAYLIGHT > > if ($dateexplode[1]>=$interestday) > > return 1; > > else > > return 0; > > } > > > > // lets see what happens in october - last sunday of the > > month > > elseif ($dateexplode[0]==10) > > { > > // looping the first seven days to see what day is a > > sunday > > for ($i=25; $i<=31; $i++) > > { > > $myday = > > > > date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2])); > > if ($myday==0) > > $interestday = $i; > > } > > > > // now that we got what day is a sunday, lets see > > // if our date's day-of-month is greater than this > > or not > > // if it is less, then DAYLIGHT > > if ($dateexplode[1]<=$interestday) > > return 1; > > else > > return 0; > > } > > } > now instead of doing all that mundane work, we simply have to > find out if the days are outabounds for the paticular months. > // obtain the day of month > $dayofmonth = (int)strftime('%d', $utimestamp); > // and the day of week > $dayofweek = strftime('%u', $utimestamp); > if ($month == '04') { > // If its the first week of 04 > if ($dayofmonth <= 7) { > // and we havn't reached sunday, return 0 > return ($dayofweek < 7) ? 0: 1; > } > return 1; // otherwise we're passed it. > }
[PHP] shell_exec and accents
Hi, I'm using shell_exec to call a command that can return accented characters. Unfortunately the accented characters are being transformed into other characters instead (for example, an acute e becomes a ','). How can I get the real output? I'm running on Windows 2000. In the command prompt the command returns the accents correctly. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec and accents
Hi, I'm using shell_exec to call a command that can return accented characters. Unfortunately the accented characters are being transformed into other characters instead (for example, an acute e becomes a ','). How can I get the real output? I'm running on Windows 2000. In the command prompt the command returns the accents correctly. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Inconv in PHP5 compile
I'm having PHP5 compile problems as well. Here's some shortened output from commands giving a picture of my problem. The first thing that troubles me is vi giving this output: [EMAIL PROTECTED] php-5.0.0RC1]# vi ext/mysql/php_mysql.c "ext/mysql/php_mysql.c" 2514L, 70348C Error detected while processing modelines: line 2512: E518: Unknown option: fdm=marker Hit ENTER or type command to continue I ran into this after: [EMAIL PROTECTED] php-5.0.0RC1]# gcc --version gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) .. [EMAIL PROTECTED] php-5.0.0RC1]# ./configure --with-apsx2=/usr/local/apache2/bin/apxs --with-mysql=/data/sw/mysql-4.0.18 .. [EMAIL PROTECTED] php-5.0.0RC1]# make .. .. gcc -Iext/mysql/ -I/data/sw/php-5.0.0RC1/ext/mysql/ -DPHP_ATOM_INC -I/data/sw/php-5.0.0RC1/include -I/data/sw/php-5.0.0RC1/main -I/data/sw/php-5.0.0RC1 -I/data/sw/php-5.0.0RC1/Zend -I/usr/include/libxml2 -I/data/sw/mysql-4.0.18/include -I/data/sw/php-5.0.0RC1/TSRM -g -O2 -c /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c -o ext/mysql/php_mysql.o && echo > ext/mysql/php_mysql.lo In file included from /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:59: /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.h:51:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:72:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:82:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:86:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:90:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:101:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:122:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:181:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:376:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function `php_mysql_do_connect': /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: syntax error at '@' token /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: syntax error at '@' token /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: `MYSQL_TCP_PORT' undeclared (first use in this function) /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: (Each undeclared identifier is reported only once /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: for each function it appears in.) /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:485:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:502: error: syntax error at '@' token /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:502: error: syntax error at '@' token /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:639:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:666:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:674: warning: comparison between pointer and integer /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:703:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:706: error: `handler' undeclared (first use in this function) /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:715:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:718: warning: comparison between pointer and integer /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:726:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:771:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:779: warning: comparison between pointer and integer /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1123:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1259:5: token "@" is not valid in preprocessor expressions /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function `zif_mysql_result': /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1779: warning: assignment from incompatible pointer type /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function `php_mysql_fetch_hash': /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1949: warning: assignment from incompatible pointer type /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function `zif_mysql_fetch_lengths': /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:2135: warning: assignment from incompatible pointer type make: *** [ext/mysql/php_mysql.lo] Error 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: Eregi multi-line question
$cacheTime) { $file = fopen ("local file", "r"); if (!$file) { $dump = "Does not exist"; } else { while (!feof ($file)) { $line = fgets ($file); if (eregi ('', $line, $pt)) { $cntrp=$cntrp+1; $post[$cntrp]=$pt[1]; } if (eregi ('' . '(.+)' . '', $line, $brd)) {$cntrb=$cntrb+1; $board[$cntrb]=$brd[1]; } if (eregi ('icons/arrow.gif" width=17 height=11 border = 0>' . '(.+)' . '', $line, $trd)) { $cntrt=$cntrt+1; $thread[$cntrt]=$trd[1]; } if (eregi ('' . '(.+)' . '', $line, $dtme)) { $cntrd=$cntrd+1; $datetime[$cntrd] = $dtme[1]; } if (eregi ('' . '[.+]' '', $line, $cont)) { $cntrc=$cntrc+1; $content[$cntrc] = $cont[1]; } } ... ?> Alright, within the above code my final if (eregi) line is giving me problems. All 3 of the lines before work, and work great, but the problem I run into on the final one is newlines. For example, here's a snippet of the directed file that I'm trying to obtain from: Hello World. ~Me :) As you can see, there are multiple newlines in there, and I need to place the entire snippet between and into a variable array. My largest problem is that not every instance of said code has the same number of endlines, but they do ALL have endlines in there. Any help here? - Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: eregi multi-line Question
$cacheTime) { $file = fopen ("local file", "r"); if (!$file) { $dump = "Does not exist"; } else { while (!feof ($file)) { $line = fgets ($file); if (eregi ('', $line, $pt)) { $cntrp=$cntrp+1; $post[$cntrp]=$pt[1]; } if (eregi ('' . '(.+)' . '', $line, $brd)) {$cntrb=$cntrb+1; $board[$cntrb]=$brd[1]; } if (eregi ('icons/arrow.gif" width=17 height=11 border = 0>' . '(.+)' . '', $line, $trd)) { $cntrt=$cntrt+1; $thread[$cntrt]=$trd[1]; } if (eregi ('' . '(.+)' . '', $line, $dtme)) { $cntrd=$cntrd+1; $datetime[$cntrd] = $dtme[1]; } if (eregi ('' . '[.+]' '', $line, $cont)) { $cntrc=$cntrc+1; $content[$cntrc] = $cont[1]; } } ... ?> Alright, within the above code my final if (eregi) line is giving me problems. All 3 of the lines before work, and work great, but the problem I run into on the final one is newlines. For example, here's a snippet of the directed file that I'm trying to obtain from: Hello World. ~Me :) As you can see, there are multiple newlines in there, and I need to place the entire snippet between and into a variable array. My largest problem is that not every instance of said code has the same number of endlines, but they do ALL have endlines in there. Any help here? - Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot retrive the data ???
Hi there, Look at the following code please. I have a mysql db setup and apache running. I have the register_globals=OFF on the php.ini file. The code is suppose to show all the jokes in the databse and give user to enter jokes. The code works fine when when the register_globals=ON in the php.ini file. But for some reason it does not work when it is OFF. Infact when it is OFF it give a blank page with no data retrieved from the databse and gives no errors. Please help me.Code is below..." Type your joke : "; } else { echo "Joke NOT entered. An error occured while entering"; } $color1 = "#CCFFCC"; $color2 = "#BFD8BC"; $row_count = 0; // -- Following lines list the jokes echo " These are the jokes we have got so far"; $db = mysql_connect("localhost","homesite","951753") or die(mysql_error()); mysql_select_db("jokes",$db); $sql = "SELECT id, JokeText, JokeDate from jokes"; $query = mysql_query($sql); echo " ID Joke Text Joke Date"; while ($myrow = mysql_fetch_array($query)) { $row_color = ($row_count % 2) ? $color1 : $color2; echo"". "". $myrow["id"]."". "". $myrow["JokeText"]. "". "". $myrow["JokeDate"].""; // echo "".$myrow["id"]."-- ". $myrow["JokeText"]. " ". $myrow["Name"]." ".$myrow["Email"]. ""; $row_count++; } echo("" ."Add a Joke!"); } ?> "Cheers Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot retrive the data ???
Hi there, Look at the following code please. I have a mysql db setup and apache running. I have the register_globals=OFF on the php.ini file. The code is suppose to show all the jokes in the databse and give user to enter jokes. The code works fine when when the register_globals=ON in the php.ini file. But for some reason it does not work when it is OFF. Infact when it is OFF it give a blank page with no data retrieved from the databse and gives no errors. Please help me.Code is below..." Type your joke : "; } else { echo "Joke NOT entered. An error occured while entering"; } $color1 = "#CCFFCC"; $color2 = "#BFD8BC"; $row_count = 0; // -- Following lines list the jokes echo " These are the jokes we have got so far"; $db = mysql_connect("localhost","homesite","951753") or die(mysql_error()); mysql_select_db("jokes",$db); $sql = "SELECT id, JokeText, JokeDate from jokes"; $query = mysql_query($sql); echo " ID Joke Text Joke Date"; while ($myrow = mysql_fetch_array($query)) { $row_color = ($row_count % 2) ? $color1 : $color2; echo"". "". $myrow["id"]."". "". $myrow["JokeText"]. "". "". $myrow["JokeDate"].""; // echo "".$myrow["id"]."-- ". $myrow["JokeText"]. " ". $myrow["Name"]." ".$myrow["Email"]. ""; $row_count++; } echo("" ."Add a Joke!"); } ?> "Cheers Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: __PHP_Incomplete_Class Errors...
Stephen Craton wrote: > I've been working on a script for a while now and it works perfectly on my > local machine. I'm using a couple of classes, mainly my database and users > classes. > After logging in, I assign a session variable to the user's row in the > database: $_SESSION['user'] = $db->row; > This works fine locally, but on my hosted machine, it settings the variable > to this: > __PHP_Incomplete_Class Object > ( > [__PHP_Incomplete_Class_Name] => users > [user] => > [loggedin] => 1 > [ip] => 12.222.81.78 > [db] => __PHP_Incomplete_Class Object > ( > [__PHP_Incomplete_Class_Name] => thedatabase > [host] => localhost > [user] => melchior_clients > [pass] => > [data] => melchior_clients > [linkid] => 0 > [res] => 0 > [num] => 0 > [row] => > [logger] => __PHP_Incomplete_Class Object > ( > [__PHP_Incomplete_Class_Name] => logger > [logdir] => logs/ > [fp] => > ) > ) > [logger] => __PHP_Incomplete_Class Object > ( > [__PHP_Incomplete_Class_Name] => logger > [logdir] => logs/ > [fp] => > ) > ) > For some reason, as far as I can tell, it's making every class variable to > __PHP_Incomplete_Class for some reason. The way I'm accessing the classes > via another class this something like this: > $db = new theDatabase; > $user = new Users; > $user->db = $db; > And then, within the class, I access it as such: > $this->db->query($sql); > This works perfectly on my local machine, but it gets all weirded once I > upload it. I have NO idea why or how to fix it. Does anyone have any ideas? > > Stephen Craton > [EMAIL PROTECTED] > IM: [EMAIL PROTECTED] > http://www.melchior.us > I had the same problem when storing objects in the session, this link will tell you how to solve your problem http://lists.evolt.org/archive/Week-of-Mon-20031027/150721.html rgs, Nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php mail
I have a dedicated Red Hat linux boxed leased from Interland and the php mail function does not work. I have found several articles on things to try and have tried everything I saw but to no avail. I set up a php script to mail and then print the return code and I get a 1 (success). But the mail never arrives. Is there any way I could get some help with this. I could post my phpinfo() information or anything else that may help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php mail
I have a dedicated Red Hat linux boxed leased from Interland and the php mail function does not work. I have found several articles on things to try and have tried everything I saw but to no avail. I set up a php script to mail and then print the return code and I get a 1 (success). But the mail never arrives. Is there any way I could get some help with this. I could post my phpinfo() information or anything else that may help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php Mail not working properly
I have a dedicated Red Hat linux boxed leased from Interland and the php mail function does not work. I have found several articles on things to try and have tried everything I saw but to no avail. I set up a php script to mail and then print the return code and I get a 1 (success). But the mail never arrives. Is there any way I could get some help with this. I could post my phpinfo() information or anything else that may help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forms on PHP
Hi, I am new to this or any newsgroup in PHP, as well as PHP itself, so this question is probably rather elementary. I have a form which on clicking on the "Submit" button calls up a compiled program on the server that is executed and writes output to a file. This file is then read by the PHP script and passed on for other processes. When the page is first loaded, it knows that the "Submit" button has not been clicked, and after clicking the button it knows, which is of course what we want. The problem is that subsequently it always thinks the button has been clicked, even if the reload button on the browser has been clicked. Here is a cut down version of the code, where for brevity I have removed all inputs other than n: Type in the following parameters: '; unset($form_submitted); } } else echo 'The form has not been submitted'; The input value of $n is picked up from $n=$_POST['n'] which has the default of 1000, and I test that "Submit" has been clicked by looking at the state of $form_sumbitted. Unfortunately this only works the first time the page is loaded, and subsequently it is always flagged as set. This is a test for only writing some text below the form if it has been clicked. Subsequently, when the page is refreshed or is clicked again with new data, the text below the form should disappear until the calculations have been completed. The form is implimented at http://proteus.as.arizona.edu/~csharp/sudarsky/lightcurvec.php . I would be very grateful for some kind help on this. Christopher Sharp http://csharp.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forms on PHP
Leon Poon wrote: > Refer to the following line numbers: > 01 > 02 > // Start of PHP code - Extract values from form. > 03 > /* Other values read */ > 04 > $n=$_POST['n']; > 05 > > 06 > // Pass the data from the form to lightcurve_csharp > 07 > $command="./lightcurve_csharp $a $i $e $lomega $bomega $lambda $n"; > 08 > $result=`$command`; > 09 > > 10 > $form_submitted=$_POST['form_sumbitted']; > 11 > if (isset($form_submitted)) { > 12 >if ($form_submitted) { > 13 >echo 'The form has been submitted'; > 14 >unset($form_submitted); > 15 >} > 16 > } else > 17 >echo 'The form has not been submitted'; > When the user first load the page, no data was posted. So there was no > $_POST['form_sumbitted'] available. Line 10 will cause $form_submitted to > contain the NULL value (I think). $form_submitted will evaluate to FALSE at > line 12. Thus it will not display any message. > By the way, by doing line 10, $form_submitted would have been set regardless > whether there is $_POST['form_sumbitted'], and line 11 will evaluate to TRUE > always. Thus you will never ever see the 'form not been submitted' message. > Anyway, when you posted for the first time, $_POST['form_sumbitted'] is > available. The 'The form has been submitted' message will be printed. > After that, when you press Reload button on the browser, the post data will > once again be sent from the user. (This is the behaviour of reloading a > posted page. In Internet Explorer there should be a message dialog box > asking the user whether to resend form data in order to refresh.) Reposting > the data during the reload means that there will be > $_POST['form_sumbitted'], thus once again the 'form hass been submitted' > message. > In order to prevent this from happening, you should do a header('Location: > success-page.php') on a successful submit. This is so that at the redirected > page, the user would not have resent data even if he press the Reload > button. > Hope this helps > -Leon Many thanks - at the top of the file I put in the code: if ($_POST['submit']) header('Location: .../submitted.php'); where further down in the form I have name="submit" for the submit button. This goes to a new page submitted.php. The code is in fact now at http://proteus.as.arizona.edu/~csharp/lightcurved.php . No doubt there is still a way of writing back to the original page after the submit button has been clicked, but I can't see an easy way, so this will have to do for now. A work-around is to do it in frames, and write to a frame at the bottom so that it appears to be in the same page. Christopher Sharp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 404 custom handler on a cgi-wrap PHP - No input specified error
Luke Barker wrote: > I have made a 404 custom error handler, using .htaccess in a directory > - it is usppoed to route all unfound pages to error.php, and works as > expected for .htm and .html pages as well as gifs etc. But ofr .php > scripts, e.g /path/to/wrongurl.php it doesnt show my page - > instead it shows No Input file specified.. After some Googling I have > only found people witht eh similar problem without solutions. > Can any one help me on this? I should say that in IE it just gets the > default 404 ( I think this is windows own one responding to the > particular http response header) - in firefox you get the 'No input ' > error > thanks for any advice > Luke Hey Luke, I had the exact same problem on one of my sites and was able to come up with a solution using mod_rewrite: http://jenseng.com/archives/35.html Hope that's of some use. Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP SOAP Client question
The following wsdl file was provided to me. http://64.122.63.81:5454/IfxService.wsdl I first attempted to genrate the PHP classes using the following code... http://64.122.63.81:5454/IfxService.wsdl); // Look at the generated code... echo ( $wsdl->generateProxyCode() ); ?> -- I was expecting this code to generate a code makes use of the underlying SOAP_Client class - that is I was expecting to see each functions. But what I found is this: class WebService_IfxService_IfxService extends SOAP_Client { function WebService_IfxService_IfxService() { $this->SOAP_Client("http://64.122.63.81:5454/IfxService.asmx";, 0); } function &IfxRequest($IFX) { $IFX =& new SOAP_Value('{}IFX','',$IFX); return $this->call("IfxRequest", $v = array("IFX"=>$IFX), array('namespace'=>'https://www.cashsystemsinc.com/ifx/150/bindings', 'soapaction'=>'https://www.cashsystemsinc.com/ifx/150/WebService/IfxRequest', 'style'=>'document', 'use'=>'literal' )); } } Any Idea what is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Earlier versions hurt PHP 5
As a developer, I would love to use PHP 5+ for applications but I am afraid to do so because 90% of web hosting companies do not offer it. The biggest reason that that they do not offer it is because there is little demand for it. The reason why there is little demand for it is that developers do not use it because webhosts do not support it. A classic catch 22 situation! I think that continuing to offer prominent download links for PHP 4 versions on the same page as download links for php 5 on the php.net and Zend sites is a major contributor to this problem. To get PHP 5 accepted, links to download earlier versions should be hidden away in some obsure area. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php