Re: [PHP] Configure vpopmail with php
hi, i have compiled php with vpopmail and i didn'tget any error but when i try accessing vpopmail functions i getcall to undefined function error. soo whai amdoing wrong, Haseeb ---Original Message--- From: Curt Zirzow Date: Saturday, July 26, 2003 10:06:37 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Configure vpopmail with php * Thus wrote Haseeb ([EMAIL PROTECTED]): the detail in not enough in the FM :) Haseeb Just curious how this line isn't enough: In PHP 4, these functions are only available if PHP was configured with --with-vpopmail[=DIR]. HTH, Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php IncrediMail - Email has finally evolved - Click Here
Re: [PHP] Get Local IP Address
Try this: ?php exec('ipconfig',$catch); foreach($catch as $line){ if(eregi('IP Address',$line)){ list($t,$ip) = split(':',$line); echo 'IP is '.$ip.\n; } } ? Thanks Tom, but I think it only work for Win NT, how about Win 9x? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Get Local IP Address
Hi, Monday, July 28, 2003, 4:29:46 PM, you wrote: Try this: ?php exec('ipconfig',$catch); foreach($catch as $line){ if(eregi('IP Address',$line)){ list($t,$ip) = split(':',$line); echo 'IP is '.$ip.\n; } } ? CL Thanks Tom, but I think it only work for Win NT, how about Win 9x? There is ipconfig.exe in win98 SE thats about all I know. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5: Will register_globals be an option or not - or hasn't it beendecided yet?
Hi I would like to know if it has been decided whether or not register_global will continue to be an option in PHP5. Cheers, Tommy Ipsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable in function parameter
Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); I want this to output a is greater than 5.. how can i modify the code so that the function parameter is evaluated inside the function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_GET['sort'] argument separator
Hi, I have this problem, which could easily be solved through a name change but I would like to learn more. There's a table set up from a MySQL query like this row1) Eval # Title # Heads My Findings row2) P1000 Title16 This is my findings row3) P1223 Eg 2 3 2nd findings row1 is the header columns, the title names are derived from sql statement executed as SELECT eval_no as Eval # etc.. row1 is also set up such that if the user clicks the link, it will trigger a SQL comand to sort it. The problem here is the '#' sign/key. spaces are no problem. the $_GET['sort'] is not able to get the whole field, as such Eval # can only be recognised as Eval and thus sql is not able to sort it. I've looked at the php.ini file and tried setting these 2 configs snip from php manual arg_separator.output string The separator used in PHP generated URLs to separate arguments. arg_separator.input string List of separator(s) used by PHP to parse input URLs into variables. Note: Every character in this directive is considered as separator! /snip but it still does not work.. snip This is how the link looks like http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%20 #dir=ASC Help... Please... ==view_tracker.php== $l_column_header = nl2br(mysql_field_name($l_results,$k)); echo nl2br(sql_sort_by_header($l_column_header, $l_column_header, sql_sort_cat, $sql_sort_dir) ); =sql_functions=== function sql_sort_by_header( $p_string, $p_sort_field, $p_sort, $p_dir ) { if ( $p_sort_field == $p_sort ) { # we toggle between ASC and DESC if the user clicks the same sort order if ( 'ASC' == $p_dir ) { $p_dir = 'DESC'; } else { $p_dir = 'ASC'; } } echo 'a href=view_set_tracker.php?sort=' . $p_sort_field . 'amp;dir=' . $p_dir . ''. $p_string .'/a'; } =view_set_tracker.php $_SESSION['sql_sort_cat'] = ''; $_SESSION['sql_sort_dir'] = $GLOBALS['g_default_sql_sort_dir']; $_SESSION['sql_sort_cat'] = $_GET['sort']; if (!empty( $_GET['dir'] )) { $sql_sort_dir = $_GET['dir']; } header_redirect_html(view_tracker.php); } ? = Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using SESSIONS to store page 2 page variables
Hi, Is it advisable to use SESSIONS to store variable from one page to another page instead of using something like a hidden field? eg: $_SESSION['sql_sort_cat'] $_SESSIOn['sql_sort_dir'] instead of input type=hidden value=?php $sql_sort_cat? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Set Cookie in PHP and call with Perl
Hi - Sorry - by caling I meant to echo the cookie value on a .pl page - and include it (the cookie value)then in an email. Any help would be appreciated because the PERL list people said I must try a PHP list - Thanks August Is this possible : How do i call the cookie value (surname) with Perl if it was set with PHP? SAMPLE: PHP Cookie set: ? setcookie(surname, mc Seveney, time()+31536000, /,,0); ? Need to call this cookie with a .pl extension file (perl) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using SESSIONS to store page 2 page variables
No problem, but remember the user might want to bookmark the page. Ow Mun Heng wrote: Hi, Is it advisable to use SESSIONS to store variable from one page to another page instead of using something like a hidden field? eg: $_SESSION['sql_sort_cat'] $_SESSIOn['sql_sort_dir'] instead of input type=hidden value=?php $sql_sort_cat? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_GET['sort'] argument separator
What happens if you use a non-breaking html space instead? I.e Evalnbsp# HTH Nick On Monday 28 Jul 2003 9:06 am, Ow Mun Heng wrote: Hi, I have this problem, which could easily be solved through a name change but I would like to learn more. There's a table set up from a MySQL query like this row1) Eval # Title # Heads My Findings row2) P1000 Title16 This is my findings row3) P1223 Eg 2 3 2nd findings row1 is the header columns, the title names are derived from sql statement executed as SELECT eval_no as Eval # etc.. row1 is also set up such that if the user clicks the link, it will trigger a SQL comand to sort it. The problem here is the '#' sign/key. spaces are no problem. the $_GET['sort'] is not able to get the whole field, as such Eval # can only be recognised as Eval and thus sql is not able to sort it. I've looked at the php.ini file and tried setting these 2 configs snip from php manual arg_separator.output string The separator used in PHP generated URLs to separate arguments. arg_separator.input string List of separator(s) used by PHP to parse input URLs into variables. Note: Every character in this directive is considered as separator! /snip but it still does not work.. snip This is how the link looks like http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%2 0 #dir=ASC Help... Please... ==view_tracker.php== $l_column_header = nl2br(mysql_field_name($l_results,$k)); echo nl2br(sql_sort_by_header($l_column_header, $l_column_header, sql_sort_cat, $sql_sort_dir) ); =sql_functions=== function sql_sort_by_header( $p_string, $p_sort_field, $p_sort, $p_dir ) { if ( $p_sort_field == $p_sort ) { # we toggle between ASC and DESC if the user clicks the same sort order if ( 'ASC' == $p_dir ) { $p_dir = 'DESC'; } else { $p_dir = 'ASC'; } } echo 'a href=view_set_tracker.php?sort=' . $p_sort_field . 'amp;dir=' . $p_dir . ''. $p_string .'/a'; } =view_set_tracker.php $_SESSION['sql_sort_cat'] = ''; $_SESSION['sql_sort_dir'] = $GLOBALS['g_default_sql_sort_dir']; $_SESSION['sql_sort_cat'] = $_GET['sort']; if (!empty( $_GET['dir'] )) { $sql_sort_dir = $_GET['dir']; } header_redirect_html(view_tracker.php); } ? = Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Set Cookie in PHP and call with Perl
On Monday 28 July 2003 13:52, TWSC HQ wrote: Sorry - by caling I meant to echo the cookie value on a .pl page - and include it (the cookie value)then in an email. Any help would be appreciated because the PERL list people said I must try a PHP list - A cookie is a cookie regardless of what mechanism was used to set/create it. Just ask on the perl list how to read a cookie (no need to mention php). -- 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 -- /* Our business is run on trust. We trust you will pay in advance. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IMAP and NNTP
The manual says that the majority of IMAP commands can be used for NNTP access. This code works fine. $status = imap_status($nntp,{news.gradwell.net:119/nntp}#news.gradwell. lists.test,SA_ALL); if($status) { print(Messages: . $status-messages ).br\n; print(Recent: . $status-recent ).br\n; print(Unseen: . $status-unseen ).br\n; print(UIDnext:. $status-uidnext).br\n; print(UIDvalidity:. $status-uidvalidity).br\n; This produces the following output. Messages: 7 Recent: 7 Unseen: 7 UIDnext: 111 UIDvalidity:-1091568946 The 111 is reasonable as there are 6 messages on the server, numbered 104-109 on the server. The code $msgno = imap_msgno($nntp, '106'); echo msgno is: $msgno br\n; outputs msgno is: 2 the inverse $uidno = imap_uid($nntp, $msgno); echo uidno is: $uidno br\n; outputs Warning: Bad message number in /nfs1/corixa/webs/cgi-user/news/news.php on line 60 uidno is: So it appears that 106 looks up as 2, but 2 doesn't produce 106, but an error instead. Has anybody honestly used the IMAP functions to drive and NNTP server or am I wasting my time. {R} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable in function parameter
www.php.net/variables.scope You need global $a; as the first line in your function. 386-DX wrote: Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); I want this to output a is greater than 5.. how can i modify the code so that the function parameter is evaluated inside the function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Half solved...............what the @#%# is PHPSESSID?
-Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: 26 July 2003 21:16 Hey John, I dont think its the browser because I have tried this with opera 6,opera 7, IE and NN with the same results... But when i checked the phpinfo() it says that cookies are enabledDo you think its worth it to search and replace each Location header with .SID? Absolutely: just consider a user who has deliberately blocked all cookies in their browser options -- even if your server is set to use cookies by default, if session.use_trans_sid has not been disabled, PHP will detect that the user is blocking cookies and revert to passing the SID (aka PHPSESSID) in the URL. If you have a URL that PHP is unable to rewrite for any reason (such as because it's in a header('Redirect: ...') string), if you haven't manually concatenated the SID constant to that URL, the session will disappear at that point. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] incrementing string value
-Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: 26 July 2003 01:14 * Thus wrote Curt Zirzow ([EMAIL PROTECTED]): * Thus wrote Jeremy ([EMAIL PROTECTED]): let me make sure I understand... $var = 'a'; $var++ print($var); would print b to the screen? um.. ignore my post ealier.. yes it does print 'b' I forgot to mention, be sure to check how far you are in your loop cause last time i checked: ... var z[]; var {[]; will produce a javascript error. That shouldn't be a consideration, since: ?php $x = 'z'; $x++; ? will set $x to 'aa' (IIRC). This is also why for ($x='a'; $x='z'; $x++) doesn't do what you might expect. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] replacing but not special chars
-Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: 27 July 2003 08:36 I have some URLs in hrefs that have an . This does not validate HTM4.01 transitional, so I want to replace them with amp; So I buffer the output and do a replace, but suppose there is already an amp; then I get amp;amp; or if I have anything else like quot; then I get amp;quot; Why can't you just put amp; in the href string? Seems like the simplest way to me. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Authentication or redirection of SMTP server
Here is my problem. When I send emails locally theough the Exchange Server I have no problems sending mail. When I try to send emails to another site through the MTA funtion_mail pops up. One of two things came to mind. First is that we have anonymous forwarding of emails turned off for security, meaning that I need to login to the Exchange server in order to send emails. Or the second part as I have seen on so many PHP sites is that I need a valid email address to send from. My question on the valid email address is if it has to be the primary or can it be the secondary address for an Exchange account? I created a secondary address and it still does not work. Any clues on what to do? Do I need to login into the server for this? Please Help me on this! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 28 Jul 2003 09:50:14 -0000 Issue 2202
php-general Digest 28 Jul 2003 09:50:14 - Issue 2202 Topics (messages 157105 through 157149): Re: Recompiling the PHP Binary with PCNTL 157105 by: DvDmanDT 157127 by: Jason Wong Flash Variables 157106 by: Taylor Smith 157108 by: skate Re: Your E-Book 157107 by: Paul McNally 157109 by: Curt Zirzow How is this possible? 157110 by: Ryan A 157112 by: Robert Cummings 157113 by: Curt Zirzow 157115 by: Ryan A 157119 by: Curt Zirzow 157120 by: skate 157121 by: skate 157122 by: Ryan A 157123 by: Curt Zirzow Re: Sessions GET vs. Cookies 157111 by: Nicholas Robinson Including a https .aspx form/response in a PHP page - Tricky? 157114 by: Paul Fitz 157117 by: Curt Zirzow The session finishes unexpectedly 157116 by: Tomás Liendo 157118 by: Curt Zirzow Array help 157124 by: Ryan A 157130 by: Jason Wong Get Local IP Address 157125 by: Chris Lee 157128 by: Tom Rogers 157134 by: Chris Lee 157135 by: Tom Rogers Local IP Address 157126 by: Chris Lee POST/GET using a proxy server 157129 by: David Yee 157132 by: Andrew Brampton Problem setting variables. 157131 by: Jason Martyn Re: Configure vpopmail with php 157133 by: Haseeb Re: Will register_globals be an option or not - or hasn't it been decided yet? 157136 by: Tommy Ipsen variable in function parameter 157137 by: 386-DX 157145 by: Marek Kilimajer $_GET['sort'] argument separator 157138 by: Ow Mun Heng 157142 by: Nicholas Robinson using SESSIONS to store page 2 page variables 157139 by: Ow Mun Heng 157141 by: Marek Kilimajer Re: Set Cookie in PHP and call with Perl 157140 by: TWSC HQ 157143 by: Jason Wong IMAP and NNTP 157144 by: {R}ichard Ashton Re: Half solved...what the @#%# is PHPSESSID? 157146 by: Ford, Mike [LSS] Re: incrementing string value 157147 by: Ford, Mike [LSS] Re: replacing but not special chars 157148 by: Ford, Mike [LSS] Mail Authentication or redirection of SMTP server 157149 by: Ron Allen Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Windows or linux? Under windows you need like visual studio to compile it... But how to add parameters there is not my area... -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] David Goodchild [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hi all, I have a webserver using Ensim, some of you may or may not know of it. PHP is installed and Apache is using PHP as a module. The server also has the php binary. I would liek to recompile the current PHP Binary using --with-pcntl and whatever it was originally compiled with How do I go about doing this? Dave ---End Message--- ---BeginMessage--- On Monday 28 July 2003 03:13, David Goodchild wrote: My exact problem is this: I do not know how to recompile an already installed PHP binary with the option --with-pcntl ... 1) Download the php source 2) Extract, and change into the extracted directory 3) Figure out what the existing php binary was compiled with (see previous post) 4) Then run: ./configure [all the previous configure options] --enable-pcntl 5) If no errors then: make 6) If no errors then: make install 7) Congratulate yourself on a job well done. -- 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 -- /* Marriage is the sole cause of divorce. */ ---End Message--- ---BeginMessage--- Hi Everone, I had a question about PHP and Flash. I have a navbar buttons that I made in Flash MX, but the PHP script I want it to be displayed for is an auto-generated photoalbum, so the Next and Previous buttons have need to change meaning at every pageload. I was wondering if there is a way to pass a variable on with the script to that I can program the button to getURL $nextpage or something of the sort. Thanks a bunch, Taylor Smith ---End Message--- ---BeginMessage--- Hi Everone, I had a question about PHP and Flash. I have a navbar buttons that I made in Flash MX, but the PHP script I want it to be displayed for is an auto-generated photoalbum, so the Next and Previous buttons have need to change meaning at every pageload. I was wondering if there is a
RE: [PHP] Sessions GET vs. Cookies
-Original Message- From: Nicholas Robinson [mailto:[EMAIL PROTECTED] Sent: 27 July 2003 23:40 Many thanks, that's fixed it! On Sunday 27 Jul 2003 10:42 pm, Chris Shiflett wrote: --- Nicholas Robinson [EMAIL PROTECTED] wrote: I've noticed that links in my pages are getting the sessionid added as a GET parameter. The session.use_trans_sid directive is enabled in your php.ini. Disable it if you do not want this behavior. But do be aware that anyone who has set their browser not to accept cookies will not be able to use a site set up like this, as there will be no way for them to propagate the session ID from one page to the next. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php ncurses - colors not working
Hello, I have been working with php ncurses for an IRC client and I have a problem with using colors. I have been able to find the example php-4.3.2/ext/ncurses/example1.php, and that does work. It seems to use ncurses_color_set() for setting the color. However, my application uses 3 windows. And within those windows, ncurses_color_set() doesn't do anything at all. Btw, with windows I mean ncurses windows, not the operating system :). I have been looking at the manpages for the C ncurses functions but that didn't really help me out. I have also looked at a C++ ncurses application that uses colors in windows. That used wattron() and wbgkdset(). But if I understand php-4.3.2/ext/ncurses/c-prototypes correctly, those functions are not implemented in php ncurses. Another thing I have tried is to send terminal control characters like ^[[0;31;40m. But they are just outputted to the screen. Google doesn't seem to help me out on this problem and I can't even find other php ncurses projects. Ofcourse, I could also just be wasting my time here because it is just impossible. For those interested, my project has a sourceforge project page at http://www.sourceforge.net/projects/torc. I have not included any sources from it because I thought that would not be relevant. Thanks in advance, Erik Romijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP WITH ODBC freetds
Hiya all; I have been trying so hard to get that done.. and i posted many here. but with no hope.. here is a summury of what i did: - I tried FreeTDS as a driver with unixODBC ... - Tried to remove mysql- apache - php and recomplied them with : iodbc - Tried to try openlink driver. - tried to upgrade from redhat 7.3 to 9 as i faced do much problem with gcc compiler when i compiled php and apache.. All the above with no hope so finaly , i formated the system then i installed a clean RedHat 9 with apache and php 4.2.2 and when i echo phpinfo() i got the following BUT WHAT IS dbx and there is Micrososft SQL server and when i call odbc_connect ... i got Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/louai.php on line 11 if my work was right .. how can i link the driver (FreeTDS and then the DSN..) / PHP Version 4.2.2 System Linux sylvester.devel.redhat.com 2.4.20-2.41smp #1 SMP Sun Feb 9 09:29:47 EST 2003 i686 athlon i386 GNU/Linux Build Date Feb 25 2003 09:44:31 Configure Command './configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs' Server API Apache 2.0 Filter Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php.ini Scan this dir for additional .ini files /etc/php.d additional .ini files parsed /etc/php.d/imap.ini, /etc/php.d/ldap.ini, /etc/php.d/mysql.ini, /etc/php.d/odbc.ini Debug Build no Thread Safety disabled This program makes use of the Zend Scripting Language Engine: Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies PHP 4 Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen 1 1 always_populate_raw_post_data 0 0 arg_separator.input arg_separator.output asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_functions no value no value display_errors On On display_startup_errors Off Off doc_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2039 2039 expose_php On On extension_dir /usr/lib/php4 /usr/lib/php4 file_uploads 1 1 gpc_order GPC GPC highlight.bg #FF #FF highlight.comment #FF9900 #FF9900 highlight.default #CC #CC highlight.html #00 #00 highlight.keyword #006600 #006600 highlight.string #CC #CC html_errors On On ignore_user_abort Off Off
[PHP]IE6 back button problems
Here's a puzzler, I've searched the archives and couldn't find a satisfactory answer, and it would be nice to have one in the archives. I'm working on a web app that draws a search screen with fields coming from settings in a database. When you do the search, it works fine, but in IE 6 on WinXP when you hit the back button it loses the user's form field entries. This is not true of IE 5 on the mac, Safari, etc. I've tried all kinds of tweaks to the settings in IE6's internet options to no avail. However, I think it is too simplistic to say that it is just the browser, because IE6 maintains form field entries when using the back button on some sites, like google. All pages in the web app force a refresh by sending these headers: ##Header Info to force refresh header( Last-Modified: . gmdate( D, d M Y H:i:s, filemtime( $_SERVER['SCRIPT_FILENAME'] ) ) . GMT); header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, precheck=0, false); header(Pragma: no-cache); ## I've tried commenting out some or all of these to no avail, it still loses the user's form fields. HOWEVER, I also tried setting a test session variable to something in the search results page, and when you hit the back button in IE6 if you echo that variable on the search page it echoes the NEW value; other browsers it does NOT. So IE6 is requerying for the page without resort to a cache, while the others are using cached pages. All the header code hooie doesn't seem to affect any of this when you are talking about the back button. TIA Jim McNeely -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mail Authentication or redirection of SMTP server
I used to have similar problem and that was when I was using the php mail() command.. Have a look at phpmailer http://phpmailer.sourceforge.net/ This deals witha lot of the peculiarities with mail servers.. Pete Ron Allen wrote: Here is my problem. When I send emails locally theough the Exchange Server I have no problems sending mail. When I try to send emails to another site through the MTA funtion_mail pops up. One of two things came to mind. First is that we have anonymous forwarding of emails turned off for security, meaning that I need to login to the Exchange server in order to send emails. Or the second part as I have seen on so many PHP sites is that I need a valid email address to send from. My question on the valid email address is if it has to be the primary or can it be the secondary address for an Exchange account? I created a secondary address and it still does not work. Any clues on what to do? Do I need to login into the server for this? Please Help me on this! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] javascript php
I have problem with variables in javascript and php. I have code in php and in this code I insert some values from javascript.: $color = script!-- document.write(screen.colorDepth) //-- /script; when I write command echo $color - result is correct. but when i need insert or select some values from database with this value ($color) result is not correct this is my code : $query = mysql_query(select id from color where color = '$color' ); $a = mysql_num_rows($query); result is 0. but in my database i have record where is value like value $color. roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] using SESSIONS to store page 2 page variables
I think it's OK since users needs to be authenticated. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 4:46 PM To: Ow Mun Heng Cc: [EMAIL PROTECTED] Subject: Re: [PHP] using SESSIONS to store page 2 page variables No problem, but remember the user might want to bookmark the page. Ow Mun Heng wrote: Hi, Is it advisable to use SESSIONS to store variable from one page to another page instead of using something like a hidden field? eg: $_SESSION['sql_sort_cat'] $_SESSIOn['sql_sort_dir'] instead of input type=hidden value=?php $sql_sort_cat? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: javascript php
On Mon, 28 Jul 2003 12:48:04 +0200 [EMAIL PROTECTED] (Roman Duriancik) wrote: I have problem with variables in javascript and php. I have code in php and in this code I insert some values from javascript.: $color = script!-- document.write(screen.colorDepth) //-- /script; when I write command echo $color - result is correct. but when i need insert or select some values from database with this value ($color) result is not correct You are doing it just wrong. The PHP-code is executed and returns the html-page (with the JS-code if you use the print/echo command) to the user Afterwards the JavaScript-Code is executed ON THE CLIENT and shows the color in the page. So the color never reaches the php-script. Get a good book on how JavaScript works at all. thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_GET['sort'] argument separator
Nope.. Still does not work.. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Nicholas Robinson [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 4:53 PM To: Ow Mun Heng; [EMAIL PROTECTED] Subject: Re: [PHP] $_GET['sort'] argument separator What happens if you use a non-breaking html space instead? I.e Evalnbsp# HTH Nick On Monday 28 Jul 2003 9:06 am, Ow Mun Heng wrote: Hi, I have this problem, which could easily be solved through a name change but I would like to learn more. There's a table set up from a MySQL query like this row1) Eval # Title # Heads My Findings row2) P1000 Title16 This is my findings row3) P1223 Eg 2 3 2nd findings row1 is the header columns, the title names are derived from sql statement executed as SELECT eval_no as Eval # etc.. row1 is also set up such that if the user clicks the link, it will trigger a SQL comand to sort it. The problem here is the '#' sign/key. spaces are no problem. the $_GET['sort'] is not able to get the whole field, as such Eval # can only be recognised as Eval and thus sql is not able to sort it. I've looked at the php.ini file and tried setting these 2 configs snip from php manual arg_separator.output string The separator used in PHP generated URLs to separate arguments. arg_separator.input string List of separator(s) used by PHP to parse input URLs into variables. Note: Every character in this directive is considered as separator! /snip but it still does not work.. snip This is how the link looks like http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%2 0 #dir=ASC Help... Please... ==view_tracker.php== $l_column_header = nl2br(mysql_field_name($l_results,$k)); echo nl2br(sql_sort_by_header($l_column_header, $l_column_header, sql_sort_cat, $sql_sort_dir) ); =sql_functions=== function sql_sort_by_header( $p_string, $p_sort_field, $p_sort, $p_dir ) { if ( $p_sort_field == $p_sort ) { # we toggle between ASC and DESC if the user clicks the same sort order if ( 'ASC' == $p_dir ) { $p_dir = 'DESC'; } else { $p_dir = 'ASC'; } } echo 'a href=view_set_tracker.php?sort=' . $p_sort_field . 'amp;dir=' . $p_dir . ''. $p_string .'/a'; } =view_set_tracker.php $_SESSION['sql_sort_cat'] = ''; $_SESSION['sql_sort_dir'] = $GLOBALS['g_default_sql_sort_dir']; $_SESSION['sql_sort_cat'] = $_GET['sort']; if (!empty( $_GET['dir'] )) { $sql_sort_dir = $_GET['dir']; } header_redirect_html(view_tracker.php); } ? = Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: javascript php
Hi Roman, I'm not sure if I understand what you want to do - but if you try to set your PHP-Variable with JavaScript it couldn't work. JavaScript is Clientside interpreted and PHP is Serverside interpreted, that means your PHP-Code is done before the JavaScript-Code. So the Webserver reads your $color Variable and sees that it is set to script!--document.write(screen.colorDepth) file://--/script This value is obviously not in your database. Then the Webserver sends the resulting HTML to your browser. $color = script!-- document.write(screen.colorDepth) file://-- /script; $query = mysql_query(select id from color where color = '$color' ); $a = mysql_num_rows($query); Greetings Kristin Schesonka -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array help
because in reality I don't have just these 4 fields but 43 fields in one table that have to be taken. Select *... seems a much easier way to get it you have 43 fields in 1 table? if you are seriously considering offering hosting packages, then i'm guessing your wanting to be half professional about it. you should look into restructuring you table. do you really NEED to have all 43 fields in 1 table? i've made the same mistake myself, and believe me, it's a lot easier if you simplify your tables. you might get a little more complicated code, but it'll help you tremendously in the future. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamically generate a drop down list
Hi, I want to dynamically generate a drop down list of authors by querying a database. What I am doing at present is: function init_auth_list($auth_list) { $auth_list=select name=author option value=\\select the name of t he author/option\; $query=select name from author order by name; $result=pg_exec($GLOBALS[db],$query); $numrows=pg_numrows($result); $i=0; while($i$numrows) { $row=pg_fetch_row($result,$i); $auth_list=$auth_list.option name=\$row[0]\$row[0]/option; $i++; } $auth_list=$auth_list./select; return $auth_list; } and then I just echo $auth_list. Is it possible to have a function which echoes the values as they are read from the database? I tried doing something of this sort..but didn't work.. Any suggestions? Thanks in advance, Mukta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamically generate a drop down list
Is it possible to have a function which echoes the values as they are read from the database? something like function init_auth_list() { print select name=author option value=\\select the name of the author/option\; $query=select name from author order by name; $result=pg_exec($GLOBALS[db],$query); $numrows=pg_numrows($result); $i=0; while($i$numrows) { $row=pg_fetch_row($result,$i); print option name=\.$row[0].\$row[0]/option; $i++; } print /select; } I tried doing something of this sort..but didn't work.. Any suggestions? Thanks in advance, Mukta hope it works, this is just from the top of my head... -skate- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_GET['sort'] argument separator
If your table column is named Eval #, you need to use backtick quotes: `Eval #` Ow Mun Heng wrote: Hi, I have this problem, which could easily be solved through a name change but I would like to learn more. There's a table set up from a MySQL query like this row1) Eval # Title # Heads My Findings row2) P1000 Title16 This is my findings row3) P1223 Eg 2 3 2nd findings row1 is the header columns, the title names are derived from sql statement executed as SELECT eval_no as Eval # etc.. row1 is also set up such that if the user clicks the link, it will trigger a SQL comand to sort it. The problem here is the '#' sign/key. spaces are no problem. the $_GET['sort'] is not able to get the whole field, as such Eval # can only be recognised as Eval and thus sql is not able to sort it. I've looked at the php.ini file and tried setting these 2 configs snip from php manual arg_separator.output string The separator used in PHP generated URLs to separate arguments. arg_separator.input string List of separator(s) used by PHP to parse input URLs into variables. Note: Every character in this directive is considered as separator! /snip but it still does not work.. snip This is how the link looks like http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%20 #dir=ASC Help... Please... ==view_tracker.php== $l_column_header = nl2br(mysql_field_name($l_results,$k)); echo nl2br(sql_sort_by_header($l_column_header, $l_column_header, sql_sort_cat, $sql_sort_dir) ); =sql_functions=== function sql_sort_by_header( $p_string, $p_sort_field, $p_sort, $p_dir ) { if ( $p_sort_field == $p_sort ) { # we toggle between ASC and DESC if the user clicks the same sort order if ( 'ASC' == $p_dir ) { $p_dir = 'DESC'; } else { $p_dir = 'ASC'; } } echo 'a href=view_set_tracker.php?sort=' . $p_sort_field . 'amp;dir=' . $p_dir . ''. $p_string .'/a'; } =view_set_tracker.php $_SESSION['sql_sort_cat'] = ''; $_SESSION['sql_sort_dir'] = $GLOBALS['g_default_sql_sort_dir']; $_SESSION['sql_sort_cat'] = $_GET['sort']; if (!empty( $_GET['dir'] )) { $sql_sort_dir = $_GET['dir']; } header_redirect_html(view_tracker.php); } ? = Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_GET['sort'] argument separator
Ow Mun Heng wrote: Hi, I have this problem, which could easily be solved through a name change but I would like to learn more. There's a table set up from a MySQL query like this row1) Eval # Title # Heads My Findings row2) P1000 Title16 This is my findings row3) P1223 Eg 2 3 2nd findings row1 is the header columns, the title names are derived from sql statement executed as SELECT eval_no as Eval # etc.. row1 is also set up such that if the user clicks the link, it will trigger a SQL comand to sort it. The problem here is the '#' sign/key. spaces are no problem. the $_GET['sort'] is not able to get the whole field, as such Eval # can only be recognised as Eval and thus sql is not able to sort it. [snip] This is how the link looks like http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%20 #dir=ASC The string with the # character needs to be run through urlencode() or rawurlencode(). The # character is making your browser look for a bookmark named dir=ASC on the view_set_tracker.php page. It would probably be better to pass the actual column names instead of the alias. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A 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] Problem setting variables.
//Find User Configuration $sql = mysql_query(SELECT field_name FROM config WHERE show_field=1) OR die(Could not query database: .mysql_error().); while($result = mysql_fetch_array($sql, MYSQL_ASSOC)){ $field_name_array[] = $result['field_name'] } // Iterate through array and print fields if($field_name_array == ){ print 'please select at least 1 field to be shown'; } else { for($i=0, $n=sizeof($field_name_array); $i$n; $i++){ print $field_name_array[$i]; } } -Original Message- From: Jason Martyn [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 9:22 PM To: [EMAIL PROTECTED] Subject: [PHP] Problem setting variables. I'm creating a script that filters the table of results from a database based on the configuration set by the user (config stored in database as well). For example a table has 30 columns. However the user need only see 5. Every user is different so a user configuration is stored in the database. The database has 2 columns: field_name and show_field. field_name is the name of the field (obviously) that is shown in the table. show_field can either be a 1 or a 0. 1 = show field. 0 = don't show field. I'm getting to a certain point. But I'm not sure how I can go about setting variables for each field_name that has a show_field value of 1. Heres the code. ?php function Interactive() { //Database Variables include ( include/db_config.inc ); //Database connection. $connect = mysql_connect($host, $login, $passwd) OR die(Could not connect to MySQL Database: .mysql_error().); mysql_select_db(admin, $connect) OR die(Could not select Database: .mysql_error().); //Find User Configuration $sql = mysql_query(SELECT field_name FROM config WHERE show_field=1) OR die(Could not query database: .mysql_error().); $result = mysql_fetch_array($sql, MYSQL_ASSOC); //Make sure there are fields to be shown. if(count($result) 0) { //*// // Here is where I would like to set variables. // I first thought of using a for statement, but // realized that variables cannot begin with a // number. Is there any possible way to set // variables for the array results of my query? //*// } else { die(Please select at least 1 field to be shown.); } } ? Thanks, Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem setting variables - Correction
Correction...Forgot a ; //Find User Configuration $sql = mysql_query(SELECT field_name FROM config WHERE show_field=1) OR die(Could not query database: .mysql_error().); while($result = mysql_fetch_array($sql, MYSQL_ASSOC)){ $field_name_array[] = $result['field_name']; } // Iterate through array and print fields if($field_name_array == ){ print 'please select at least 1 field to be shown'; } else { for($i=0, $n=sizeof($field_name_array); $i$n; $i++){ print $field_name_array[$i]; } } -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 4:24 AM To: 'Jason Martyn'; [EMAIL PROTECTED] Subject: RE: [PHP] Problem setting variables. //Find User Configuration $sql = mysql_query(SELECT field_name FROM config WHERE show_field=1) OR die(Could not query database: .mysql_error().); while($result = mysql_fetch_array($sql, MYSQL_ASSOC)){ $field_name_array[] = $result['field_name'] } // Iterate through array and print fields if($field_name_array == ){ print 'please select at least 1 field to be shown'; } else { for($i=0, $n=sizeof($field_name_array); $i$n; $i++){ print $field_name_array[$i]; } } -Original Message- From: Jason Martyn [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 9:22 PM To: [EMAIL PROTECTED] Subject: [PHP] Problem setting variables. I'm creating a script that filters the table of results from a database based on the configuration set by the user (config stored in database as well). For example a table has 30 columns. However the user need only see 5. Every user is different so a user configuration is stored in the database. The database has 2 columns: field_name and show_field. field_name is the name of the field (obviously) that is shown in the table. show_field can either be a 1 or a 0. 1 = show field. 0 = don't show field. I'm getting to a certain point. But I'm not sure how I can go about setting variables for each field_name that has a show_field value of 1. Heres the code. ?php function Interactive() { //Database Variables include ( include/db_config.inc ); //Database connection. $connect = mysql_connect($host, $login, $passwd) OR die(Could not connect to MySQL Database: .mysql_error().); mysql_select_db(admin, $connect) OR die(Could not select Database: .mysql_error().); //Find User Configuration $sql = mysql_query(SELECT field_name FROM config WHERE show_field=1) OR die(Could not query database: .mysql_error().); $result = mysql_fetch_array($sql, MYSQL_ASSOC); //Make sure there are fields to be shown. if(count($result) 0) { //*// // Here is where I would like to set variables. // I first thought of using a for statement, but // realized that variables cannot begin with a // number. Is there any possible way to set // variables for the array results of my query? //*// } else { die(Please select at least 1 field to be shown.); } } ? Thanks, Jason -- 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] replacing \ with - in a string
Hi there, I am trying to replace a backslash inside a string. Somehow nothing workes, not the str_replce, not preg_replace, not erreg_replace. Can anybody please help? Thanx you in advance, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamically generate a drop down list
... or even shorter (since php 4.1.0): function init_auth_list() { print select name=author option value=\\select the name of the author/option\; $query=select name from author order by name; $result=pg_exec($GLOBALS[db],$query); while ($row = pg_fetch_row($result)) { print option name=\.$row[0].\$row[0]/option; } print /select; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] replacing \ with - in a string
Merlin wrote: I am trying to replace a backslash inside a string. Somehow nothing workes, not the str_replce, not preg_replace, not erreg_replace. $new_str = str_replace('\','-',$old_string); or $new_str = str_replace(\\,'-',$old_string); But this begs the question of why do you think you need to do this?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A 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] replacing \ with - in a string
oh.. you are right, I ment slash. Workes now. Thanx for the hint :-)) -- lt;IFRAME SRC=http://saratoga.globosapiens/associates/report_member.php?u=3color=EEE EEE scrolling=no frameborder=0 TITLE=My travel articles width=330 height=155 ALLOWTRANSPARENCY=truea href=http://www.globosapiens.net; title=Worldwide Travel CommunityaTravel Communitya/ /IFRAME John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Merlin wrote: I am trying to replace a backslash inside a string. Somehow nothing workes, not the str_replce, not preg_replace, not erreg_replace. $new_str = str_replace('\','-',$old_string); or $new_str = str_replace(\\,'-',$old_string); But this begs the question of why do you think you need to do this?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A 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] Dynamically generate a drop down list
Is it possible to have a function which echoes the values as they are read from the database? something like function init_auth_list() { print select name=author option value=\\select the name of the author/option\; $query=select name from author order by name; $result=pg_exec($GLOBALS[db],$query); $numrows=pg_numrows($result); $i=0; while($i$numrows) { $row=pg_fetch_row($result,$i); print option name=\.$row[0].\$row[0]/option; $i++; } print /select; } Two things with this, and opinions may vary... Functions shouldn't print or echo anything, rather you should return what is to be displayed. Also you may want to clean up/condense your while in the following manner; ?PHP function init_auth_list(){ $return=select name=author option value=\\select the name of the author/option\; $query=select name from author order by name; $result=pg_exec($GLOBALS[db],$query); $numrows=pg_numrows($result); # $i=0; moved to while statement while($i=0;$i$numrows;$i++;){ $row=pg_fetch_row($result,$i); $return.=option name=\.$row[0].\$row[0]/option; # $i++; moved to while statement } $return.=/select; return $return; } ? then print your select box with the following ?PHP echo init_auth_list(); ? much of that is personal preference mind you; Dave I tried doing something of this sort..but didn't work.. Any suggestions? Thanks in advance, Mukta hope it works, this is just from the top of my head... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail parse
I am curious if there is a better documentation of Mail Parse functions than the one provided on the php.net site. Any help is appreciated, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload files
Hi, I have some problem with uploading files on server with PHP. The upload is ok, but I must set directory permissions with FULL Access - but this is not a good idea :(( Have someone idea how I can do this with no setting permissions to full acess ? Thanks, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload problem
Hi, I have some problem with uploading files on server with PHP. The upload is ok, but I must set directory permissions with FULL Access - but this is not a good idea :(( Have someone idea how I can do this with no setting permissions to full acess ? Thanks, Rosen reserved! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Absolute and relative paths ..... a quick explanation required
Hi all, can anyone tell me how php paths are worked out Im just starting to use php over asp so would appreciate the answer to the following If a file a.php includes a file b.php which includes a file c.php is the include in file b.php relative to itself or the file that included it i.e. a.php. Any help appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Absolute and relative paths ..... a quick explanation required
relative to a.php Kevin McGinley wrote: Hi all, can anyone tell me how php paths are worked out Im just starting to use php over asp so would appreciate the answer to the following If a file a.php includes a file b.php which includes a file c.php is the include in file b.php relative to itself or the file that included it i.e. a.php. Any help appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying MySQL data inside of a table
Hi all, I have this code so far: ? mysql_connect(localhost, USER, PASS); mysql_select_db(DB); $result = mysql_query(SELECT * FROM tbl); ? Inside one of my tables, I have one field called IP which contains just over a thousand IP addresses. I would like these IP addresses to be displayed inside of a table like this: table border=1 cellpadding=5 tr tdIP Address #1/td tdIP Address #2/td tdIP Address #3/td And so on... /tr /table How do I go about acheiving this? TIA, SP Computing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying MySQL data inside of a table
Hi Next time you can find a lot of information about this on www.php.net. Check out this example: ?php $conn = mysql_connect(localhost, mysql_user, mysql_password); if (!$conn) { echo Unable to connect to DB: . mysql_error(); exit; } if (!mysql_select_db(mydbname)) { echo Unable to select mydbname: . mysql_error(); exit; } $sql = SELECT id as userid, fullname, userstatus FROM sometable WHERE userstatus = 1; $result = mysql_query($sql); if (!$result) { echo Could not successfully run query ($sql) from DB: . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo No rows found, nothing to print so am exiting; exit; } // While a row of data exists, put that row in $row as an associative array // Note: If you're expecting just one row, no need to use a loop // Note: If you put extract($row); inside the following loop, you'll // then create $userid, $fullname, and $userstatus while ($row = mysql_fetch_assoc($result)) { echo $row[userid]; echo $row[fullname]; echo $row[userstatus]; } mysql_free_result($result); ? Best regards, Jacob Vennervald On Mon, 2003-07-28 at 16:08, SP Computing wrote: Hi all, I have this code so far: ? mysql_connect(localhost, USER, PASS); mysql_select_db(DB); $result = mysql_query(SELECT * FROM tbl); ? Inside one of my tables, I have one field called IP which contains just over a thousand IP addresses. I would like these IP addresses to be displayed inside of a table like this: table border=1 cellpadding=5 tr tdIP Address #1/td tdIP Address #2/td tdIP Address #3/td And so on... /tr /table How do I go about acheiving this? TIA, SP Computing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying MySQL data inside of a table
$mysql_link = mysql_connect(localhost, USER, PASS); mysql_select_db(DB, $mysql_link); $SQL = SELECT * FROM tbl; $result = mysql_query($SQL, $mysql_link) or die (mysql_error()); echo table border=1 cellpadding=5; while($resultat = @mysql_fetch_array($result)) { echo trtd $resultat[ip] /td; echo /table; } $mysql_link=mysql_close($mysql_link); Un saludo, Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading a file from a form
I'm not sure what that means...how do I use it, and where? On Fri, 25 Jul 2003, Marek Kilimajer wrote: Don't you need to use $HTTP_POST_FILES array because you have register_globals off? Amanda McComb wrote: I am having a problem with uploading a file from a form. I changed the permission on the directory, but I am still getting an error. Here is my error: Copy failed./home/vencel/www/images/apt/company_logo/14Update Failed! It looks like it's not finding the file type. Here is my code: ? include(../includes/database.php); ? ? $long_path = /home/vencel/www/images/apt/; $short_path = ../images/apt/; if (($REQUEST_METHOD=='POST')) { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } //Check for form fields, insert them. //Pull out the id auto-incremented from previous insert. //Check to see if a full-sized photo was uploaded if ($photo == none) { echo No photo.; } else { $end = strrchr($photo_name, .); echo $end; $new_photo_name = $company_id[0] . $end; if ([EMAIL PROTECTED]($photo, $long_path . company_logo/ . $photo_name)) { echo Copy failed.; echo $long_path . company_logo/ . $photo_name; echo $new_photo_name; } else { $long_photo_path = $long_path . company_logo/ . $new_photo_name; $photo_path = $short_path . company_logo/ . $new_photo_name; if ([EMAIL PROTECTED]($long_path . logo/ . $photo_name, $long_photo_path)){ echo Full sized photo not renamed.; } } } $add_image_query .= UPDATE apt_company_t set company_logo_path='$photo_path', ; $add_image_query .= WHERE company_cd = $company_id[0]; mysql_query($add_image_query) or die(Update Failed!); } } ? FORM METHOD=post ACTION=? echo $PHP_SELF ? table TR td colspan = 2BUse the iBrowse/i button to locate your file on your computer or local network./B/td/tr tr tdCompany Logo File: /tdtdinput type=file name=photo size=30/td/tr tr td colspan=2 align=centerINPUT TYPE=submit VALUE=Add/td /tr /table /FORM Any ideas? -- 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] variable in function parameter
* Thus wrote 386-DX ([EMAIL PROTECTED]): Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); http://php.net/eval Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable in function parameter
* Thus wrote 386-DX ([EMAIL PROTECTED]): Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); http://php.net/eval No... you need to make $a global within the function for that change to affect $a outside the function function (...) { global $a; $a = 8; (can maybe do that in one operation, try it and see) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem: creating global alias inside function
The following code illustrates a problem I've got with references (running on PHP 4.3.2). Can anyone explain it for me? Thanks in advance for any assistance! Martin ?php $globalvariable = 0; $one = 1; //want to set up $globalvariable as a reference to $one setglobal($one); echo $globalvariable; //prints 0, not 1 function setglobal($one) { global $globalvariable; $globalvariable = $one; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Debugging a Session Problem
Anything in the Apache or PHP error logs? Permissions are OK, there is space on the drive? Kirk -Original Message- From: Lee Stewart [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 6:00 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Debugging a Session Problem Using the $_SESSION[] style produces the same results... Zero length session file in /tmp, and no data passed... (available at http://4.43.81.92/page1a.php) So where do I go from here...Is there any way to debug it? Like I said, I suspect it's not a PHP code bug, but I'm at a loss as to where to go from here (other than re-writing the entire application in some other language -- which I really don't want to do)... Help? Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading a file from a form
Everything is in the manual: http://www.php.net/features.file-upload Amanda McComb wrote: I'm not sure what that means...how do I use it, and where? On Fri, 25 Jul 2003, Marek Kilimajer wrote: Don't you need to use $HTTP_POST_FILES array because you have register_globals off? Amanda McComb wrote: I am having a problem with uploading a file from a form. I changed the permission on the directory, but I am still getting an error. Here is my error: Copy failed./home/vencel/www/images/apt/company_logo/14Update Failed! It looks like it's not finding the file type. Here is my code: ? include(../includes/database.php); ? ? $long_path = /home/vencel/www/images/apt/; $short_path = ../images/apt/; if (($REQUEST_METHOD=='POST')) { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } //Check for form fields, insert them. //Pull out the id auto-incremented from previous insert. //Check to see if a full-sized photo was uploaded if ($photo == none) { echo No photo.; } else { $end = strrchr($photo_name, .); echo $end; $new_photo_name = $company_id[0] . $end; if ([EMAIL PROTECTED]($photo, $long_path . company_logo/ . $photo_name)) { echo Copy failed.; echo $long_path . company_logo/ . $photo_name; echo $new_photo_name; } else { $long_photo_path = $long_path . company_logo/ . $new_photo_name; $photo_path = $short_path . company_logo/ . $new_photo_name; if ([EMAIL PROTECTED]($long_path . logo/ . $photo_name, $long_photo_path)){ echo Full sized photo not renamed.; } } } $add_image_query .= UPDATE apt_company_t set company_logo_path='$photo_path', ; $add_image_query .= WHERE company_cd = $company_id[0]; mysql_query($add_image_query) or die(Update Failed!); } } ? FORM METHOD=post ACTION=? echo $PHP_SELF ? table TR td colspan = 2BUse the iBrowse/i button to locate your file on your computer or local network./B/td/tr tr tdCompany Logo File: /tdtdinput type=file name=photo size=30/td/tr tr td colspan=2 align=centerINPUT TYPE=submit VALUE=Add/td /tr /table /FORM Any ideas? -- 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] variable in function parameter
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]): * Thus wrote 386-DX ([EMAIL PROTECTED]): Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); http://php.net/eval No... you need to make $a global within the function for that change to affect $a outside the function function (...) { global $a; $a = 8; (can maybe do that in one operation, try it and see) A yes, I did forget to mention that but as per requested I was assuming they wanted the string test to be evalulated. snip I want this to output a is greater than 5.. how can i modify the code so that the function parameter is evaluated inside the function? /snip Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying MySQL data inside of a table
[EMAIL PROTECTED] wrote: $mysql_link = mysql_connect(localhost, USER, PASS); mysql_select_db(DB, $mysql_link); $SQL = SELECT * FROM tbl; $result = mysql_query($SQL, $mysql_link) or die (mysql_error()); echo table border=1 cellpadding=5; while($resultat = @mysql_fetch_array($result)) { echo trtd $resultat[ip] /td; here is '/tr' missing: /td/tr; echo /table; } the echo '/table'; should come after the closed while: } echo '/table'; $mysql_link=mysql_close($mysql_link); Un saludo, Danny ciao SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Absolute and relative paths ..... a quick explanation required
* Thus wrote Kevin McGinley ([EMAIL PROTECTED]): Hi all, can anyone tell me how php paths are worked out Im just starting to use php over asp so would appreciate the answer to the following If a file a.php includes a file b.php which includes a file c.php is the include in file b.php relative to itself or the file that included it i.e. a.php. php looks for files base on your include path setting in php.ini. I'm assuming your on windows so it defaults to: include_path = .;c:\php\includes Now going from that, php will first look for: .\c.php and .\b.php relative to where a.php is located. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem: creating global alias inside function
-Original Message- From: Martin Peck [mailto:[EMAIL PROTECTED] Sent: 28 July 2003 15:33 The following code illustrates a problem I've got with references (running on PHP 4.3.2). Can anyone explain it for me? Thanks in advance for any assistance! Martin ?php $globalvariable = 0; $one = 1; //want to set up $globalvariable as a reference to $one setglobal($one); echo $globalvariable; //prints 0, not 1 function setglobal($one) { global $globalvariable; PHP actually handles this by executing the equivalent of: $globalvariable = $GLOBALS['globalvariable']; -- that is, it creates a $globalvariable *which is local to the function* and makes it be a reference to the global-scope variable of the same name. $globalvariable = $one; This says to make the local $globalvariable be a reference to $one, *not* to assign the value of $one to the variable referred to by $globalvariable -- so you've just overwritten the reference to the global $globalvariable with a reference to $one! This means that you now have no way to refer to the global-scope $globalvariable from within this function. There are two key concepts here, which often seem to get overlooked: (1) When you assign a reference to a variable which already contains a reference, the action is to *replace* the existing reference with the new one (*not* to assign the new reference through the existing reference). (2) In a function, the global and static mechanisms are both handles by defining variables local to the function which are *references* to the appropriate location (thus, you *cannot* assign references to global or static variables). This is explained, albeit in a rather oblique way, on the manual page at http://www.php.net/manual/en/language.variables.scope.php Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading a file from a form
Amanda, You need to look at some of the error messages that are available to you: 1) remove the prepended @ from the file functions. This will tell what is going wrong with the file copy. if ([EMAIL PROTECTED]($photo, $long_path . company_logo/ . $photo_name)) { echo Copy failed.; 2) use mysql_error() when you sql query fails rather than just die() ing $add_image_query .= UPDATE apt_company_t set company_logo_path='$photo_path', ; $add_image_query .= WHERE company_cd = $company_id[0]; mysql_query($add_image_query) or die(Update Failed!); As Curt Zirzow has suggested, it looks to me like your mysql syntax is at fault here. mysql_error() will have told you about it. You have a ', ' where you shouldn't have one Martin - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: Amanda McComb [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:43 PM Subject: Re: [PHP] uploading a file from a form Everything is in the manual: http://www.php.net/features.file-upload Amanda McComb wrote: I'm not sure what that means...how do I use it, and where? On Fri, 25 Jul 2003, Marek Kilimajer wrote: Don't you need to use $HTTP_POST_FILES array because you have register_globals off? Amanda McComb wrote: I am having a problem with uploading a file from a form. I changed the permission on the directory, but I am still getting an error. Here is my error: Copy failed./home/vencel/www/images/apt/company_logo/14Update Failed! It looks like it's not finding the file type. Here is my code: ? include(../includes/database.php); ? ? $long_path = /home/vencel/www/images/apt/; $short_path = ../images/apt/; if (($REQUEST_METHOD=='POST')) { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } //Check for form fields, insert them. //Pull out the id auto-incremented from previous insert. //Check to see if a full-sized photo was uploaded if ($photo == none) { echo No photo.; } else { $end = strrchr($photo_name, .); echo $end; $new_photo_name = $company_id[0] . $end; if ([EMAIL PROTECTED]($photo, $long_path . company_logo/ . $photo_name)) { echo Copy failed.; echo $long_path . company_logo/ . $photo_name; echo $new_photo_name; } else { $long_photo_path = $long_path . company_logo/ . $new_photo_name; $photo_path = $short_path . company_logo/ . $new_photo_name; if ([EMAIL PROTECTED]($long_path . logo/ . $photo_name, $long_photo_path)){ echo Full sized photo not renamed.; } } } $add_image_query .= UPDATE apt_company_t set company_logo_path='$photo_path', ; $add_image_query .= WHERE company_cd = $company_id[0]; mysql_query($add_image_query) or die(Update Failed!); } } ? FORM METHOD=post ACTION=? echo $PHP_SELF ? table TR td colspan = 2BUse the iBrowse/i button to locate your file on your computer or local network./B/td/tr tr tdCompany Logo File: /tdtdinput type=file name=photo size=30/td/tr tr td colspan=2 align=centerINPUT TYPE=submit VALUE=Add/td /tr /table /FORM Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem: creating global alias inside function
* Thus wrote Ford, Mike [LSS] ([EMAIL PROTECTED]): -Original Message- rints 0, not 1 function setglobal($one) { global $globalvariable; PHP actually handles this by executing the equivalent of: $globalvariable = $GLOBALS['globalvariable']; -- that is, it creates a $globalvariable *which is local to the function* and makes it be a reference to the global-scope variable of the same name. $globalvariable = $one; Thus getting around the referenced global var, you can access the global directly: $GLOBALS['globalvariable'] = $one; Tested: http://zirzow.dyndns.org/html/php/tests/misc/global_reference.php Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php pages without .php extension on linux and windows
I just had to turn on MultiViews in my directory options... Heiko Jeff Harris wrote: On Jul 7, 2003, Heiko Mundle claimed that: |I try to use PHP and Apache on both Linux (SuSE 8.1) and Windows (2K). | |On Linux I can access the PHP scripts without adding the .php extension. |E.g. |http://mydomain/myscript?para1=TRUE |for |http://mydomain/myscript.php?para1=TRUE |But on Windows it doesn't work (page not found - HTTP 404) | |How do I switch on 'adding .php' on windows? Does it run on windows too? |What is responsible for that functionality, Apache/PHP? |Which module or directive? | |My system: |SuSE Linux 8.1 - PHP 4.2.2 - Apache/1.3.26 |Windows 2000 - PHP 4.2.3 - Apache/1.3.24 | |Thanks for helping | |Heiko This might be better done in httpd.conf. See what's going on at http://www.phpbuilder.com/columns/tim19990117.php3 It might be able to do what you're looking for. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]IE6 back button problems
Try taking the value='' out of your form fields. if you have it reseting the values every time the page is loaded, it will reset the values. Jim Lucas - Original Message - From: Jim McNeely [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:20 AM Subject: [PHP]IE6 back button problems Here's a puzzler, I've searched the archives and couldn't find a satisfactory answer, and it would be nice to have one in the archives. I'm working on a web app that draws a search screen with fields coming from settings in a database. When you do the search, it works fine, but in IE 6 on WinXP when you hit the back button it loses the user's form field entries. This is not true of IE 5 on the mac, Safari, etc. I've tried all kinds of tweaks to the settings in IE6's internet options to no avail. However, I think it is too simplistic to say that it is just the browser, because IE6 maintains form field entries when using the back button on some sites, like google. All pages in the web app force a refresh by sending these headers: ##Header Info to force refresh header( Last-Modified: . gmdate( D, d M Y H:i:s, filemtime( $_SERVER['SCRIPT_FILENAME'] ) ) . GMT); header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, precheck=0, false); header(Pragma: no-cache); ## I've tried commenting out some or all of these to no avail, it still loses the user's form fields. HOWEVER, I also tried setting a test session variable to something in the search results page, and when you hit the back button in IE6 if you echo that variable on the search page it echoes the NEW value; other browsers it does NOT. So IE6 is requerying for the page without resort to a cache, while the others are using cached pages. All the header code hooie doesn't seem to affect any of this when you are talking about the back button. TIA Jim McNeely -- 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] Displaying MySQL data inside of a table
[EMAIL PROTECTED] wrote: $mysql_link = mysql_connect(localhost, USER, PASS); mysql_select_db(DB, $mysql_link); $SQL = SELECT * FROM tbl; $result = mysql_query($SQL, $mysql_link) or die (mysql_error()); echo table border=1 cellpadding=5; while($resultat = @mysql_fetch_array($result)) { echo trtd $resultat[ip] /td; here is '/tr' missing: /td/tr; echo /table; } the echo '/table'; should come after the closed while: } echo '/table'; $mysql_link=mysql_close($mysql_link); Un saludo, Danny ciao SVEN Excuse me, i write directly in the e-mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] convert mysql datetime to unix timestamp
hi, i have to move data from a table with a datetime (2003-05-14 13:36:04) to a unix timestamp (e.g. 2147483647) . Any ideas? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert mysql datetime to unix timestamp
Tried passing it through strtotime? Example: echo(date('U',strtotime($string))); On Mon, 2003-07-28 at 12:06, Chris Hayes (SENSE) wrote: hi, i have to move data from a table with a datetime (2003-05-14 13:36:04) to a unix timestamp (e.g. 2147483647) . Any ideas? Chris -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: convert mysql datetime to unix timestamp
Look into mktime() http://us3.php.net/manual/en/function.mktime.php Chris Hayes wrote: hi, i have to move data from a table with a datetime (2003-05-14 13:36:04) to a unix timestamp (e.g. 2147483647) . Any ideas? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert mysql datetime to unix timestamp
[EMAIL PROTECTED] Chris Hayes (SENSE): hi, i have to move data from a table with a datetime (2003-05-14 13:36:04) to a unix timestamp (e.g. 2147483647) . Any ideas? Chris strtotime(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mssql_execute problems...
Any takers on this? T. Rader [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey, System: RH9, Apache 1.3.27, PHP 4.3.2, FreeTDS 0.61 connecting to a Win2K Server, MSSQL Server 2K Problem: mssql_execute hangs when run. The script just never comes back. The code is as follows: $macn = mssql_connect(SERVER, UID, PWD); mssql_select_db(DB); $stmt = mssql_init(dbo.Grade2_GET, $macn); $result = mssql_execute($stmt); I have compiled PHP with the --with-mssql option so it does find the functions. Also, the Stored Proc will run just fine if executed via mssql_query(). But, I have some stored procedures that have output parameters and thus I need to use mssql_execute(). I have searched rather extensively on the 'net, and have seen a couple of posts about people saying that it works correctly for them, but I am unable to get it to work. I have even gone as far as to try the nightly build of FreeTDS (0.62) just to see. Also, my env for TDSVER = 7.0 per documentation Does anyone have any ideas? I am currently stumped and cannot seem to find any answers via research... TIA, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mssql_execute problems...
Umm, try setting TDSVER to 8.0 is all I could say to try. On Mon, 2003-07-28 at 12:10, T. Rader wrote: Any takers on this? T. Rader [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey, System: RH9, Apache 1.3.27, PHP 4.3.2, FreeTDS 0.61 connecting to a Win2K Server, MSSQL Server 2K Problem: mssql_execute hangs when run. The script just never comes back. The code is as follows: $macn = mssql_connect(SERVER, UID, PWD); mssql_select_db(DB); $stmt = mssql_init(dbo.Grade2_GET, $macn); $result = mssql_execute($stmt); I have compiled PHP with the --with-mssql option so it does find the functions. Also, the Stored Proc will run just fine if executed via mssql_query(). But, I have some stored procedures that have output parameters and thus I need to use mssql_execute(). I have searched rather extensively on the 'net, and have seen a couple of posts about people saying that it works correctly for them, but I am unable to get it to work. I have even gone as far as to try the nightly build of FreeTDS (0.62) just to see. Also, my env for TDSVER = 7.0 per documentation Does anyone have any ideas? I am currently stumped and cannot seem to find any answers via research... TIA, Tom -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: convert mysql datetime to unix timestamp
SELECT UNIX_TIMESTAMP(datetime-field) ... thomas On Mon, 28 Jul 2003 18:06:32 +0200 [EMAIL PROTECTED] (Chris Hayes) wrote: hi, i have to move data from a table with a datetime (2003-05-14 13:36:04) to a unix timestamp (e.g. 2147483647) . Any ideas? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions help - apache2 + mod_auth_ldap + PHP
Hello everyone! I am having some issues with authentication and was wondering if someone out there could point me in the right direction. I am using apache2 and have htaccess setup to require a valid user via mod_auth_ldap communicating with an ldap server. Everything works like a million bucks in terms of getting the user authenticated. The problems occur at logout. No matter what I do: destroying the session, overwriting cookies, creating new sesions, etc... I cannot get the system to require the user to re-authenticate using any method short of shutting and restarting the browser. Does anyone out there have experience with mod_auth_ldap and php getting the user logged out so that reauthentication is required when accessing the protected directories?? Thanks, th0th -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert mysql datetime to unix timestamp
Chris Hayes (SENSE) wrote: i have to move data from a table with a datetime (2003-05-14 13:36:04) to a unix timestamp (e.g. 2147483647) . Any ideas? ALTER TABLE Table ADD COLUMN unix_time_column INT; UPDATE Table SET unix_time_column = UNIX_TIMESTAMP(mysql_time_column); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A 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] Get Local IP Address
For Win9x, use winipcfg instead of ipconfig. --- Chris Lee [EMAIL PROTECTED] wrote: Try this: ?php exec('ipconfig',$catch); foreach($catch as $line){ if(eregi('IP Address',$line)){ list($t,$ip) = split(':',$line); echo 'IP is '.$ip.\n; } } ? Thanks Tom, but I think it only work for Win NT, how about Win 9x? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get Local IP Address
[EMAIL PROTECTED] Mark: For Win9x, use winipcfg instead of ipconfig. winipcfg is a windows-based utility, which can't work with PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mssql_execute problems...
Thanks for the reply. I gave it a try and still have the same problem. I have FreeTDS logging enabled, but the logs do not show anything useful. A connection is made to the server, and the database is selected correctly. Then, the log shows an outgoing connection. After that, nothing. We have used SQL Profiler to trace the incoming connection, and it pushes through correctly when mssql_query() is used. However, when mssql_execute() is used, the Profiler does not detect anything. It appears that the problem is with the mssql_execute() function as everything operates correctly up until the execution of this function. I am not sophisticated enough to be able to verify this however. I have also tried to downgrade to FreeTDS 0.53 but then PHP does not recognize all of the mssql functions... If it helps, following is the FreeTDS log: 2003-07-28 11:44:11 Connecting addr 10.0.0.220 port 1433 2003-07-28 11:44:11 inside tds_process_login_tokens() Received header @ 2003-07-28 11:44:11 04 01 01 8d 00 ab 01 00 || Received packet @ 2003-07-28 11:44:11 e3 1f 00 01 08 48 00 65 00 72 00 69 00 74 00 61 |.H.e. r.i.t.a| 0010 00 67 00 65 00 06 6d 00 61 00 73 00 74 00 65 00 |.g.e..m.a .s.t.e.| 0020 72 00 ab 70 00 45 16 00 00 02 00 27 00 43 00 68 |r..p.E... ..'.C.h| 0030 00 61 00 6e 00 67 00 65 00 64 00 20 00 64 00 61 |.a.n.g.e. d. .d.a| 0040 00 74 00 61 00 62 00 61 00 73 00 65 00 20 00 63 |.t.a.b.a. s.e. .c| 0050 00 6f 00 6e 00 74 00 65 00 78 00 74 00 20 00 74 |.o.n.t.e. x.t. .t| 0060 00 6f 00 20 00 27 00 48 00 65 00 72 00 69 00 74 |.o. .'.H. e.r.i.t| 0070 00 61 00 67 00 65 00 27 00 2e 00 0b 53 00 51 00 |.a.g.e.'. ...S.Q.| 0080 4c 00 2d 00 52 00 2d 00 57 00 45 00 42 00 30 00 |L.-.R.-.W .E.B.0.| 0090 31 00 00 00 00 e3 08 00 07 05 09 04 d0 00 34 00 |1 .4.| 00a0 e3 17 00 02 0a 75 00 73 00 5f 00 65 00 6e 00 67 |.u.s. _.e.n.g| 00b0 00 6c 00 69 00 73 00 68 00 00 ab 70 00 47 16 00 |.l.i.s.h. ..p.G..| 00c0 00 01 00 27 00 43 00 68 00 61 00 6e 00 67 00 65 |...'.C.h. a.n.g.e| 00d0 00 64 00 20 00 6c 00 61 00 6e 00 67 00 75 00 61 |.d. .l.a. n.g.u.a| 00e0 00 67 00 65 00 20 00 73 00 65 00 74 00 74 00 69 |.g.e. .s. e.t.t.i| 00f0 00 6e 00 67 00 20 00 74 00 6f 00 20 00 75 00 73 |.n.g. .t. o. .u.s| 0100 00 5f 00 65 00 6e 00 67 00 6c 00 69 00 73 00 68 |._.e.n.g. l.i.s.h| 0110 00 2e 00 0b 53 00 51 00 4c 00 2d 00 52 00 2d 00 |S.Q.L .-.R.-.| 0120 57 00 45 00 42 00 30 00 31 00 00 00 00 ad 36 00 |W.E.B.0.1 .6.| 0130 01 07 01 00 00 16 4d 00 69 00 63 00 72 00 6f 00 |..M.i .c.r.o.| 0140 73 00 6f 00 66 00 74 00 20 00 53 00 51 00 4c 00 |s.o.f.t. .S.Q.L.| 0150 20 00 53 00 65 00 72 00 76 00 65 00 72 00 00 00 | .S.e.r.v .e.r...| 0160 00 00 08 00 00 c2 e3 13 00 04 04 34 00 30 00 39 |. ..4.0.9| 0170 00 36 00 04 34 00 30 00 39 00 36 00 fd 00 00 00 |.6..4.0.9 .6.| 0180 00 00 00 00 00|.| 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is e3 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is ab 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is e3 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is e3 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is ab 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is e3 2003-07-28 11:44:11 increasing block size from 4096 to 4096 2003-07-28 11:44:11 inside tds_process_default_tokens() marker is fd 2003-07-28 11:44:11 leaving tds_process_login_tokens() returning 1 Sending packet @ 2003-07-28 11:44:11 01 01 00 2a 00 00 01 00 73 00 65 00 74 00 20 00 |...*s .e.t. .| 0010 74 00 65 00 78 00 74 00 73 00 69 00 7a 00 65 00 |t.e.x.t.s .i.z.e.| 0020 20 00 38 00 30 00 30 00 30 00 | .8.0.0.0 .| Received header @ 2003-07-28 11:44:11 04 01 00 11 00 ab 01 00 || Received packet @ 2003-07-28 11:44:11 fd 00 00 be 00 00 00 00 00 |. | 2003-07-28 11:44:11 processing result tokens. marker is fd Thanks in advance for any help. Tom Adam Voigt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Umm, try setting TDSVER to 8.0 is all I could say to try. On Mon, 2003-07-28 at 12:10, T. Rader wrote: Any takers on this? T. Rader [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey, System: RH9, Apache 1.3.27, PHP 4.3.2, FreeTDS 0.61 connecting to a Win2K Server, MSSQL Server 2K Problem: mssql_execute hangs when run. The script just never comes back. The code is as follows: $macn = mssql_connect(SERVER, UID, PWD); mssql_select_db(DB); $stmt = mssql_init(dbo.Grade2_GET, $macn); $result = mssql_execute($stmt); I have compiled PHP with the --with-mssql option so it does find the functions. Also, the Stored Proc will run just fine if executed via
Re: [PHP] Get Local IP Address
* Thus wrote Tom Rogers ([EMAIL PROTECTED]): Hi, Monday, July 28, 2003, 4:29:46 PM, you wrote: Try this: ?php exec('ipconfig',$catch); foreach($catch as $line){ if(eregi('IP Address',$line)){ list($t,$ip) = split(':',$line); echo 'IP is '.$ip.\n; btw, the $ip needs to be trimmed it actually contains a space at this point ' XXX.XXX.XXX.XXX' } } ? CL Thanks Tom, but I think it only work for Win NT, how about Win 9x? There is ipconfig.exe in win98 SE thats about all I know. win98 has that command. when I issue that on my computer I get multiple interfaces back something like: interface 0: [interface data] interface 1: [interface data] So the above code wont guarantee the correct IP address. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Set Cookie in PHP and call with Perl
On Jul 28, 2003, Jason Wong claimed that: |On Monday 28 July 2003 13:52, TWSC HQ wrote: | | Sorry - by caling I meant to echo the cookie value on a .pl page - and | include it (the cookie value)then in an email. | | Any help would be appreciated because the PERL list people said I must try | a PHP list - | |A cookie is a cookie regardless of what mechanism was used to set/create it. | |Just ask on the perl list how to read a cookie (no need to mention php). Or, you could do a web search and find http://perl.about.com/library/nosearch/P031400.htm A perl list would be better for all your perl needs, but I think you'll find the PHP people, in general, when you don't repeat your original post every day, and you follow the suggestions, and post relevant portions of your code, and wrap your messages correctly, and don't ask a question that was just asked by someone else, and don't send UCE, and aren't a troll, to more helpful. Jeff -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Question
hello everyone, I am trying to store one of the fields of the resultset into an array as I display the results. while ($row = mysql_fetch_array($result1)) { // Alternate the bgcolor of each row for visibility ($even % 2) == 0 ? $bgcolor = #EFEFEF : $bgcolor = #ee; $even = $even + 1; // print the actual row echo TR BGCOLOR=$bgcolor TD align=\left\font color=\#66\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\$row[company]/font/TD TD align=\left\font color=\#66\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\$row[name_1]/font/TD TD align=\left\font color=\#66\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\$row[phone_1]/font/TD TD align=\left\font color=\#66\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\$row[city]/font/TD TD align=\left\font color=\#66\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\$row[url]/font/TD TD align=\left\font color=\#66\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\$row[email_1]/font/TD TD align=\center\font color=\#33\ size=\1\ face=\Verdana, Arial, Helvetica, sans-serif\a href=\full-profile.php?name=.$row['company'].\--Link--/a/ font/TD /TR; // try to store the name of the company in an array called companyname $companyname = array($row['company']); // try to register the variable $_SESSION['link'] = $companyname; //$_SESSION['link'] = $row[company]; } // end while I am trying to store the variable $row['company'] into a array called companyname[], so that I am able to register it as a session variable and use it on subsequent pages. I keep getting errors and am not able to store the values in array $row['company'] . I would appreciate if someone could throw some light on this. Thanks in advance. --Pushpinder
[PHP] List Problems
Any body else getting a message back with subject like: [ERR] Re: [PHP] subject of message. With contents: Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) I tried contacting the list admin and posted a message here ealier this weekend about fixing this (ie unsubing him.) Or am I the only one getting these bounced mail messages, meanwhile I'll just filter all the mail to /dev/null Curt -- :0 * Return-Path: [EMAIL PROTECTED] /dev/null -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Absolute and relative paths ..... a quick explanation required
use require_once() or include_once() - these remember what has been included and do not include files that has been already. Kevin McGinley wrote: Can u tell me then how its posssible to include a file that inculdes another file if it is itself included in two other files that are in difeerent direcrories i.e. |\(root)a.php | |__ (dir b)\b.php | |__ (dir c)\ c.php | |__ (dir d) \ d.php if c.php includes d.php and both a.php and b.php iclude c.php how do u ensure that includes work. I know this can be done by designing everything from the top down and ensuring the system is correct but at the mo Im working on an existing system ?? B.T.W Thanks for your previous answer Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... relative to a.php Kevin McGinley wrote: Hi all, can anyone tell me how php paths are worked out Im just starting to use php over asp so would appreciate the answer to the following If a file a.php includes a file b.php which includes a file c.php is the include in file b.php relative to itself or the file that included it i.e. a.php. Any help appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Jason Wong-Array help
Hey Jason, Thanks for that bit of code, it was exactly what i was looking for. For those of you curious or face the same problem: After dumping the data into the array I am calling each part that i need via ?php echo $data['pname'][1]; ? where pname in this case is the field name and the 1 is for the second value. (Damn, i love php, never worked with these kinds of arrays before and its still a snap.) one last question: According to the script I am calling an include file... eg: if(r=2){include blah1.php;} elseif (r=3){include blah2.php;} and so on now blah1,2,3 etc are mostly html code files with php in them.will this slow down performance a lot and be much of a strain? the calling files are not large...maybe around 12k each...The reason I choose to go this way of course is for easier readibilty ,handleing and space management. Whats your experience with this? good or bad? Cheers, -Ryan - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 4:46 AM Subject: Re: [PHP] Array help On Monday 28 July 2003 10:19, Ryan A wrote: After asking for help on the list Skate gave me the following code as an example: ** $n = 0; $result = mysql_query( SELECT id, title, text, date FROM news ORDER BY date DESC ); while ($rows = mysql_fetch_array($result)) { if( $rows == ){ continue; } extract( $rows ); ///extract our result into variables named after our fields $content[id][$n] = $id; $content[title][$n] = $title; $content[text][$n] = $text; $content[date][$n] = $date; $n++; //increment our number for next time... } ** My question is: is there anyway I can use a select * from to do the same thing and then dump as usual to $content[id][$n] = $id; $content[title][$n] = $title; instead of a select id, title, text, date because in reality I don't have just these 4 fields but 43 fields in one table that have to be taken. Select *... seems a much easier way to get it *** Untried and untested *** $query = SELECT * FROM table; $result = mysql_query($query) or die(Query failed); $n = 0; while ($line = mysql_fetch_assoc($result)) { foreach ($line as $field = $value) { $data[$field][$n] = $value; } $n++; } print_r($data); Season to taste. -- 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 -- /* What one believes to be true either is true or becomes true. -- John Lilly */ -- 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] replacing but not special chars
On Jul 28, 2003, Ford, Mike [LSS] claimed that: | -Original Message- | From: Shawn McKenzie [mailto:[EMAIL PROTECTED] | Sent: 27 July 2003 08:36 | | I have some URLs in hrefs that have an . This does not | validate HTM4.01 | transitional, so I want to replace them with amp; | | So I buffer the output and do a replace, but suppose there is | already an | amp; then I get amp;amp; or if I have anything else like | quot; then I get | amp;quot; | |Why can't you just put amp; in the href string? Seems like the simplest |way to me. | |Cheers! | |Mike |- |Mike Ford, Electronic Information Services Adviser, Thus sayeth the manual, Note: Be careful about variables that may match HTML entities. Things like amp, copy and pound are parsed by the browser and the actual entity is used instead of the desired variable name. This is an obvious hassle that the W3C has been telling people about for years. The reference is here: http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2 PHP supports changing the argument separator to the W3C-suggested semi-colon through the arg_separator .ini directive. Unfortunately most user agents do not send form data in this semi-colon separated format. A more portable way around this is to use amp; instead of as the separator. You don't need to change PHP's arg_separator for this. Leave it as , but simply encode your URLs using htmlentities()(urlencode($data)). Example 2. urlencode() and htmlentities() example echo 'a href=mycgi?foo=', htmlentities(urlencode($userinput)), ''; This is the word of PHP. Therefor, if _you_ are constructing the query strings, you can change your arg_separator (arg_separator.output, PHP_INI_ALL; arg_separator.input, PHP_INI_SYSTEM|PHP_INI_PERDIR) setting and in code, then you should be able to use amp; OR, change your to something else, like ; before you send it, then change it back when you $_GET it. Jeff -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Jason Wong-Array help
* Thus wrote Ryan A ([EMAIL PROTECTED]): one last question: According to the script I am calling an include file... eg: if(r=2){include blah1.php;} elseif (r=3){include blah2.php;} and so on now blah1,2,3 etc are mostly html code files with php in them.will this slow down performance a lot and be much of a strain? the calling files are not large...maybe around 12k each...The reason I choose to go this way of course is for easier readibilty ,handleing and space management. Whats your experience with this? good or bad? Well, if it is a big loop then that means that many more hits to the disk (not taking any sort of disk/php/zend caching into consideration.) which is a high price to pay. I would create something like blah2.php: function blah2_html() { //output html } and use include_once() in your if statment and call the function Personally I would also use the switch statement instead of a if elesif block for readability: switch ($r) { case 2: include_once('blah1.php'); blah1_html(); break; case 3: include_once('blah3.php'); blah3_html(); break; } Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List Problems
Nope, I too have gotten a few of those and its a pain in the @ss. - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 7:26 PM Subject: [PHP] List Problems Any body else getting a message back with subject like: [ERR] Re: [PHP] subject of message. With contents: Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) I tried contacting the list admin and posted a message here ealier this weekend about fixing this (ie unsubing him.) Or am I the only one getting these bounced mail messages, meanwhile I'll just filter all the mail to /dev/null Curt -- :0 * Return-Path: [EMAIL PROTECTED] /dev/null -- 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] Upload problem
On Monday 28 July 2003 21:47, Rosen wrote: I have some problem with uploading files on server with PHP. The upload is ok, but I must set directory permissions with FULL Access - but this is not a good idea :(( Have someone idea how I can do this with no setting permissions to full acess ? What do you mean by FULL Access? The upload directory(ies) (both temporary and final destination) only needs to be +wx for the webserver user. It does not have to be world accessible. -- 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 -- /* Your car never malfunctions or makes the same noise in front of your mechanic -- Murphy's Driving Laws n16 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List Problems
Any body else getting a message back with subject like: [ERR] Re: [PHP] subject of message. yeah, i'm getting that every now and then. maybe 1 or 2 a day tho... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List Problems
I've been getting them too. The really annoying bit is that the most likely reason for it is that the lucky devil hanmir is probably on holiday! On Monday 28 Jul 2003 6:26 pm, Curt Zirzow wrote: Any body else getting a message back with subject like: [ERR] Re: [PHP] subject of message. With contents: Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) I tried contacting the list admin and posted a message here ealier this weekend about fixing this (ie unsubing him.) Or am I the only one getting these bounced mail messages, meanwhile I'll just filter all the mail to /dev/null Curt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing MySQL query return
Hey All, I have a question regarding parsing text from a MySQL query. Basically, I have several paragraphs of text in a field in MySQL. I run a query, get the results, no problem. However, I would like to only display the first paragraph of the data returned. What is the best way to do this? Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List Problems
On Jul 28, 2003, skate claimed that: | | | Any body else getting a message back with subject like: | [ERR] Re: [PHP] subject of message. | | |yeah, i'm getting that every now and then. maybe 1 or 2 a day tho... [Regression mode] Not to start the discussion all over again, but if the responses bounced back to the list management software...[/Regression mode] Doing a search of [this] particular individual ([EMAIL PROTECTED]) reveals that [s]he has been kicked off of two other lists for spamming. I'll bet it's not even a real address anymore. I'm also getting bounce backs from [EMAIL PROTECTED] Jeff -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unique id
On Sat, 2003-07-26 at 07:11, Curt Zirzow wrote: * Thus wrote jan ([EMAIL PROTECTED]): Hi there! What's the best way to create uids (unique ids) even when runnig at exactly same time (microseconds)? is this enough ??? $r = mt_rand(); $uid = uniqid(getmypid() . $r); If you're running a cluster of machines I would include information on the machine that is generating the uid. $uid = uniqid(getmypid() . $r . '_MACHINE_NAME_'); Curt this is similar to what we do as well: hexadecimal timestamp + hexadecimal pid + hexadecimal randomvalue + hex ip address of server (only used if using multiple machines, otherwise this part is left off). I've also considered using semaphores in my id generation function to insure only one counter can be created at a time, but am worried that this might cause a bit of a performance hit. Anyone tried this? gabe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing MySQL query return
- Original Message - From: John [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:22 PM Subject: [PHP] Parsing MySQL query return Hey All, I have a question regarding parsing text from a MySQL query. Basically, I have several paragraphs of text in a field in MySQL. I run a query, get the results, no problem. However, I would like to only display the first paragraph of the data returned. What is the best way to do this? That depends on te format of the text/paragraphs in the mysql field. How are the paragraphs separated ? regards, Ewout -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL limitations
Does anyone know what the maximun number of columns I could put in a table is?? I can't find it in manual. Like, could I have a table with 200,000 columns? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL limitations
http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=mysql+max+columnsbtnG=Google+Search Mike Mannakee wrote: Does anyone know what the maximun number of columns I could put in a table is?? I can't find it in manual. Like, could I have a table with 200,000 columns? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Store array as Session Variable
hello All, I am trying to store an array as a session variable. while ($row = mysql_fetch_array($result)) { if ( !is_array($company_name) ) $company_name = array(); array_push($company_name, $row['company']); // try to register session variable $_SESSION['link'] = $company_name; } Now when I try to access this session variable in another file...I am getting a junk value.I am not sure if I am getting this right. $details = $_SESSION['link']; echo LINK: .$details.br; Can some one fill me in on this. Appreciate it ! Thanks in advance. --Pushpinder Singh
Re: [PHP] Store array as Session Variable
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am trying to store an array as a session variable. Based on your code, it looked like your question had little to do with storing an array as a session variable. To do that, this works: $_SESSION['myarray'] = $myarray; while ($row = mysql_fetch_array($result)) { if (!is_array($company_name)) $company_name = array(); array_push($company_name, $row['company']); I cleaned up your formatting a bit, so that we can read your code more easily. Can you explain what you intend to do here? It looks to me like you expect $company_name to be populated during the $row = mysql_fetch_array($result) part, since you check whether it is an array during every iteration of the loop. Then, you are erasing its value unless it is an array. Is this right so far? Is this what you want to do? I think this bit of code is likely where your problem lies. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Store array as Session Variable
$details is an array (just like $company_name was). Try to view print_r($details); and see what you get. ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:18 PM Subject: [PHP] Store array as Session Variable hello All, I am trying to store an array as a session variable. while ($row = mysql_fetch_array($result)) { if ( !is_array($company_name) ) $company_name = array(); array_push($company_name, $row['company']); // try to register session variable $_SESSION['link'] = $company_name; } Now when I try to access this session variable in another file...I am getting a junk value.I am not sure if I am getting this right. $details = $_SESSION['link']; echo LINK: .$details.br; Can some one fill me in on this. Appreciate it ! Thanks in advance. --Pushpinder Singh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Store array as Session Variable
$details is empty !! Thanks --Pushpinder On Monday, July 28, 2003, at 03:31 PM, CPT John W. Holmes wrote: $details is an array (just like $company_name was). Try to view print_r($details); and see what you get. ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:18 PM Subject: [PHP] Store array as Session Variable hello All, I am trying to store an array as a session variable. while ($row = mysql_fetch_array($result)) { if ( !is_array($company_name) ) $company_name = array(); array_push($company_name, $row['company']); // try to register session variable $_SESSION['link'] = $company_name; } Now when I try to access this session variable in another file...I am getting a junk value.I am not sure if I am getting this right. $details = $_SESSION['link']; echo LINK: .$details.br; Can some one fill me in on this. Appreciate it ! Thanks in advance. --Pushpinder Singh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Store array as Session Variable
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am trying to store the value in row['company'] in an array called $company_name. I see now. I think you might find this a bit simpler (if I understand correctly): $company_name = array(); while ($row = mysql_fetch_assoc($result)) { $company_name[] = $row['company']; } Also, at this point, you should probably examine the contents of $company_name before bothering with the session stuff. You may be having trouble with your query or something that is totally unrelated to sessions. Try John's suggestion of print_r() by doing something like this: echo 'pre'; print_r($company_name); echo '/pre'; Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email forwarding from SendMail to PHP
Anyone know of a place to get some good tutorials on how to forward email from SendMail to PHP for processing?
Re: [PHP] MySQL limitations
You should rethink your data structure if you want to create 200,000 columns. If you need to create that many columns, chances are you are going to need to add more periodically. That means changing your table structure which you shouldn't have to do in a well defined schema. I'm guessing most of those columns would be empty for any given record. Try changing your columns to rows and have a column that you use as a row label to qualify what data that row holds. This gives you virtually unlimited elements you can track, you can add new elements very easily and it's easier to code. From a coding stand point your just changing one parameter, the data type field. Hope that leads you in the right direction. On Monday, July 28, 2003, at 03:09 PM, Mike Mannakee wrote: Does anyone know what the maximun number of columns I could put in a table is?? I can't find it in manual. Like, could I have a table with 200,000 columns? Mike -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php