[PHP] mod rewrite urls
Hi, struggling with the following: I have an URL www.mycompany.com/index.php?id=10a=1b=2c=3 What I want to do is using mod_rewrite have www.mycompany.com/10/?a=1b=2c=3 Have tried the following rewrite rules in .htaccess RewriteEngine on RewriteCond%{REQUEST_FILENAME} !-d RewriteCond%{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} ^/([0-9]*)/\?(.+)$ RewriteRule ^([0-9]*)/\?(.+)$ get.php?id=$1$2 [L] But this doesnt work, something's wrong with ?, because if I put in rule any alphabetical character, for example Z then www.mycompany.com/10/Za=1b=2c=3 works fine Thanks, Maris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod rewrite urls
It might be easier to do something like Files view ForceType application/x-httpd-php /Files Then you could have your url http://mycompany.com/view/10/?a=1b=2c=3 You can do the same thing with / but the scope ends up pretty big and creates a lot of extra unnecessary processing. -Ed -Original Message- From: Maris [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 11:43 PM To: [EMAIL PROTECTED] Subject: [PHP] mod rewrite urls Hi, struggling with the following: I have an URL www.mycompany.com/index.php?id=10a=1b=2c=3 What I want to do is using mod_rewrite have www.mycompany.com/10/?a=1b=2c=3 Have tried the following rewrite rules in .htaccess RewriteEngine on RewriteCond%{REQUEST_FILENAME} !-d RewriteCond%{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} ^/([0-9]*)/\?(.+)$ RewriteRule ^([0-9]*)/\?(.+)$ get.php?id=$1$2 [L] But this doesnt work, something's wrong with ?, because if I put in rule any alphabetical character, for example Z then www.mycompany.com/10/Za=1b=2c=3 works fine Thanks, Maris -- 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] php+iptables
Dear all Gurus, I have read little manul from www.php.net I want to create web based firewall with php+iptables . Can any one give me some documentation or guides or Examples ??I am using redhat linux ..all things are installed. I have little understood that i need to use shell_exec and exec to run linux command. I am very newbie to php even dont know html so i m having tough days with php. if any one could help me out. any docs. Regards, -- Joel N.Solanki Network Administrator Phone No: 0265-550001/2/3/4/5 Ext: 211/212 Digtial 2 Virtual Internet Service Provider. http://www.packetraptor.com/ http://www.d2visp.com/ Gujarat (India) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apache htaccess mod rewrite with php querystring urls
Hi, I realize this isnt specificaly related to php, but most php developers are familiar with this. My website uses an index.php file to load all content with a template, using urls like so: http://www.foo.com/index.php?page=splash.html In the same directory, there is a file called splash.html, but what I would like to do is that if the source file is called, the php file would load instead. So typing in: http://www.foo.com/splash.html would bring up: http://www.foo.com/index.php?page=splash.html instead. The solution I found was to use an .htaccess file, but it only brings up a 403 forbidden access error everytime. ModRewrite is enabled, so what could be the problem? Here is the code I used: RewriteEngine on RewriteBase / RewriteRule ^[A-Za-z0-9]\.html$ /index.php?page=$1 thanks for your help :) -steph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: MySQL PHP Examples Training Providers Required
[snip] On Wed, 11 Aug 2004 18:20:23 -0400, Lukasz Karapuda [EMAIL PROTECTED] wrote: Why I chose to reply to your email is because PHP is not usually used for the development of more complex functionality like the Web site module that we have developed. I beg to differ. Many large and complex sites are written in PHP. There are also many large and complex programs written in PHP which are in production use. Take TYPO3, for example: http://www.typo3.org I'll second that, PHP is an excellent choice for website development - especially when supported by the correct web server and database ;) [/snip] I'll third this. Extremely complex applications are programmed using PHP. I responded off list to Michael about this, but we are using PHP to process and report on millions of records per day in MySQL databases. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod rewrite urls
[snip] struggling with the following: I have an URL www.mycompany.com/index.php?id=10a=1b=2c=3 What I want to do is using mod_rewrite have www.mycompany.com/10/?a=1b=2c=3 Have tried the following rewrite rules in .htaccess RewriteEngine on RewriteCond%{REQUEST_FILENAME} !-d RewriteCond%{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} ^/([0-9]*)/\?(.+)$ RewriteRule ^([0-9]*)/\?(.+)$ get.php?id=$1$2 [L] But this doesnt work, something's wrong with ?, because if I put in rule any alphabetical character, for example Z then www.mycompany.com/10/Za=1b=2c=3 works fine [/snip] a. Have you sent this to an Apache list? 2. I just almost cannot bring myself to say it, but this relates to PHP how? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: apache htaccess mod rewrite with php querystring urls
Raisinlove a écrit : Hi, I realize this isnt specificaly related to php, but most php hi developers are familiar with this. My website uses an index.php file to load all content with a template, using urls like so: http://www.foo.com/index.php?page=splash.html In the same directory, there is a file called splash.html, but what I would like to do is that if the source file is called, the php file would load instead. So typing in: http://www.foo.com/splash.html would bring up: http://www.foo.com/index.php?page=splash.html instead. The solution I found was to use an .htaccess file, but it only brings up a 403 forbidden access error everytime. ModRewrite is enabled, so what could be the problem? Here is the code I used: RewriteEngine on RewriteBase / RewriteRule ^[A-Za-z0-9]\.html$ /index.php?page=$1 [A-Za-z0-9] will only match one character. Try this : RewriteEngine on RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1 thanks for your help :) -steph -- Fabrice Lezoray http://classes.scriptsphp.fr - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] apache htaccess mod rewrite with php querystring urls
[snip] My website uses an index.php file to load all content with a template, using urls like so: http://www.foo.com/index.php?page=splash.html In the same directory, there is a file called splash.html, but what I would like to do is that if the source file is called, the php file would load instead. So typing in: http://www.foo.com/splash.html would bring up: http://www.foo.com/index.php?page=splash.html instead. [/snip] A simple redirection using meta refresh in the html file would work meta http-equiv=refresh content=1;url=http://www.foo.com/index.php?page=splash.html; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache htaccess mod rewrite with php querystring urls
A simple redirection using meta refresh in the html file would work meta http-equiv=refresh content=1;url=http://www.foo.com/index.php?page=splash.html; This isn't what I want since (I should probably have specified) the html files contain no headers. The header is generated by the php file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help SQLServer connection: What's server_name??
Hi all, that's my first question here, I'm not subscribed. I'm tring to connect a local DB (Apache+sqlserver2K), but when I execute this simple example: ?php $conectID = mssql_connect(,SA,); mssql_select_db(Northwind); $result=mssql_query(select * from products,$numero ); while ($row=mssql_fetch_array($result)) { $counter++; $c1=$row[ProductName]; $c2=$row[UnitPrice]; echo ($counter c1: $c1 c2: $c2\n); } mssql_close($conectID); ? I get: Warning: MS SQL: Unable to connect to server: I tried many words in there (): localhost, LOCAL, PCs name, name that appears in Enterprisa Manager I don't know what word is asking me for it's a stupid question, I know, but Thanks a lot! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help SQLServer connection: What's server_name??
[snip] Hi all, that's my first question here, I'm not subscribed. I'm tring to connect a local DB (Apache+sqlserver2K), but when I execute this simple example: ?php $conectID = mssql_connect(,SA,); mssql_select_db(Northwind); $result=mssql_query(select * from products,$numero ); while ($row=mssql_fetch_array($result)) { $counter++; $c1=$row[ProductName]; $c2=$row[UnitPrice]; echo ($counter c1: $c1 c2: $c2\n); } mssql_close($conectID); ? I get: Warning: MS SQL: Unable to connect to server: I tried many words in there (): localhost, LOCAL, PCs name, name that appears in Enterprisa Manager I don't know what word is asking me for it's a stupid question, I know, but [/snip] Do you know the IP address? You could try 127.0.0.1 if it is the server you are working on. If it is a remote server you can get the IP from your network admin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: apache htaccess mod rewrite with php querystring urls
[A-Za-z0-9] will only match one character. Try this : RewriteEngine on RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1 Ah, good point there. Thanks. However, I'm still experiencing problems displaying any page contained within the folder which holds this htaccess file. I get a 403 Forbidden Access error everytime. Your example above is the only code contained in my file. What could be the cause of this, and how can I fix it? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing MySQL Date Format
I'm using a hell of a lot of dates in my databases and wondered if it was possible to change the date format in my databases from -00-00 to: 00-00-...? Has anyone else managed to do this or use any workarounds I could use perhaps...? I'm just getting a little hacked of having to explode the damn things every time I use them. -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: apache htaccess mod rewrite with php querystring urls
On Thu, 12 Aug 2004 14:19:07 +0200, in php.general you wrote: [A-Za-z0-9] will only match one character. Try this : RewriteEngine on RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1 $1 would be a backreference, but there are no capturing parenthesis. RewriteRule ([A-Za-z0-9]+\.html)$ /index.php?page=$1 However, I'm still experiencing problems displaying any page contained within the folder which holds this htaccess file. I get a 403 Forbidden Access error everytime. It's pretty simple, though: If you get an error, check your error log for Apache (default written to logs/error.log). It would give you the reason for you Apache has given a 403-error to the client. Still, this is not much of a PHP issue. Since Rewrite-magic tend to be pretty complicated (and there are a couple of misunderstandings regarding this feature), I do think some Apache mailing lists would be of more help for you. -- - Peter Brodersen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Changing MySQL Date Format
[snip] I'm using a hell of a lot of dates in my databases and wondered if it was possible to change the date format in my databases from -00-00 to: 00-00-...? Has anyone else managed to do this or use any workarounds I could use perhaps...? I'm just getting a little hacked of having to explode the damn things every time I use them. [/snip] The date time format is pretty standard, start here http://www.mysql.com/date You could write a date function that does your explosions for you. Or you could query the MySQL list for other solutions. (pun intended) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing MySQL Date Format
Hi Harlequin, Harlequin wrote: [...] I'm just getting a little hacked of having to explode the damn things every time I use them. You EXPLODE them?? When you want it human readable why not simply preg_replace(/(\d{4})-(\d{2})-(\d{2})/, $3-$2-$1 [*], $input); it? or preg_replace it to something machine-readable and for the output use strftime? or even simpler: select unixtimestamp(mytime) and strftime later? Stephan [*] if you want the month leading it is $2-$3-$1... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing MySQL Date Format
Why not just write a simple function in php to change your date around for you? A function in a utility class perhaps? -Brent - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: Harlequin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 12, 2004 7:39 AM Subject: RE: [PHP] Changing MySQL Date Format [snip] I'm using a hell of a lot of dates in my databases and wondered if it was possible to change the date format in my databases from -00-00 to: 00-00-...? Has anyone else managed to do this or use any workarounds I could use perhaps...? I'm just getting a little hacked of having to explode the damn things every time I use them. [/snip] The date time format is pretty standard, start here http://www.mysql.com/date You could write a date function that does your explosions for you. Or you could query the MySQL list for other solutions. (pun intended) -- 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] Changing MySQL Date Format
Stephan Fiedler wrote: Hi Harlequin, Harlequin wrote: [...] I'm just getting a little hacked of having to explode the damn things every time I use them. You EXPLODE them?? When you want it human readable why not simply preg_replace(/(\d{4})-(\d{2})-(\d{2})/, $3-$2-$1 [*], $input); it? or preg_replace it to something machine-readable and for the output use strftime? or even simpler: select unixtimestamp(mytime) and strftime later? Stephan [*] if you want the month leading it is $2-$3-$1... Or just use DATE_FORMAT() in your query... http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Changing MySQL Date Format
On Thu, 12 Aug 2004 20:06, Harlequin wrote: I'm using a hell of a lot of dates in my databases and wondered if it was possible to change the date format in my databases from -00-00 to: 00-00-...? Has anyone else managed to do this or use any workarounds I could use perhaps...? I'm just getting a little hacked of having to explode the damn things every time I use them. Why do you care how mysql stores the dates when you have DATE_FORMAT and all the other you-beaut date functions to massage the data to your needs? -- David Robley I parked my hard disk and now I can't find it! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] timestamp according to timezone?
Hi, How can I get a unix timestamp of the current timezone, rather than GMT as supplied by time()? --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+iptables
Joel n.solanki wrote: Dear all Gurus, I have read little manul from www.php.net I want to create web based firewall with php+iptables . Can any one give me some documentation or guides or Examples ??I am using redhat linux You are really getting into the deep end if you are starting off with this. You need to put in a lot of care if you are configuring IPtables this way. If you are not carefull you will find that you are locking yourself out. Yes you do have to use exec but only the root user can change filtering rules -which you are probably aware of. Unfortunately apache runs as a non privileged user and that means you will need to foray into suexec or sudo both of which are rather dangerous. I am not trying to discourage you but just pointing out that this is perhaps not the ideal first project with PHP. ..all things are installed. I have little understood that i need to use shell_exec and exec to run linux command. I am very newbie to php even dont know html so i m having tough days with php. if any one could help me out. any docs. Regards, -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 1.4 second lag before page loads
Hi there On one site we have a 1.4 second delay before a page loads. We've added mod_gzip and mmCache to the server. Mod_gzip has definitely helped with the speed of page loading, but this 1.4 second delay is still there. The browser hits the page, then there is a delay on 1.4 seconds before the page comes back. We have uploaded the page as a static page and this does not happen, so I'm presuming that this is a php or mysql issue. Any ideas or suggestions of how to track it down? The timestamp shows as: 21:06:10:215270 - when it hits the page 21:06:11:646549 - when the page starts loading Thanks Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 1.4 second lag before page loads
Hi there On one site we have a 1.4 second delay before a page loads. We've added mod_gzip and mmCache to the server. Mod_gzip has definitely helped with the speed of page loading, but this 1.4 second delay is still there. The browser hits the page, then there is a delay on 1.4 seconds before the page comes back. We have uploaded the page as a static page and this does not happen, so I'm presuming that this is a php or mysql issue. Any ideas or suggestions of how to track it down? The timestamp shows as: 21:06:10:215270 - when it hits the page 21:06:11:646549 - when the page starts loading Thanks Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mod rewrite urls
Jay Blanchard wrote: 2. I just almost cannot bring myself to say it, but this relates to PHP how? oh boy, you are going to get a heap of hate mail for saying that. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HOWTO run PHP4 and PHP5 on Apache/Linux
On Sun, Aug 08, 2004 at 03:29:18PM -0500, AJL wrote: On Tue, Aug 03, 2004 at 10:04:11PM -0500, AJL wrote: I ran into so many problems trying to set this up that I thought I'd post my notes to hopefully save others some trouble. I found most of the information I needed at: http://rayh.co.uk/archives/13_PHP5__PHP4_side_by_side.html but the link doesn't seem to be working anymore, so here are my notes. Versions: PHP4.x module (already compiled and installed, this was straightforward in docs at www.php.net) PHP5.0.0 cgi RedHat linux 6.x Apache 1.3.22 PHP5 configure command: ./configure \ --prefix=/usr/local/php/php5.0.0 \ --with-config-file-path=/usr/local/php/php5.0.0/ \ --with-config-file=/usr/local/php/php5.0.0/php.ini \ --enable-force-cgi-redirect \ --disable-path-info-check \ --enable-safe-mode \ --disable-short-tags \ --with-regex=system \ --with-mysql \ --enable-debug \ --with-mcrypt \ --enable-versioning \ --disable-libxml NOTE: when I enabled '--enable-discard-path', pages would load blank. Don't use this unless you know what you are doing. I don't understand exactly what this does. NOTE: The options '--with-apxs' and '--with-apache' tell configure to build apache module and CLI. The absence of these tells it to build the CGI version. So DO NOT USE them if you want the CGI version. make make test make install Add the following to httpd.conf (must be in the generic server settings, NOT in a virtual host): ScriptAlias /cgi-php5/ /usr/local/php/php5.0.0/bin/ Directory /usr/local/php/php5.0.0/bin/ Options +ExecCGI Allow From All /Directory Foreach virtual host you want to use php5 on: Create a directory named 'cgi-php5' one level above the document root. This will most likely be in the same directory that has the cgi-bin directory in it. Foreach directory that you want to us php5 for: Add the following to .htaccess file (or virtual host inside a Directory container): Action php5-script /cgi-php5/php AddHandler php5-script .php Options +ExecCGI This is an excellent solution because: - You only have to restart apache once. After that, you can add .htaccess files to enable php5 interpretation whereever you want. - You can upgrade/downgrade php5 without touching apache. - You don't have clunky file extensions like .php5 or anything else that will be difficult to change later on down the road. PROBLEMS: So far, I cannot figure out why $_POST is empty when an html form is sent with method=post. GET works fine. In all my searching, I think it has something to do with how apache is setup; not with how php is configured. I've tried the default php-dist ini file, I've tried many different variations of php configure commands. None of them do the trick. PHP bug list has some posts from people with the same problem and then they said they found a problem in apache setup that fixed it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php PROBLEM RESOLUTION: I finally found the problem: It was the mod_bandwidth module in Apache. I was tipped off to this from bug report: http://bugs.php.net/bug.php?id=16595 I disabled the module (commented the LoadModule and AddModule lines in httpd.conf) and $_POST is populated as expected now. The faq for mod_bandwidth at: http://www.cohprog.com/v3/bandwidth/faq-en.html indicates that if configured incorrectly, CGI may stop working. -- Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yet another note: DO NOT include the configure directive '--disable-libxml' as the above example shows. This will cause the PEAR installation to fail. (Of course, if you don't want PEAR or xml support, feel free to leave it in. If you don't know if you need/want PEAR and xml, just go ahead and allow them to be included and remove '--disable-libxml' from the configure command.) -- Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] timestamp according to timezone?
On 12 August 2004 14:07, Justin French wrote: Hi, How can I get a unix timestamp of the current timezone, rather than GMT as supplied by time()? Sorry, but this question makes no sense to me. A timestamp is absolute and is always in GMT, taking no account of timezones -- that's just the way it's defined. If you want a time in the current timezone, you have to feed the (absolute, GMT) timestamp through something that knows how to adjust for timezones, such as date(). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, 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
Re: [PHP] problem with mysql_fetch_array
$query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } this will print whole array. i just want to print a row at a time and it should be in the loop because i am printing other things as well. can you tell me how to print a row at a time. actually as i explained earlier, i am able to print a row at a time but when it becomes i=1 and starts outer loop for the second time it just printing the same values. any suggestion? thanks, deepak Justin Patrin wrote: On Wed, 11 Aug 2004 17:13:49 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: i am trying to print some values from a table with using mysql_fetch_array in a loop but not able to get correct values. it works fine for the loop i=0, prints all desired values but when it bocomes i=1 and starts the loop again the result values gets reset and prints the same old values. for example: outout of the query is result 1 result 2 result 3 result 4 result 5 result 6 result 7 result 8 result 9 result 10 result 11 result 12 :when i=0, it runs through the loop and prints result 1 result 2 result 3 result 4 result 5 result 6 :which is perfect. :but when i=1, it prints the same values, result 1 result 2 result 3 result 4 result 5 result 6 why is that so? can anyone help me? thanks in advance. $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; for($i=0; $i 2; ++$i)//surveys { for($j=0; $j 2; ++$j)//questions { for ($k=0; $k 3; ++$k)//sub-quesions { $row2 = mysql_fetch_array($query4); //Printing all result values one by one } } } I'm not sure what you think this should do, but you're assuming that 2 * 2 * 3 (12) records will be returned, no more, no less. I doubt this is the case. Normally, such things are done like this: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } If this isn't what you want, perhaps you should be doing 3 seperate queries in there? Please explain why you have 3 for loops around your fetch; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timestamp according to timezone?
On Thursday 12 August 2004 21:06, Justin French wrote: How can I get a unix timestamp of the current timezone, rather than GMT as supplied by time()? What are you trying to solve? The unix timestamp is based off GMT (UTC). All calculations involving such timestamps will be assuming GMT. Thus what you're asking for doesn't make sense (not to me anyway). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Be different: conform. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with mysql_fetch_array
On Thursday 12 August 2004 21:20, Deepak Dhake wrote: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } this will print whole array. i just want to print a row at a time and it should be in the loop because i am printing other things as well. can you tell me how to print a row at a time. actually as i explained earlier, i am able to print a row at a time but when it becomes i=1 and starts outer loop for the second time it just printing the same values. any suggestion? The above does what you want. Tell us what happens when you run it. In most cases iterating through a recordset using a while-loop is much better than using a for-loop. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Hire the morally handicapped. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mod rewrite urls
Jay Blanchard wrote: snip a. Have you sent this to an Apache list? 2. I just almost cannot bring myself to say it, but this relates to PHP how? Didn't you get the memo? To be PC, we now have to answer all questions releated to php or not. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netegrity's siteminder + PHP + Apache
Saqib, We have been able to get Siteminder v5.X to work on Apache 2.0.50 with PHP 5.0.0.. There really wasn't too much hassling with it, but we did have to get the Siteminder 5.X hotfix for Linux though. Let me know what kind of trouble you are running into, and I'll try to help you out. -Sam On Wed, 11 Aug 2004 15:31:42 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello All, Does anyone of any good documentation for compiling Netegrity's Siteminder module with Apache for use in a PHP based application? Thanks. Saqib Ali http://validate.sf.net XHTML/DocBook XML Validator and Transformer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help Loading MySQL Extension with PHP5/Apache1.3
Okay... I've done this before but can't get it working now. I've got PHP5 working correctly, but I'm trying to load the MySQL php_mysql.dll file. I'm using Apache 1.3 on Windows XP. No matter what I use for extension_dir in php.ini, it can't seem to find the file. An error dialog will pop up saying Unable to load dynamic library 'c:\php\ext\php_mysql.dll' - The specified module could not be found. even though that's where the [EMAIL PROTECTED]@ file is! I've tried putting the .dll in c:\php and c:\windows\system32, also, but I always get the same error even though the path it shows in the error is the correct path. I've tried c:/php, c:/php/ext/, c:\php\ext, c:\php, blank, etc with and without trailing slashes... The everyone user has full control over the entire c:\php directory and subdirectories. Any ideas? Going back to PHP4 until I can get this sorted out... Examples from Apache error log of paths to file apache couldn't find: '\php\ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' 'c:\php\ext\php_mysql.dll' 'c:/php/ext/php_mysql.dll' 'c:\php\ext\php_mysql.dll' './php_mysql.dll' 'c:/php/ext/php_mysql.dll' 'c:\php\ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' '\php\ext\php_mysql.dll' 'c:/php/ext/php_mysql.dll' 'c:\windows\system32\php_mysql.dll' -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mod rewrite urls
On Thursday 12 August 2004 21:37, John Nichel wrote: Jay Blanchard wrote: snip a. Have you sent this to an Apache list? 2. I just almost cannot bring myself to say it, but this relates to PHP how? Didn't you get the memo? To be PC, we now have to answer all questions releated to php or not. ;) Even if that means copy-and-pasting from whatever manual/website contains the answer for those people to busy to look it up for themselves? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* f u cn rd ths, u r prbbly a lsy spllr. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help Loading MySQL Extension with PHP5/Apache1.3
John Holmes wrote: Okay... I've done this before but can't get it working now. I've got PHP5 working correctly, but I'm trying to load the MySQL php_mysql.dll file. I'm using Apache 1.3 on Windows XP. Nevermind... (^((*(*^%%$^% libmysql.dll [EMAIL PROTECTED]@#(## !!! windows #*[EMAIL PROTECTED]@!! -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help Loading MySQL Extension with PHP5/Apache1.3
John Holmes wrote: *** This Email Has Been Virus Swept *** Okay... I've done this before but can't get it working now. I've got PHP5 working correctly, but I'm trying to load the MySQL php_mysql.dll file. I'm using Apache 1.3 on Windows XP. No matter what I use for extension_dir in php.ini, it can't seem to find the file. An error dialog will pop up saying Unable to load dynamic library 'c:\php\ext\php_mysql.dll' - The specified module could not be found. even though that's where the [EMAIL PROTECTED]@ file is! I've tried putting the .dll in c:\php and c:\windows\system32, also, but I always get the same error even though the path it shows in the error is the correct path. I've tried c:/php, c:/php/ext/, c:\php\ext, c:\php, blank, etc with and without trailing slashes... The everyone user has full control over the entire c:\php directory and subdirectories. Any ideas? Going back to PHP4 until I can get this sorted out... Examples from Apache error log of paths to file apache couldn't find: '\php\ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' 'c:\php\ext\php_mysql.dll' 'c:/php/ext/php_mysql.dll' 'c:\php\ext\php_mysql.dll' './php_mysql.dll' 'c:/php/ext/php_mysql.dll' 'c:\php\ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' 'c:/php/ext\php_mysql.dll' '\php\ext\php_mysql.dll' 'c:/php/ext/php_mysql.dll' 'c:\windows\system32\php_mysql.dll' I had a similar problem which I eventually resolved. Here are my settings: extension_dir = C:/PHP/ext/ extension=php_mysql.dll Remember to copy 'libmysql.dll' to your Windows System directory (e.g. C:\Windows\System32\). If I remember correctly I also had to remove PHP 4's 'php4ts.dll' from the System directory - maybe this was just getting PHP5 running though? Restart Apache and hope for the best. Neil This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd. *** This Email Has Been Virus Checked *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
I vote this list be renamed as php-general-apache-mysql-imap-iis discussion list. all those not in favour please flame. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML session
Hi. I'm trying to create a session support where i can keep persistent objects. I'm using XML to structure the data in the session file. But i've come into a problem. When i execute the following code the (--) marked instruction simply breaks the function execution: $sess = $xml-documentElement; --$sessIdElem = $xml-createElement(session_id()); $sessVarsElem = $xml-createElement(vars); $sessVarsNode = $sessIdElem-appendChild($sessVarsElem); $sess-appendChild($sessIdElem); In the HTML output i get the following error: Exception thrown without a stack frame in Unknown on line 0 I read the docs on createElement and it doesn't throw exectpions... Can anyone tell me waht i'm doing wrong? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
On Thursday 12 August 2004 22:11, raditha dissanayake wrote: I vote this list be renamed as php-general-apache-mysql-imap-iis discussion list. all those not in favour please flame. Heh, just drop the php and call it the general list :) Shorter and more to the point. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Keep your eyes wide open before marriage, half shut afterwards. -- Benjamin Franklin */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timestamp according to timezone?
On 12/08/2004, at 11:26 PM, Jason Wong wrote: On Thursday 12 August 2004 21:06, Justin French wrote: How can I get a unix timestamp of the current timezone, rather than GMT as supplied by time()? What are you trying to solve? The unix timestamp is based off GMT (UTC). All calculations involving such timestamps will be assuming GMT. Thus what you're asking for doesn't make sense (not to me anyway). You're absolutely right, it doesn't make sense, and even though it was less than an hour ago, I can't really remember how I decided I needed such a thing. It's part of an endless loop of confusion I currently have with timezones for a global app, and it's late :) See next post for more of the puzzle :P --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
[snip] php-general-apache-mysql-imap-iis discussion list. all those not in favour please flame. Heh, just drop the php and call it the general list :) Shorter and more to the point. [/snip] And then we can answer questions on dating, sex, marriage, religion, and politics! Wooohoo! We now return you to your regularly scheduled programming.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] The Y2038 bug
Hi all, Is anyone giving much thought to the Y2038 bug/issue in relation to Unix Timestamps? From what I read, they have a range of 1970-2038 (or earlier than 1970 on *nix). The reason I ask is because I always store my dates in timestamps, and I don't really want to be responsible for any more short-sighted code/data that may still be around 34 years from now. My thinking is to store everything in MySQL DATETIME format (-MM-DD HH:II:SS), but perhaps there's some other thinking on the situation? --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timestamp according to timezone?
On Thursday 12 August 2004 22:11, Justin French wrote: You're absolutely right, it doesn't make sense, and even though it was less than an hour ago, I can't really remember how I decided I needed such a thing. It's part of an endless loop of confusion I currently have with timezones for a global app, and it's late :) See next post for more of the puzzle :P Hey before you post, I seem to remember you asking something similar a while back, and IIRC Miles Thompson (or someone) gave a very thorough answer on how to deal with timezones and whatnot, so you may want to check the archives. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* flannister, n.: The plastic yoke that holds a six-pack of beer together. -- Sniglets, Rich Hall Friends */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mod rewrite urls
Jason Wong wrote: On Thursday 12 August 2004 21:37, John Nichel wrote: Jay Blanchard wrote: snip a. Have you sent this to an Apache list? 2. I just almost cannot bring myself to say it, but this relates to PHP how? Didn't you get the memo? To be PC, we now have to answer all questions releated to php or not. ;) Even if that means copy-and-pasting from whatever manual/website contains the answer for those people to busy to look it up for themselves? That may not be enough. You may also have to write the code for them. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Y2038 bug
Justin French wrote: Hi all, Is anyone giving much thought to the Y2038 bug/issue in relation to Unix Timestamps? From what I read, they have a range of 1970-2038 (or earlier than 1970 on *nix). Either you or I misunderstand this issue... There's this limit because the start point is Jan 1 1970 and 32 bit storage only permits a number large enough to count in seconds from then until 2038. 64 bit storage, however, will permit this to be extended vastly. No backwards compatibility issues will arise, because in both cases the time stamp is just counting up from a given date. So if we have 64 bit systems by 2038, which is reasonably likely, there will be no problem. Peter. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.8 Session Handling w/ JavaScript
On a server that is running PHP 4.3.6 I can use a link like this and the accompanying javascript to get a popup window in my application. After upgrading to PHP version 4.3.8 this no longer works. For some reason when you click on this link now, it looks like it creates a new session which of course is logging my users out of the application. Is there something that I can add to url_rewrite to get this to work? Is there some other setting I am missing? Do I need better JavaScript? echo (a href=\javascript:popUpBI('bin_info.php')\Bin Info/A); SCRIPT LANGUAGE=JavaScript !-- Begin function popUpBI(URL) { day = new Date(); id = day.getTime(); eval(page + id + = window.open(URL, ' + id + ', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400');); } // End -- /script ## Even tried to send the PHPSESSID by hand. This did not work. echo (a href=\javascript:popUpBI('bin_info.php?PHPSESSID=. $_REQUEST['PHPSESSID'].')\Bin Info/A); ## Session settings in php.ini [Session] session.save_handler = files session.save_path = /tmp session.use_cookies = 1 ; session.use_only_cookies = 1 session.name = PHPSESSID session.auto_start = 1 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 url_rewriter.tags = a=href,area=href,frame=src,input=src,form=,fieldset= James Hicks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A function in PHP that changes html in a string from p align=center to p align=center ?
Is there any function in PHP that changes html in a string from p align=center to p align=center ? (e.g. adding the double quotes) Regards, Sumarlidi Einar Dadason SED DESIGN _ Email: [EMAIL PROTECTED] Website: http://www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A function in PHP that changes html in a string from p align=center to p align=center ?
[snip] Is there any function in PHP that changes html in a string from p align=center to p align=center ? (e.g. adding the double quotes) [/snip] Nah, but you could write a function to add quotes to attributes of any tag that you would like. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML session
Miguel Manso wrote: Hi. I'm trying to create a session support where i can keep persistent objects. I'm using XML to structure the data in the session file. But i've come into a problem. When i execute the following code the (--) marked instruction simply breaks the function execution: $sess = $xml-documentElement; --$sessIdElem = $xml-createElement(session_id()); $sessVarsElem = $xml-createElement(vars); $sessVarsNode = $sessIdElem-appendChild($sessVarsElem); $sess-appendChild($sessIdElem); In the HTML output i get the following error: Exception thrown without a stack frame in Unknown on line 0 I read the docs on createElement and it doesn't throw exectpions... Can anyone tell me waht i'm doing wrong? Thanks! Forgot to say that this code is executed on the __destruct() function of a class. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 : __sleep() and __wakeup()
Hello ! I have a problem with __sleep() and __wakeup() with php 5.0.0. if you have a class like that : class foo { private $var = 'var'; function __construct() { ... } function __sleep() { return array('var'); } function wakeup() { } } and php code like this : $myFoo = new foo(); var_dump(serialize($myFoo)); the 'var' property was not serialized because it is protected !!! However, if you do not defined __sleep() method, 'var' is serialized !!! Conclusion : the programmer can not define properties wich must be serialized, but the language can serialized all properties, even if they are private or protected !!! And if the prgrammer (me) want not to put in session all properties, it is impossible !!! Any solutions ? Best regards, Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
On Thu, 12 Aug 2004 09:12:41 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: | And then we can answer questions on dating, sex, marriage, religion, and | politics! Wooohoo! We may just as well call it IRC then. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 : __sleep() and __wakeup()
Hello ! I have a problem with __sleep() and __wakeup() with php 5.0.0. if you have a class like that : class foo { private $var = 'var'; function __construct() { ... } function __sleep() { return array('var'); } function wakeup() { } } and php code like this : $myFoo = new foo(); var_dump(serialize($myFoo)); the 'var' property was not serialized because it is protected !!! However, if you do not defined __sleep() method, 'var' is serialized !!! Conclusion : the programmer can not define properties wich must be serialized, but the language can serialized all properties, even if they are private or protected !!! And if the prgrammer (me) want not to put in session all properties, it is impossible !!! Any solutions ? Best regards, Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
raditha dissanayake wrote: I vote this list be renamed as php-general-apache-mysql-imap-iis discussion list. all those not in favour please flame. We could just move this list to a Yahoo! group, then we can answer questions for any topic, and have the trolls too. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] LRC (longitudinal redundancy check) and Even Parity
Hello, I'm working on some code to authorize and settle directly with Vital. Some of the inspiration and code samples have come from the Perl module Business::OnlinePayment::VirtualNet. Things are working good approximately 99% of the time. However, my communication is getting Nak'd on settlement before getting to Vital. When I reassign my batches, it comes down to one transaction that is causing the problem. I believe the problem is either in my LRC (longitudinal redundancy check) calculation or my conversion of the string to even parity. I'm hoping there is someone out there that knows more about LRC and even parity than I do that can look over the below functions to see if they are calculating the LRC and even parity correctly. In the last 3 that have gotten Nak'd, it appears the commonality between the transactions is that my LRC value is a 'nul' character (000 binary) on the detail record. So I'm either thinking that I'm not converting the nul character to even parity correctly or my LRC is slightly off and it shouldn't be a nul character. If there may be functions in PHP that I'm overlooking that could do this easier for me, please let me know as well. Thanks to anyone you might lend some advice. Here are my functions: /* LRC / /*** taken from Perl module String::LRC ***/ function lrc($buffer) { $len = 0; if (isset($buffer) !empty($buffer)){ $len = strlen($buffer); } $check = substr($buffer, 0, 1); for ($i = 1; $i $len ; $i++) { $check ^= substr($buffer, $i, 1); } return $check; } /* Set Even Parity ***/ function setEvenParity($str) { $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); foreach ($chars as $key = $val){ $chars[$key] = evenParityChar($val); } return implode(, $chars); } function evenParityChar($char) { $bin = sprintf(%07b,ord($char)); $check = substr($bin, 0, 1); for ($i = 1; $i strlen($bin); $i++){ $check ^= substr($bin, $i, 1); } $dec = pack('C', bindec($check . $bin)); return $dec; } Thanks, Dominic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A function in PHP that changes html in a string from p align=center to p align=center ?
SED wrote: Is there any function in PHP that changes html in a string from p align=center to p align=center ? (e.g. adding the double quotes) no but you can do so with sed. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
raditha dissanayake wrote: I vote this list be renamed as php-general-apache-mysql-imap-iis discussion list. all those not in favour please flame. We could just move this list to a Yahoo! group, then we can answer questions for any topic, and have the trolls too. ;) -- John C. Nichel Wait, wait...I have it. php-general-apache-mysql-imap-iis-javascript-HTML-perl-car_repair-side_paneling-medical_doctor-tv_repair-shoelace_tying -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A function in PHP that changes html in a string from p align=center to p align=center ?
str_replace('p align=center', 'p align=center', $string) However, align argument is deprecated in last version of html. Use css instead. Best regards Fred raditha dissanayake wrote: SED wrote: Is there any function in PHP that changes html in a string from p align=center to p align=center ? (e.g. adding the double quotes) no but you can do so with sed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
[snip] Wait, wait...I have it. php-general-apache-mysql-imap-iis-javascript-HTML-perl-car_repair-side_p aneling-medical_doctor-tv_repair-shoelace_tying [/snip] we-do-not-know-it-all-but-we-stayed-at-a-Holiday-Inn-Express-last-night@ lists.foo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Escaping quotes [solution]
[snip] 2) By not escaping quotes in the data ... You can do it this way but you must make sure that any strings in your values array have been escaped before with [/snip] There is no quotes in the data. The data coming in is a $_POST array. $dbmssql-dbinsert($_POST, $table); However this did make me pull my head out of my... [snip] using str_replace(', '',$str) should work. [/snip] Justin's first post on PEAR::DB pointed me in the right direction. The initial method that parses out the $_POST is where I needed to add the quotes around the values. I sure will be glad when I don't make these kinds of simple mistakes anymore. Thanks guys... alex hogan * The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+iptables
On Thu, 2004-08-12 at 01:31, Joel n.solanki wrote: Dear all Gurus, I have read little manul from www.php.net I want to create web based firewall with php+iptables . Can any one give me some documentation or guides or Examples ??I am using redhat linux ..all things are installed. I have little understood that i need to use shell_exec and exec to run linux command. I am very newbie to php even dont know html so i m having tough days with php. if any one could help me out. any docs. Unlike the other responses, I'll give you a different approach. Are you attempting to build a web based 'interface' to iptables? So you can add/edit/drop rules for iptables? If I were to build such an app, this is how I would build it. I would build 3 layers to this app. - a database (postgresql or mysql) - store all your rules, comments, timestamps, etc - web based interface - an interface that allows you to add, edit, modify the data in the database - give this interface only the necessary ability to do this, nothing more so that your firewall configuration remains fairly secure. - cron script - a script on the server (written in php, perl, python, whatever) - performs a lookup in the database and checks for any new changes since its last run - gets the changes and builds the necessary iptables configuration script and writes to a file on the server. - add a row that records when you did this so that next time you know when to look for new records from. You *could* use exec here to run iptables or you could have another cron script that is just a bash script that runs the iptables config file that you write with the cron script. This is how *I* would approach this. This allows for flexibility of each piece of the code. For example, one day you might want to pick up python and build a cross platform GUI application that will allow you to manage the rules like you did in the web interface. If this might even be the case then you might want to consider PostgreSQL and building your database structure and building server side functions (plperl, plPHP, etc) that allow you to perform simple queries to add/edit/modify data. example: SELECT blockIP('192.168.1.100'); ...is a little cleaner than: INSERT INTO tablename (ip_address, block) VALUES ('192.168.1.100', t); This way all your system logic is stored in your database schema and not in your code. Then a new interface is a breeze to develop and deply. Once again, this is just one approach and might seem like more work but after doing this kind of thing for the last several years I'm growing weary of typing the same logic over and over to new interfaces. heh. Happy coding! your local PostgreSQL advocate, Robby Russell -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
[PHP] Re: [PHP-INSTALL] Re: [PHP] Netegrity's siteminder + PHP + Apache
Hello Sam, Thanks for the response. I don't have much documentation to work with. I very familiar with mod_LDAP + Apache + PHP, but new to Siteminder. I was wondering if you point me to some good resources on the web, or if you have some documentation, that would be helpful as well. Thanks. Saqib Ali http://validate.sf.net XHTML/DocBook XML Validator and Transformer Regards, Saqib Ali https://downloads.seagate.com Click to download latest desktop applications Sam Evans [EMAIL PROTECTED] No Phone Info Available 08/12/2004 06:40 AM To [EMAIL PROTECTED] [EMAIL PROTECTED] cc [EMAIL PROTECTED], [EMAIL PROTECTED] Subject [PHP-INSTALL] Re: [PHP] Netegrity's siteminder + PHP + Apache Saqib, We have been able to get Siteminder v5.X to work on Apache 2.0.50 with PHP 5.0.0.. There really wasn't too much hassling with it, but we did have to get the Siteminder 5.X hotfix for Linux though. Let me know what kind of trouble you are running into, and I'll try to help you out. -Sam On Wed, 11 Aug 2004 15:31:42 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello All, Does anyone of any good documentation for compiling Netegrity's Siteminder module with Apache for use in a PHP based application? Thanks. Saqib Ali http://validate.sf.net XHTML/DocBook XML Validator and Transformer
Re: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls
Jay Blanchard wrote: [snip] Wait, wait...I have it. php-general-apache-mysql-imap-iis-javascript-HTML-perl-car_repair-side_p aneling-medical_doctor-tv_repair-shoelace_tying [/snip] we-do-not-know-it-all-but-we-stayed-at-a-Holiday-Inn-Express-last-night@ lists.foo Laides and gentlemen, I think we have a winner. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Changing MySQL Date Format
Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm using a hell of a lot of dates in my databases and wondered if it was possible to change the date format in my databases from -00-00 to: 00-00-...? This would make ordering by date impossible - do you really want this? You should put formatting issues into your application and rely on the ISO format in your database. Regardsm Torsten Roehr Has anyone else managed to do this or use any workarounds I could use perhaps...? I'm just getting a little hacked of having to explode the damn things every time I use them. -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question about file_put_contents
Hi, I'm relatively new with php but I have a question about this 'new' function. If I use file_put_contents(file.txt, whatever) then it, of course, writes whatever in the file.txt. If I later do the same thing but put a different word (say other) from whatever then it overwrites that entry in the file. This is still fine (and expected), however, if I use this file_put_contents(file.txt, whatever, FILE_APPEND) then it appends like expected BUT there are two entries. For example, the file would look like this: whateverwhateverotherother. Am I missing something here? I want it to append but I don't want the double entries. There is a Resource Context but I don't know what that's for (or what is a valid entry for it). Thank you for any assistance you can offer in clearing up this confusion and I look forward to hearing from you in the near future. Corey
Re: [PHP] [discuss] Rename this list
raditha dissanayake wrote: I vote this list be renamed as php-general-apache-mysql-imap-iis discussion list. all those not in favour please flame. If I give a big donation, can I get my name in there, too??? Imagine all the people that'll want to post to a John Holmes list!!! -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 : __sleep() and __wakeup()
* Thus wrote Frdric Hardy: class foo { private $var = 'var'; ... function __sleep() { return array('var'); } } and php code like this : $myFoo = new foo(); var_dump(serialize($myFoo)); the 'var' property was not serialized because it is protected !!! However, if you do not defined __sleep() method, 'var' is serialized !!! Conclusion : the programmer can not define properties wich must be serialized, but the language can serialized all properties, even if they are private or protected !!! And if the prgrammer (me) want not to put in session all properties, it is impossible !!! what version are you running? this works perfectly fine: string(26) O:3:foo:1:{s:3:var;N;} Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question about file_put_contents
* Thus wrote Corey Hitchcock: Hi, I'm relatively new with php but I have a question about this 'new' function. If I use file_put_contents(file.txt, whatever) then it, of course, writes whatever in the file.txt. If I later do the same thing but put a different word (say other) from whatever then it overwrites that entry in the file. This is still fine (and expected), however, if I use this file_put_contents(file.txt, whatever, FILE_APPEND) then it appends like expected BUT there are two entries. For example, the file would look like this: whateverwhateverotherother. Am I missing something here? I want it to append but I don't want the double entries. There is a Resource Context but I don't know what that's for (or what is a valid entry for it). Thank you for any assistance you can offer in clearing up this confusion and I look forward to hearing from you in the near future. put_contents.php: ?php file_put_contents(file.txt, text1, FILE_APPEND); file_put_contents(file.txt, text2, FILE_APPEND); ? % rm file.txt % php put_contents.php % cat file.txt text1text2 The first time you use it, you probably shouldn't use the FILE_APPEND option. When I run it again: % php put_contents.php % cat file.txt text1text2text1text2 Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 : __sleep() and __wakeup()
I'am using php 5.0.0 release. Try this : var_dump($test); var_dump(unserialize(serialize($test))); You should obtain something like that for fist var_dump : object test string test - 'var' and for the second var_dump : object test string test - 'var' string test - null Best regards Fred PS : I can not test my code in 'live', because I have currently no php5 available (it is on my laptop, and i can not use it at work). So, perhaps that my example is wrong :-(. but in some case, i'am sure that __sleep() and __wakeup does not work correctly !! Curt Zirzow wrote: * Thus wrote Frdric Hardy: class foo { private $var = 'var'; ... function __sleep() { return array('var'); } } and php code like this : $myFoo = new foo(); var_dump(serialize($myFoo)); the 'var' property was not serialized because it is protected !!! However, if you do not defined __sleep() method, 'var' is serialized !!! Conclusion : the programmer can not define properties wich must be serialized, but the language can serialized all properties, even if they are private or protected !!! And if the prgrammer (me) want not to put in session all properties, it is impossible !!! what version are you running? this works perfectly fine: string(26) O:3:foo:1:{s:3:var;N;} Curt -- === Frederic HARDYEmail: [EMAIL PROTECTED] HEXANET SARL URL: http://www.hexanet.fr/ ZAC Les CharmillesTel: +33 (0)3 26 79 30 05 3, allée Thierry Sabine Direct: +33 (0)3 26 61 77 84 BP 202 - 51686 REIMS CEDEX 2 FRANCE === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A function in PHP that changes html in a string from p align=center to p align=center ?
* Thus wrote SED: Is there any function in PHP that changes html in a string from p align=center to p align=center ? (e.g. adding the double quotes) You can use tidy to clean up html. http://php.net/tidy Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.0 capabiity - does it support threads?
Hi, Does anyone know if PHP 5.x supports threading or is planning to? This would be something akin to Java threads. My system would be Fedora Linux - latest build. Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [discuss] Rename this list
Imagine all the people that'll want to post to a John Holmes list!!! People would be wide open for that list. Sorry.., I couldn't resist... Just had to take the low road... alex hogan * The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] string manipulation
Hi I am trying to track down a method for transferring a database id such as 5 into a nice formatted order id such as ORD0005 - where the format for the order id is ORD + 5 digits made up of the database id Thanks Matt
Re: [PHP] 1.4 second lag before page loads
On Thu, 12 Aug 2004 14:07:52 +0100, Adrian Teasdale [EMAIL PROTECTED] wrote: Hi there On one site we have a 1.4 second delay before a page loads. We've added mod_gzip and mmCache to the server. Mod_gzip has definitely helped with the speed of page loading, but this 1.4 second delay is still there. The browser hits the page, then there is a delay on 1.4 seconds before the page comes back. We have uploaded the page as a static page and this does not happen, so I'm presuming that this is a php or mysql issue. Any ideas or suggestions of how to track it down? Use a profiler or an IDE which can do profiling. Check your queries to see if they're inefficient. https://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs#id924218 Without more specific details, I can't help you. What is your code doing? What kind of queries are you running? How much data is there? The timestamp shows as: 21:06:10:215270 - when it hits the page 21:06:11:646549 - when the page starts loading -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [discuss] Rename this list
Imagine all the people that'll want to post to a John Holmes list!!! People would be wide open for that list. Sorry.., I couldn't resist... Just had to take the low road... alex hogan Damn, that was pretty good. :) -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string manipulation
Hi I am trying to track down a method for transferring a database id such as 5 into a nice formatted order id such as ORD0005 - where the format for the order id is ORD + 5 digits made up of the database id See documentation for sprintf(). Try something like: $formatted = sprintf('ORD%05d', $id); - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with mysql_fetch_array
On Thu, 12 Aug 2004 09:20:44 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } this will print whole array. i just want to print a row at a time and it should be in the loop because i am printing other things as well. can you tell me how to print a row at a time. actually as i explained earlier, i am able to print a row at a time but when it becomes i=1 and starts outer loop for the second time it just printing the same values. any suggestion? I think you're getting your terminology mixed up. $row2 is an array which corresponds to a row in the database. Yes, this will print all of the returned records, but I can think off very fe wtimes where you don't want to do that. This loop *is* what you want. Tell us what you're trying to do and we'll try to help. thanks, deepak Justin Patrin wrote: On Wed, 11 Aug 2004 17:13:49 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: i am trying to print some values from a table with using mysql_fetch_array in a loop but not able to get correct values. it works fine for the loop i=0, prints all desired values but when it bocomes i=1 and starts the loop again the result values gets reset and prints the same old values. for example: outout of the query is result 1 result 2 result 3 result 4 result 5 result 6 result 7 result 8 result 9 result 10 result 11 result 12 :when i=0, it runs through the loop and prints result 1 result 2 result 3 result 4 result 5 result 6 :which is perfect. :but when i=1, it prints the same values, result 1 result 2 result 3 result 4 result 5 result 6 why is that so? can anyone help me? thanks in advance. $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; for($i=0; $i 2; ++$i)//surveys { for($j=0; $j 2; ++$j)//questions { for ($k=0; $k 3; ++$k)//sub-quesions { $row2 = mysql_fetch_array($query4); //Printing all result values one by one } } } I'm not sure what you think this should do, but you're assuming that 2 * 2 * 3 (12) records will be returned, no more, no less. I doubt this is the case. Normally, such things are done like this: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } If this isn't what you want, perhaps you should be doing 3 seperate queries in there? Please explain why you have 3 for loops around your fetch; -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 1.4 second lag before page loads
Justin Patrin wrote: On Thu, 12 Aug 2004 14:07:52 +0100, Adrian Teasdale [EMAIL PROTECTED] wrote: Hi there On one site we have a 1.4 second delay before a page loads. We've added mod_gzip and mmCache to the server. Mod_gzip has definitely helped with the speed of page loading, but this 1.4 second delay is still there. The browser hits the page, then there is a delay on 1.4 seconds before the page comes back. We have uploaded the page as a static page and this does not happen, so I'm presuming that this is a php or mysql issue. Any ideas or suggestions of how to track it down? Use a profiler or an IDE which can do profiling. Check your queries to see if they're inefficient. https://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs#id924218 Without more specific details, I can't help you. What is your code doing? What kind of queries are you running? How much data is there? As justin has pointed out more details are needed to provide usefull answers - however one issue could be DNS. ie: if your database is not on the same machine as the web server it could be that your dns queries are not being cached and takes a bit of time to resolve the host - this is however a guess in that dark. On the same vein if you are making any sort of socket connection a lag of few hundred milliseconds may have to be accepted. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string manipulation
On Friday 13 August 2004 01:00, Matthew Oatham wrote: Hi I am trying to track down a method for transferring a database id such as 5 into a nice formatted order id such as ORD0005 - where the format for the order id is ORD + 5 digits made up of the database id str_pad(), please RTFM before you ask such questions. It's obvious from your subject that you know it's something to do with strings, so where better than to look at the chapter on String Functions? Browse through them, checkout the examples, it's a good way to learn. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Ginsburg's Law: At the precise moment you take off your shoe in a shoe store, your big toe will pop out of your sock to see what's going on. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with mysql_fetch_array
On Thu, 12 Aug 2004 10:04:00 -0700 [EMAIL PROTECTED] (Justin Patrin) wrote: On Thu, 12 Aug 2004 09:20:44 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } this will print whole array. i just want to print a row at a time and it should be in the loop because i am printing other things as well. can you tell me how to print a row at a time. actually as i explained earlier, i am able to print a row at a time but when it becomes i=1 and starts outer loop for the second time it just printing the same values. any suggestion? I think you're getting your terminology mixed up. $row2 is an array which corresponds to a row in the database. Yes, this will print all of the returned records, but I can think off very fe wtimes where you don't want to do that. This loop *is* what you want. Tell us what you're trying to do and we'll try to help. $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; $row2 = mysql_result ( $query4, 0 ); or $i = 0; while ( $row2 = mysql_result ( $query4, $i++ ) ) { echo $row2; } Looking for this? - Hannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string manipulation
Jason Wong wrote: str_pad(), please RTFM before you ask such questions. It's obvious from your subject that you know it's something to do with strings, so where better than to look at the chapter on String Functions? Browse through them, checkout the examples, it's a good way to learn. But I searched the manual for strings, and all I got was results for threads. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_split()
I was just wondering if anyone can look an the following code and tell me if there are any obvious errors. I wrote this in DZsoft PHP editor where it works perfectly. But then when I run it on my webserver it gave me a fatal error: Fatal error: Call to undefined function: str_split() in /home/virtual/site341/fst/var/www/html/test.php on line 12 html head title/title /head body ?php $teststr = 5176948000; $parsed = str_split($teststr,3); echo $teststrbr; echo $parsed[0]-$parsed[1]-$parsed[2]$parsed[3]; ? /body /html Can anyone enlighten me on this. Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
Aaron Todd wrote: I was just wondering if anyone can look an the following code and tell me if there are any obvious errors. I wrote this in DZsoft PHP editor where it works perfectly. But then when I run it on my webserver it gave me a fatal error: Fatal error: Call to undefined function: str_split() in /home/virtual/site341/fst/var/www/html/test.php on line 12 html head title/title /head body ?php $teststr = 5176948000; $parsed = str_split($teststr,3); echo $teststrbr; echo $parsed[0]-$parsed[1]-$parsed[2]$parsed[3]; ? /body /html What version of php is your webserver running? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
I thought someone might ask me that. I honestly dont know. I have been looking for a comand that I can run to find out, but I havent found one. I have SSH access to the server so if you know of a way to get the version please let me know. Thanks, Aaron John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Todd wrote: I was just wondering if anyone can look an the following code and tell me if there are any obvious errors. I wrote this in DZsoft PHP editor where it works perfectly. But then when I run it on my webserver it gave me a fatal error: Fatal error: Call to undefined function: str_split() in /home/virtual/site341/fst/var/www/html/test.php on line 12 html head title/title /head body ?php $teststr = 5176948000; $parsed = str_split($teststr,3); echo $teststrbr; echo $parsed[0]-$parsed[1]-$parsed[2]$parsed[3]; ? /body /html What version of php is your webserver running? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
HAH...I found it. I have version 4.3.3 Does that version not have this function or something? Thanks, Aaron John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Todd wrote: I was just wondering if anyone can look an the following code and tell me if there are any obvious errors. I wrote this in DZsoft PHP editor where it works perfectly. But then when I run it on my webserver it gave me a fatal error: Fatal error: Call to undefined function: str_split() in /home/virtual/site341/fst/var/www/html/test.php on line 12 html head title/title /head body ?php $teststr = 5176948000; $parsed = str_split($teststr,3); echo $teststrbr; echo $parsed[0]-$parsed[1]-$parsed[2]$parsed[3]; ? /body /html What version of php is your webserver running? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] str_split()
[snip] I thought someone might ask me that. I honestly dont know. I have been looking for a comand that I can run to find out, but I havent found one. I have SSH access to the server so if you know of a way to get the version please let me know. [/snip] make a page like this ?php phpinfo(); ? And run it from your server in a browser. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] str_split()
[snip] HAH...I found it. I have version 4.3.3 Does that version not have this function or something? [/snip] Looking at http://www.php.net/str_split I see that it is valid for PHP 5 only -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
Aaron Todd wrote: I thought someone might ask me that. I honestly dont know. I have been looking for a comand that I can run to find out, but I havent found one. I have SSH access to the server so if you know of a way to get the version please let me know. Well, it looks like str_split() was introduced in PHP5, and I think it's safe to say that most production servers out there are still running php4. Make a php file in the document root of your web site with this in it ?php phpinfo(); ? And access it with a browser... http://www.mysite.com/phpinfo.php (or whatever you name the file) and you can see the version of php, as well as all the configuration options. Also, if you have the cli installed, you can type this in via a shell php -v and that will give you version info. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
Aaron Todd wrote: HAH...I found it. I have version 4.3.3 Does that version not have this function or something? Thanks, Aaron According to the manual... http://us4.php.net/str_split str_split() is a php5 function. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
On Thu, 12 Aug 2004 14:11:13 -0400, Aaron Todd [EMAIL PROTECTED] wrote: HAH...I found it. I have version 4.3.3 Does that version not have this function or something? http://us3.php.net/manual/en/function.str-split.php Look at the top. Only PHP5 is listed. Thanks, Aaron John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Todd wrote: I was just wondering if anyone can look an the following code and tell me if there are any obvious errors. I wrote this in DZsoft PHP editor where it works perfectly. But then when I run it on my webserver it gave me a fatal error: Fatal error: Call to undefined function: str_split() in /home/virtual/site341/fst/var/www/html/test.php on line 12 html head title/title /head body ?php $teststr = 5176948000; $parsed = str_split($teststr,3); echo $teststrbr; echo $parsed[0]-$parsed[1]-$parsed[2]$parsed[3]; ? /body /html What version of php is your webserver running? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] str_split()
[snip] I thought someone might ask me that. I honestly dont know. I have been looking for a comand that I can run to find out, but I havent found one. I have SSH access to the server so if you know of a way to get the version please let me know. [/snip] From the command line type php -v It'll return the version -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
Do you know of a simular function that will split a string in the same way. I have phone numbers stored in a database in the format ##. I need to display the number on the page in the format ###-###-. str_split() worked perfectly for this. Is there another function? Thanks, Aaron John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Todd wrote: I thought someone might ask me that. I honestly dont know. I have been looking for a comand that I can run to find out, but I havent found one. I have SSH access to the server so if you know of a way to get the version please let me know. Well, it looks like str_split() was introduced in PHP5, and I think it's safe to say that most production servers out there are still running php4. Make a php file in the document root of your web site with this in it ?php phpinfo(); ? And access it with a browser... http://www.mysite.com/phpinfo.php (or whatever you name the file) and you can see the version of php, as well as all the configuration options. Also, if you have the cli installed, you can type this in via a shell php -v and that will give you version info. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] str_split()
[snip] Do you know of a simular function that will split a string in the same way. I have phone numbers stored in a database in the format ##. I need to display the number on the page in the format ###-###-. str_split() worked perfectly for this. Is there another function? [/snip] http://www.php.net/substr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3.8 Session Handling w/ JavaScript
On Thursday 12 August 2004 10:32 am, James E Hicks III wrote: On a server that is running PHP 4.3.6 I can use a link like this and the Please disregard this request for help, as the problem seems to be the nut behind the wheel. James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] odd results with database string comparisons
I have a database table with the column described as address_line_2 varchar(255) NOT NULL default '', when I do a select I want to see if there is anything in that column if there is text I will display it in a html table if there is nothing (the table default) I will write nbsp; However the following statement returns false regardless of if I have entered data or not! if($row[address_line_2]==' ') // there is a space between the quotes Please can you help me solve this, and let me know how I should construct my table and perform string comparisons. Thanks
[PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
Trying set up php-syslog-ng on my Red Hat EL 3.0 AS system. I have verified that I can in fact access mysql and that I have the necessary database and that the user, password, and host are setup correctly in db_fns.php. It seems; however, that I still receive the given error: Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 I have verified that I have installed the php-mysql rpm. I have also tried mysql_connect and mysql_pconnect. I have checked to ensure that php.ini includes the necessary extensions and that phpinfo shows mysql as a supported database. Anyone have any ideas on what to try next or how to resolve this issue? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
On Friday 13 August 2004 03:27, Aaron Todd wrote: (B Do you know of a simular function that will split a string in the (B same way. I have phone numbers stored in a database in the format (B ##. I need to display the number on the page in the format (B ###-###-. str_split() worked perfectly for this. Is there (B another function? (B (BPls. check the "User Contributed Notes" section of the manual. (B (BHINT: You can either "create" one yourself or use the PEAR package. (B (BPS ... and pls. trim your post(s) ... (B (B-- (B (B- E - (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
The tip.. copy and paste your error code into google ;-) Do it for all errors, you'll be amazed @ how many have already been answered - Original Message - From: Eric L. Sammons [EMAIL PROTECTED] Date: Thursday, August 12, 2004 2:44 pm Subject: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 Trying set up php-syslog-ng on my Red Hat EL 3.0 AS system. I have verified that I can in fact access mysql and that I have the necessary database and that the user, password, and host are setup correctly in db_fns.php. It seems; however, that I still receive the given error: Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 I have verified that I have installed the php-mysql rpm. I have also tried mysql_connect and mysql_pconnect. I have checked to ensure that php.ini includes the necessary extensions and that phpinfo shows mysql as a supported database. Anyone have any ideas on what to try next or how to resolve this issue? 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
RE: [PHP] odd results with database string comparisons
[snip] I have a database table with the column described as address_line_2 varchar(255) NOT NULL default '', if($row[address_line_2]==' ') // there is a space between the quotes [/snip] address_line_2 varchar(255) NOT NULL default '', --- no space between quotes so if('' == $row['address_line_2]){ //no space between quotes echo nbsp; } else { echo $row['address_line_2']; } HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FWD: RE: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
= Original Message From Eric L. Sammons [EMAIL PROTECTED] = = Original Message From Eric L. Sammons [EMAIL PROTECTED] = did this, all answers came back stating to install php-mysql package. Already have that installed. Some have stated they recompiled php, I really would like to avoid doing that so I don't affect my Red Hat support agreements. Thanks! = Original Message From [EMAIL PROTECTED] = The tip.. copy and paste your error code into google ;-) Do it for all errors, you'll be amazed @ how many have already been answered - Original Message - From: Eric L. Sammons [EMAIL PROTECTED] Date: Thursday, August 12, 2004 2:44 pm Subject: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 Trying set up php-syslog-ng on my Red Hat EL 3.0 AS system. I have verified that I can in fact access mysql and that I have the necessary database and that the user, password, and host are setup correctly in db_fns.php. It seems; however, that I still receive the given error: Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 I have verified that I have installed the php-mysql rpm. I have also tried mysql_connect and mysql_pconnect. I have checked to ensure that php.ini includes the necessary extensions and that phpinfo shows mysql as a supported database. Anyone have any ideas on what to try next or how to resolve this issue? 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
Re: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
Eric L. Sammons wrote: Trying set up php-syslog-ng on my Red Hat EL 3.0 AS system. I have verified that I can in fact access mysql and that I have the necessary database and that the user, password, and host are setup correctly in db_fns.php. It seems; however, that I still receive the given error: Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 I have verified that I have installed the php-mysql rpm. I have also tried mysql_connect and mysql_pconnect. I have checked to ensure that php.ini includes the necessary extensions and that phpinfo shows mysql as a supported database. Anyone have any ideas on what to try next or how to resolve this issue? Make a php info page, look at it thru your browser via the webserver, and check to make sure MySQL is in there. Also, if you didn't restart Apache after installing the php-mysql rpm, you will need to do that. Best solution, ditch the rpm's and install from source. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: RE: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
[snip] did this, all answers came back stating to install php-mysql package. Already have that installed. Some have stated they recompiled php, I really would like to avoid doing that so I don't affect my Red Hat support agreements. [/snip] have you done phpinfo() to see if it really compiled? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php