[PHP] multiple instances of php.exe
Hi guys, I'm not sure if this is the right place to post this but I've looked everywhere else. I am running php on win2k in cgi mode. My server keeps locking up and refusing to serve pages. There are multiple instances of php.exe, up to 40 of them, in task manager. This can last from a couple of minutes to an hour. If I restart w3svc then this fixes the problem until the next time it starts. I use webquota connecting to an access database to control access to the site. The pages are generated from a different access database. The problem has only started over the last couple of months but the code hasn't changed in years. Has anyone experienced anything like this or have any ideas how to solve it? Thanks, Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: multiple instances of php.exe
Hi, For FAST and STABLE installation of PHP over IIS, please check: http://php.weblogs.com/fastcgi_with_php_and_iis It's really amazing how high is the speed increase .. Alexandru Matt Warner wrote: Hi guys, I'm not sure if this is the right place to post this but I've looked everywhere else. I am running php on win2k in cgi mode. My server keeps locking up and refusing to serve pages. There are multiple instances of php.exe, up to 40 of them, in task manager. This can last from a couple of minutes to an hour. If I restart w3svc then this fixes the problem until the next time it starts. I use webquota connecting to an access database to control access to the site. The pages are generated from a different access database. The problem has only started over the last couple of months but the code hasn't changed in years. Has anyone experienced anything like this or have any ideas how to solve it? Thanks, Matt. -- Alexandru COSTIN Chief Operating Officer http://www.interakt.ro/ +4021 312 5312 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble sending an image's contents as output using header Content-Type...
Manuel Vázquez Acosta wrote: Hi all: I have a page with a img tag: img src=/getthumbnail.php?fileid=12230983 Any tips? Manu. Type http://server.com/getthumbnail.php?fileid=12230983 in the location bar and see what happens. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] BRU Help
Nitin -- ...and then Nitin said... % % I'm sorry, I know this is not the list, to ask this question, but I couldn't find the right one. You're right; it isn't. Neither is the PHP-DB list. Although I've heard of it, I've never had any involvement with BRU; I think it's safe to say I'm pretty new to it. Less than sixty seconds with google led me to BMTMicro's Tech Support page where I see I am an end user. I am having all sorts of problems. Can you help me? Yes we can help you. which certainly seems like the sort of thing you need. Go there. HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] After upload problem!!
i have no problem in uploading my pictures, the problem that i have that after uploading it i can't move or copy the uploaded pictures and it gives me permession denied !! i guess thats because it gives permession only to the apache user, is there anyway i can change that?? thx for ur time guys - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
Re: [PHP] After upload problem!!
At 11:17 10-11-03, you wrote: i have no problem in uploading my pictures, the problem that i have that after uploading it i can't move or copy the uploaded pictures and it gives me permession denied !! i guess thats because it gives permession only to the apache user, is there anyway i can change that?? thx for ur time guys * do you have safe mode turned on? * what is the chmod setting of the file? Maybe it is too strict -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session vars for other session name
Hi, all -- I have a picture gallery application which uses sessions. As part of the config we set the session name; the default is 'locscout'. I also have a portfolio/presentation application layered on top of this (and almost ready for release! :-) :-) with its own session name. When I start out in my presentation app and am in management mode (and thus under a session) and have entered my password and click to go into the gallery application in management mode I have to enter the password again. Is there any way that I can set a session variable under a different session name so that I can preset this password? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] session vars for other session name
David T-G wrote: Hi, all -- I have a picture gallery application which uses sessions. As part of the config we set the session name; the default is 'locscout'. I also have a portfolio/presentation application layered on top of this (and almost ready for release! :-) :-) with its own session name. In your portfolio/presentation application: $_COOKIE['this_app_session_name'] = $_COOKIE['gallery_session_name']; just before session_start() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION[''] variable not get passed
Hi, I have apache, php 4.1.2 running on windows machine. The following are the seetings related to sessions in php.ini file register_globals =off session.autostart=1 session.use cookies=0 session.use_trans_sid=1 Now i have the following code in my default.php html head test/head body form name=form1 method=post action=frm2.php ?php session_start(); $_SESSION['mytest']=value; ? /form /body /html frm2.php html headsession value/head body form name=frm2 ?php if (isset($_SESSION['mytest'])) echo setBR; echo the session value is . $_SESSION['mytest'] .br; ? /form /body /html Now the session_id get passwd across forms but the session variable does not get passwed. Any guess what is the problem. -vimala/. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] About php
We have a data base in access 2000. Could you advise which version of php will connect to the access. Please advise also how can i open the connection . Thank you in advance for your assistance. Best regards Marlyn Estefanos Businesslink. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About php
webmaster wrote: We have a data base in access 2000. Could you advise which version of php will connect to the access. Please advise also how can i open the connection . Look into ODBC-functions: http://www.php.net/manual/en/function.odbc-connect.php -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Newbie Guide] For the benefit of new members
= This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. == 1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. Please also try http://www.php.net/manual/faq.php to get answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.com next. Searching for php YOUR QUERY may fetch you relevant results within the first 10 results, if you are lucky. 3. There is a searchable archive of the mailing list discussion at http://phparch.com/mailinglists. Many of the common topics are discussed repeatedly, and you may get answer to your query from the earlier discussions. For example: One of the repeatedly discussed question in the list is Best PHP editor. Everyone has his/her favourite editor. You can get all the opinions by going through the list archives. If you want a chosen list try this link : http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne). 4. Just put the following code into a file with a .php extension and access it through your webserver: ?php phpinfo(); ? This will display tons of info if php is enabled, or, it will ask you to download a file if php is NOT enabled. (contributed by Teren) 5. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable/sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1, 2 3) and ask for help. 6. PHP is a server side scripting language. Whatever processing PHP does takes place BEFORE the output reaches the client. Therefore, it is not possible to access the users' computer related information (OS, screen size etc) using PHP. You need to go for JavaScript and ask the question in a JavaScript list. (You can access information SENT by the user's browser while requesting pages from your server. You can get the details about browser, OS etc as reported by this request. - contributed by Wouter van Vliet) 7. Provide a clear descriptive subject line. Avoid general subjects like Help!!, A Question etc. Especially avoid blank subjects. 8. When you want to start a new topic, open a new mail composer and enter the mailing list address [EMAIL PROTECTED] instead of replying to an existing thread and replacing the subject and body with your message. 9. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question. [contribued by Chris W Parker] 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html [contributed by Jay Blanchard) Hope you have a good time programming with PHP. Best regards, -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, No 21, First Main Road, Jai Nagar, Arumbakkam, Chennai - 600106 Tel : +91 44 55191757 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] \n and br
is \n same as br I found that \n does the same function as br for some users, but not for me. I know that \n creates a break in source and not in display. Is it possible to make \n does the same function as br Thanks Regards, ___ PHPLover Göd döësn't pläy dícë. - Älbërt Ëínstëín -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] \n and br
[snip] is \n same as br I found that \n does the same function as br for some users, but not for me. I know that \n creates a break in source and not in display. Is it possible to make \n does the same function as br [/snip] http://us3.php.net/nl2br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running CLI from a web page
I have a php cli that creates a file. It works fine when I execute it from the Linux command line as php foo bar. I'm trying to also execute this by clicking a form button on a web page via system('php foo bar'). I can see that the file bar gets created but it's always empty. I've tried executing system('php foo') (directly to STDOUT) but get no output. I've tried exec('php foo',$output) but there's nothing in the array when it's done. Suggestions??? BTW, wherever I've written php above I've actually used the full path of the php executable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Running CLI from a web page
[snip] I have a php cli that creates a file. It works fine when I execute it from the Linux command line as php foo bar. I'm trying to also execute this by clicking a form button on a web page via system('php foo bar'). I can see that the file bar gets created but it's always empty. I've tried executing system('php foo') (directly to STDOUT) but get no output. I've tried exec('php foo',$output) but there's nothing in the array when it's done. Suggestions??? [/snip] Put something in script foo that will echo out some information echo foo is running\n; and then run it from the command line. If that works then run it from your form. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] \n and br
\n is the code to write a new line, between double quotes. Actually it translates to a 0D or 0A code. If there is a 0D or 0A in a text or file (or normal text email) it works as a newline. If you look at the _source_ of your HTML file you will see it too. BR is the HTML code for new line. Browsers understand only BR (well and P and H1-6 also cause a new line), they are taught to ignore the 0A and 0D. If you have a piece of text coming in from a textarea or database, it usually will have the \n type code. To show such texts in a HTML page you have to translate the \n to BR. Because this is so common, PHP has the function nl2br(). If you pronounce this say: NewLine To BReak. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_Referer
--- Josephin Tauschinger [EMAIL PROTECTED] wrote: Thank you Chris! No problem. :-) What I did was exactly what Pablo Gosse proposed and, as you stated, it didn't work: input type=hidden name=referrer value=?php echo $_SERVER['HTTP_REFERER']; ? Do you know how I can get my webserver (Apache/Unix) to parse html files for php-scripts? Yes, this can be done, but are you sure this is what you want to do? There are advantages and disadvantages to both. For example, if you have a lot of HTML files, and you tell Apache to treat them as PHP, there will be some work that Apache does for no reason. On the other hand, some people prefer to hide what server-side technologies (such as PHP) that they are using. If this is really what you want to do, try adding this to httpd.conf: AddType application/x-httpd-php .html Then restart your Web server. Alternatively, just use a .php extension for PHP scripts. It is likely that your Web server already knows what to do with these. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n and br
--- PHPLover [EMAIL PROTECTED] wrote: is \n same as br This is not true. I know that \n creates a break in source and not in display. Is it possible to make \n does the same function as br No, but you can convert your newlines to the HTML equivalent: http://www.php.net/nl2br Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] resource handle - keeping alive?
Here's a quick one: has anyone found a way to keep a resource handle alive between page loads? For example, I open a socket with fsockopen, and I'd like the handle to survive page loads. As you know, there's not much point storing it in a session (or its parent object)... Any ideas? Tx, Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP developers
Follow-up question: If I have a specific project that I'm hiring for, would it be inappropriate to post it here? James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Can anyone recommend a good place where I can find some talented PHP contractors? I'm looking to hire some people for some upcoming projects, and I don't want to just put an ad in the paper and get a bunch of responses from barely-qualified people. Thanks, J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
At 16:09 10-11-03, you wrote: Here's a quick one: has anyone found a way to keep a resource handle alive between page loads? For example, I open a socket with fsockopen, and I'd like the handle to survive page loads. As you know, there's not much point storing it in a session (or its parent object)... Any ideas? I never used it but what about pfsockopen() ? http://ww.php.net/manual/en/function.pfsockopen.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Digital Signatures or opennssl examples
Does anyone know of some good links to material on Digital Signatures or openssl examples, articles, tutorials or discussions?? Of course, implemented in PHP. -- Justin Hannus Lead Programmer/Web Development [EMAIL PROTECTED] www.visualconceptsinc.com [860] 242.1150 ext.125 [860] 242.1446 fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Generating test data
I would like to create some dummy mysql tables for load testing an application. Are there any tools that would make this task easier? At the moment I'm thinking of generating a series of arrays based on actual data (i.e Select distinct fielndname, followed by an array_push). And then randomly picking items from each array to create the dummy table rows. thanks, Luis R. Lebron Sigmatech, Inc
Re: [PHP] Digital Signatures or opennssl examples
--- Justin Hannus [EMAIL PROTECTED] wrote: Does anyone know of some good links to material on Digital Signatures or openssl examples, articles, tutorials or discussions?? Of course, implemented in PHP. I don't know of any tutorials, but the documentation has quite a bit of information: http://www.php.net/openssl Also, if you read through the documentation for each of the functions, you might find some good user notes. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP developers
--- James [EMAIL PROTECTED] wrote: Follow-up question: If I have a specific project that I'm hiring for, would it be inappropriate to post it here? As long as you're looking for a PHP developer, this is the place to post. :-) If it is ever decided that such things should not be posted here, I imagine we will start a jobs list. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Hi Chris, no, unfortunately, that doesn't work; it creates a permanent socket on the server, but between page reads, php still loses its resource id, and can't communicate with the socket... Martin Chris Hayes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At 16:09 10-11-03, you wrote: Here's a quick one: has anyone found a way to keep a resource handle alive between page loads? For example, I open a socket with fsockopen, and I'd like the handle to survive page loads. As you know, there's not much point storing it in a session (or its parent object)... Any ideas? I never used it but what about pfsockopen() ? http://ww.php.net/manual/en/function.pfsockopen.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
--- Martin Helie [EMAIL PROTECTED] wrote: no, unfortunately, that doesn't work; it creates a permanent socket on the server, but between page reads, php still loses its resource id, and can't communicate with the socket... The last two user notes on this page seem relevant: http://www.php.net/pfsockopen Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session vars for other session name
Marek, et al -- ...and then Marek Kilimajer said... % % David T-G wrote: % % I have a picture gallery application which uses sessions. As part of the % config we set the session name; the default is 'locscout'. % % I also have a portfolio/presentation application layered on top of this % (and almost ready for release! :-) :-) with its own session name. % % In your portfolio/presentation application: % % $_COOKIE['this_app_session_name'] = $_COOKIE['gallery_session_name']; % % just before session_start() I'm a bit confused... I haven't tried this yet, so maybe it will all come clear when I do, but I'm still confused! So where I currently have session_name($wfname) ; session_start ; ... I'd instead have session_name($wfname) ; $_COOKIE[$wfname] = $_COOKIE['locscout'] ; session_start ; ... or so. But what does that buy me? How will then setting my password at one level (presentation) also set it at another (gallery)? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] resource handle - keeping alive?
Quick answer: as others before me have also mentioned this cannot be done. Martin Helie wrote: Here's a quick one: has anyone found a way to keep a resource handle alive between page loads? For example, I open a socket with fsockopen, and I'd like the handle to survive page loads. As you know, there's not much point storing it in a session (or its parent object)... Any ideas? Tx, Martin -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Digital Signatures or opennssl examples
Yes, I'm actually gonging through the documentation now and am finding some good but maybe incomplete or short examples on certain functions but am looking for a more complete or round about example on the whole picture. I guess I can piece together multiple examples of functions but was inquiring about a broader example. Anyone else?? Thanks Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Justin Hannus [EMAIL PROTECTED] wrote: Does anyone know of some good links to material on Digital Signatures or openssl examples, articles, tutorials or discussions?? Of course, implemented in PHP. I don't know of any tutorials, but the documentation has quite a bit of information: http://www.php.net/openssl Also, if you read through the documentation for each of the functions, you might find some good user notes. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session vars for other session name
David T-G wrote: I'm a bit confused... I haven't tried this yet, so maybe it will all come clear when I do, but I'm still confused! So where I currently have session_name($wfname) ; session_start ; ... I'd instead have session_name($wfname) ; $_COOKIE[$wfname] = $_COOKIE['locscout'] ; session_start ; ... or so. But what does that buy me? How will then setting my password at one level (presentation) also set it at another (gallery)? You will have the same session variables accessible in your script. I forgot to mention you should do the same for $_GET and $_POST if you want it to work without cookies. TIA HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] safe writing by apache
Hi, all -- The way our web hosting is set up, files written by apache under a site directory tree tree have the site groupship but that directory nonetheless must be world writable. The only answer from the host was to, yes, avoid 777 and use chown/chgrp instead. Now I can do that, but it requires root access and is beyond the capabilities (much less permissions!) of many of the site admins that we host. Is there any conventional wisdom regarding setting up dirs for writing files by apache? I have yet to test and see if a php script running here in site 21 can look inside the dir tree there for site22 and if locking down 'other' perms will break anything else, and I am playing with ideas of a separate apache or httpd directory with perms open ough to write so that I can create it once as part of starup and not bother again, but I'm still on very fresh ground. I can't believe I'm the only one to have run across this problem :-) What do you all do? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] session vars for other session name
Marek, et al -- ...and then Marek Kilimajer said... % % David T-G wrote: ... % or so. But what does that buy me? How will then setting my password at % one level (presentation) also set it at another (gallery)? % % You will have the same session variables accessible in your script. Oho. That's interesting, indeed. By overwriting or by duplicating? That is, do I include the session name when I access this data or does $pw in the gallery overwrite (or get overwritten by) $pw in presentation? % % I forgot to mention you should do the same for $_GET and $_POST if you % want it to work without cookies. OK; will do. And what about $_SESSION as well? % % TIA HAND again :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
RE: [PHP] resource handle - keeping alive?
Hi, Quick answer: as others before me have also mentioned this cannot be done. has anyone found a way to keep a resource handle alive between page loads? I've missed most of this thread, but thought I'd let you know what I'm going for a socket setup right now. It may or may not fit your scenario. On my server, I have a process running called 'gateway'. Its a Perl script that opens up a socket to where I want to go, and opens up a socket to listen for information coming from the web site. PHP Web Site - gateway - Merchant Services This allows us to have a constant socket connection to them (they require this), and defeats losing the connection when the php script terminates. We only get 2 sockets with them at once. We could have up to 15 - 20 at once being needed. This fixes that. You could do this all in PHP. I chose Perl for the server side because I felt it was the way to implement it with our current setup. I don't know if that helps, but maybe it could give you some other things to think about in solving this dilema. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Hi Chris, yes, that's precisely my problem (I had read the notes). This seems like something people would want to do, so I'm surprised no one's found some workaround. Any other ideas? Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Martin Helie [EMAIL PROTECTED] wrote: no, unfortunately, that doesn't work; it creates a permanent socket on the server, but between page reads, php still loses its resource id, and can't communicate with the socket... The last two user notes on this page seem relevant: http://www.php.net/pfsockopen Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Hi Martin, This is unfortunately not something that has an easy work around. I have seen a post by Dan Joseph with what looks like a good suggestion. If my understanding of J2EE is correct, i believe you will be able to persist connections between two different pages if you use java servlets. all the best Martin Helie wrote: Hi Chris, yes, that's precisely my problem (I had read the notes). This seems like something people would want to do, so I'm surprised no one's found some workaround. Any other ideas? Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Martin Helie [EMAIL PROTECTED] wrote: no, unfortunately, that doesn't work; it creates a permanent socket on the server, but between page reads, php still loses its resource id, and can't communicate with the socket... The last two user notes on this page seem relevant: http://www.php.net/pfsockopen Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DW Php update record form with menu from another table
I'm using Dreamweaver's Update Record form wizard to create a record update page. Most of the fields are text, one is file and I want one of them to be a menu. The menu field should be populated with the fields of another table. Here's the problem... If I leave all of the fields as text input fields, the form works fine. But, as soon as I change the manufacturers field to a drop-down menu populated with entries from another table, I get the following error when accessing the page... Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/s/k/user992816/html/RobesonWeb/admin/adminEditSpecials.php on line 106 line 106 reads... option value=?php echo $row_rs_RobesonWebManufacturer['manufacturer']? ?php if (!(strcmp($row_rs_RobesonWebManufacturer['manufacturer'], $row_rs_RobesonWebSpecials[\'manufacturer\']))) {echo SELECTED;} ??php echo $row_rs_RobesonWebManufacturer['manufacturer']?/option Needless to say, this line is embedded in this Php code to create the drop-down menu... select name=manufacturer ?php do { ? option value=?php echo $row_rs_RobesonWebManufacturer['manufacturer']? ?php if (!(strcmp($row_rs_RobesonWebManufacturer['manufacturer'], $row_rs_RobesonWebSpecials[\'manufacturer\']))) {echo SELECTED;} ??php echo $row_rs_RobesonWebManufacturer['manufacturer']?/option ?php } while ($row_rs_RobesonWebManufacturer = mysql_fetch_assoc $rs_RobesonWebManufacturer)); ? /select What's up? These drop-downs from another table work fine in Add forms. They just seem to crap out in Update forms. It was suggested that I needed to create recordsets for both the menu and the rest of the form. I did that and the form still doesn't work. Attached is the entire page for consulting. I've also posted this message on Dreamweaver's newsgroup but haven't been getting any responses so thought I'd see if this group had any suggestions. Thanx, -- Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams http://www.digitaliguana.com http://www.cancerreallysucks.org adminEditSpecials.zip Description: Attached file: adminEditSpecials.zip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reply to a email with PHP
Hi folks, What I would like to do in PHP is the following: * read my mailbox on the server * select some mails * reply to theses mails. I have looked among the PHP imap API, and I did not found any like imap_reply. What should I do? Many thanks for helping. Paul BELAVAL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Whats wrong with this query?
$addamysqluser = mysql_query(grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]); What is wrong with the above php based mysql_query ? I am trying to add a user to mysql granting just the specified rights to table defined by the $_POST[f2] which is both the table and username and the password is defined by $_POST[f3]. This has been baffleing me for a couple of days now and any help given is very much appreciated. Thank you in advance. Yours Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.535 / Virus Database: 330 - Release Date: 01/11/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reply to a email with PHP
Hi, You probably didn't find anything in the imap api because mail reply is handled by SMTP. You can use the IMAP library to read your mail, however you need to use either the simple old mail() function or one of the more sophisticated MIME mail classes available to send replies or new messages. all the best [EMAIL PROTECTED] wrote: Hi folks, What I would like to do in PHP is the following: * read my mailbox on the server * select some mails * reply to theses mails. I have looked among the PHP imap API, and I did not found any like imap_reply. What should I do? Many thanks for helping. Paul BELAVAL -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whats wrong with this query?
Hi Dave, I could be wrong cause i am answering without running your code : 1) your mysql user account probably does not have grant privileges. good thing too. It's very dangerous to just run a grant query like this because it can so easily be abused by a malicious user. (of course you might have security measures in place which are not obvious to us because you have not posted that part of the code). 2) your variables should in the strictest sense be $_POST['f2'] etc. all the best Dave Carrera wrote: $addamysqluser = mysql_query(grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]); What is wrong with the above php based mysql_query ? I am trying to add a user to mysql granting just the specified rights to table defined by the $_POST[f2] which is both the table and username and the password is defined by $_POST[f3]. This has been baffleing me for a couple of days now and any help given is very much appreciated. Thank you in advance. Yours Dave C -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Whats wrong with this query?
Dave Carrera mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 8:45 AM said: $addamysqluser = mysql_query(grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]); What is wrong with the above php based mysql_query ? 1. What error are you getting? (This information should always be included in a why isn't this working? post.) 2. How do you know it's not working? 3. Assign your sql statement to a variable and then pass that variable to the mysql_query() function. Then echo the variable used to store the query and see if everything looks right to you. 4. Have you tried putting single quotes around the $_POST indexes? i.e. $_POST['f2'] 5. (I believe) You need to put { and } around your $_POST variables. i.e. {$_POST['f2']} HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Hi Dan, sounds like a good idea. How does 'gateway' actually listen in on the website session? Is it simply invoked by the website with specific arguments? Tx, Martin Dan Joseph [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Quick answer: as others before me have also mentioned this cannot be done. has anyone found a way to keep a resource handle alive between page loads? I've missed most of this thread, but thought I'd let you know what I'm going for a socket setup right now. It may or may not fit your scenario. On my server, I have a process running called 'gateway'. Its a Perl script that opens up a socket to where I want to go, and opens up a socket to listen for information coming from the web site. PHP Web Site - gateway - Merchant Services This allows us to have a constant socket connection to them (they require this), and defeats losing the connection when the php script terminates. We only get 2 sockets with them at once. We could have up to 15 - 20 at once being needed. This fixes that. You could do this all in PHP. I chose Perl for the server side because I felt it was the way to implement it with our current setup. I don't know if that helps, but maybe it could give you some other things to think about in solving this dilema. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] resource handle - keeping alive?
Hi, sounds like a good idea. How does 'gateway' actually listen in on the website session? Is it simply invoked by the website with specific arguments? It has a socket connection that waits for an incoming request from the web site, and then it takes what was sent from the web site, processes it, and sends a response. here's some code: Perl: #!/usr/bin/perl use IO::Socket; $SIG{CHLD} = sub { wait () }; my $nc_sock = new IO::Socket::INET ( LocalHost = '192.168.3.4', LocalPort = '7070', Proto = 'tcp', Listen= 5, Reuse = 1 ); while ( $nclive_sock = $nc_sock-accept() ) { $pid = fork(); if ($pid == 0) { while ( defined( $buf = $nclive_sock ) ) { print $buf; if ( substr( $buf, 0, 3 ) eq '000' ) { print $nclive_sock 4230994111470002220001423\n ; } else { print $nclive_sock Hello to you too!\n; } } exit(0); } } close ( $nc_sock ); Here is the PHP Web site: $fp = fsockopen (192.168.3.4, 7070, $errno, $errstr, 90); if ( !$fp ) { echo $errstr ($errno)br\n; } else { fputs ( $fp, $auth_msg\n ); $response = process_response( fgets( $fp ) ); printf( %s - %s, process_code( $response['code'] ), $response['msg'] ); fclose( $fp ); } Hope that helps... -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whats wrong with this query?
--- Dave Carrera [EMAIL PROTECTED] wrote: $addamysqluser = mysql_query(grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]); What is wrong with the above php based mysql_query? I'm not sure about the query itself, but it seems to me your problem is more about using strings with PHP. $foo = grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]; echo $foo; Try that, and I think the output will show you the problem. The solution is to use curly braces around $_POST['f2'], in addition to properly quoting the key as I just did. In order to more easily identify problems like this, you can: 1. Store the query in a variable, and use that variable in mysql_query(). This will allow you to echo it to the screen or something during debugging, so that you can identify anything obvious, such as this. 2. Output mysql_error() if mysql_query() does not return true. This will show you what MySQL thinks the error is, which is very helpful. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] explode () question
Hello All, I'm having trouble with this; $rint1= rtrim($rintydata); echo $rint1; $rint2= explode(:, $rint1); The data starts like this (from and email, there are many) ; Time: November 9th 2003, 10:37AM - PST IP Address: xx.xx.xxx.xxx Browser Type: Opera/7.20 (Windows NT 5.1; U) [en] Referer: The problem is that when I do this ; while( $res=each($rint2) ) { echo br$res[1]br; }; the colon in Time messes things up. here is the result ; Time November 8th 2003, 07 15PM - PST IP Address xx.xx.xx.xxx Browser Type Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer when what I really want is ; Time - November 8th 2003, 07:15PM - PST IP - Address xx.xx.xx.xxx Browser Type - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer - I can't figure out how to do an ereg that will replace just the colon in Time nor can I find a way to make explode ignore it. This may even be a completely wrong approach, any help would be appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode () question
$rint1= rtrim($rintydata); echo $rint1; $rint2= explode(:, $rint1); The data starts like this (from and email, there are many) ; Time: November 9th 2003, 10:37AM - PST IP Address: xx.xx.xxx.xxx Browser Type: Opera/7.20 (Windows NT 5.1; U) [en] Referer: The problem is that when I do this ; while( $res=each($rint2) ) { echo br$res[1]br; }; the colon in Time messes things up. here is the result ; Time November 8th 2003, 07 15PM - PST IP Address xx.xx.xx.xxx Browser Type Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer when what I really want is ; Time - November 8th 2003, 07:15PM - PST IP - Address xx.xx.xx.xxx Browser Type - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer - I can't figure out how to do an ereg that will replace just the colon in Time nor can I find a way to make explode ignore it. This may even be a completely wrong approach, any help would be appreciated. Do you first split the lines? What about a simple strpos and substr? $colon=strpos(':',$res) will get you the position of only the 1st colon. then strpos ($res, 0, $colon-1) will get you the 1st part and strpos ($res, $colon, strlen($res)) the second part. disclaimers: not tested. not guaranteed to be working. just a suggestion. check the manual to fix it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] explode () question
Malcolm mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 9:13 AM said: I can't figure out how to do an ereg that will replace just the colon in Time nor can I find a way to make explode ignore it. This may even be a completely wrong approach, any help would be appreciated. What you'll probably want to do is write a regex that changes the colon you're trying to separate on into something else. Go from: Time: ... Other Thing: ... Different: ... To: Time% ... Other Thing% ... Different% ... After you've done this you can easily explode() based on the %. I'm not very good with regex's off the top of my head so I suggest you get The Regex Coach (easily found via google) and experiment. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form not working...
For some reason my form to edit selected items is not working, I think I need a new set of eyes. Any help is appreciated... Jas // inc.php function db_retrieve() { require 'dbase.inc.php'; $tble = $_SESSION['table']; $show = @mysql_query(SELECT * FROM $tble LIMIT 0, 15,$db)or die(mysql_error()); while ($row = @mysql_fetch_array($show)) { @list($nItemSKU, $bActive, $nUserID, $nItemConfig, $tItemType, $tDepartment, $blSerialNumber, $nPropertyNumber, $blHostName, $nIPID, $tRoomNumber, $tNotes) = $row; $_SESSION['table'] .= tr class=fntMAINtd valign=top align=left$nItemSKU/td td valign=top align=left$bActive/td td valign=top align=left$nUserID/td td valign=top align=left$nItemConfig/td td valign=top align=left$tItemType/td td valign=top align=left$tDepartment/td td valign=top align=left$blSerialNumber/td td valign=top align=left$nPropertyNumber/td td valign=top align=left$blHostName/td td valign=top align=left$nIPID/td td valign=top align=left$tRoomNumber/td td valign=top align=left$tNotes/td td valign=top align=leftinput name=edit type=checkbox value=$blSerialNumber/td /tr; } $_SESSION['number'] = mysql_num_rows($show); } ?php session_start(); require 'scripts/inc.php'; if ((!isset($_POST['edit'])) or ($_POST = )) { $_SESSION['table'] = t_items; call_user_func(db_retrieve); } elseif ((isset($_POST['edit'])) or (!$_POST = )) { require 'scripts/dbase.inc.php'; $tble = $_SESSION['table']; $edt = mysql_query(SELECT * FROM $tble WHERE blSerialNumber=\$edit\,$db)or die(mysql_error()); while ($row = mysql_fetch_array($edt)) { list($nItemSKU, $bActive, $nUserID, $nItemConfig, $tItemType, $tDepartment, $blSerialNumber, $nPropertyNumber, $blHostName, $nIPID, $tRoomNumber, $tNotes) = $row; $_SESSION['table'] .= tr class=fntMAIN td valign=top align=leftinput name=nItemSKU type=text size=30 value=$nItemSKU/td td valign=top align=leftinput name=bActive type=text size=30 value=$bActive$bActive/td td valign=top align=leftinput name=nUserID type=text size=30 value=$nUserID$nUserID/td td valign=top align=leftinput name=nItemConfig type=text size=30 value=$nItemConfig$nItemConfig/td td valign=top align=leftinput name=tItemType type=text size=30 value=$tItemType$tItemType/td td valign=top align=leftinput name=tDepartment type=text size=30 value=$tDepartment$tDepartment/td td valign=top align=leftinput name=blSerialNumber type=text size=30 value=$blSerialNumber$blSerialNumber/td td valign=top align=leftinput name=nPropertyNumber type=text size=30 value=$nPropertyNumber$nPropertyNumber/td td valign=top align=leftinput name=blHostName type=text size=30 value=$blHostName$blHostName/td td valign=top align=leftinput name=nIPID type=text size=30 value=$nIPID$nIPID/td td valign=top align=leftinput name=tRoomNumber type=text size=30 value=$tRoomNumber$tRoomNumber/td td valign=top align=leftinput name=tNotes type=text size=30 value=$tNotes$tNotes/td td valign=top align=leftinput name=save type=button value=Save class=frmBTNS/td /tr; } } ? form action=?php echo $_SERVER['PHP_SELF']; ? method=post ?php echo $_SESSION['table']; ? input name=edit type=button value=edit selected items class=frmBTNS /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pausing in PHP
Hi, Is there a PHP function that would allow the script execution to pause 'N' seconds? This is analogous to the dBase inkey() function. Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Pausing in PHP
Hi, Is there a PHP function that would allow the script execution to pause 'N' seconds? This is analogous to the dBase inkey() function. sleep(20); 20 = seconds -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] explode () question
(after more and more discussion, this will be my first non-top post) $rint1= rtrim($rintydata); echo $rint1; $rint2= explode(:, $rint1); The data starts like this (from and email, there are many) ; Time: November 9th 2003, 10:37AM - PST IP Address: xx.xx.xxx.xxx Browser Type: Opera/7.20 (Windows NT 5.1; U) [en] Referer: The problem is that when I do this ; while( $res=each($rint2) ) { echo br$res[1]br; }; the colon in Time messes things up. here is the result ; Time November 8th 2003, 07 15PM - PST IP Address xx.xx.xx.xxx Browser Type Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer when what I really want is ; Time - November 8th 2003, 07:15PM - PST IP - Address xx.xx.xx.xxx Browser Type - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer - I'd try something like: 1 ?php 2 $String = 'From: Wouter van Vliet [EMAIL PROTECTED]'; 3 preg_match('/^\s*([^:]*)\s*:\s*(.*)$/', $String, $Matches); 4 5 print_r($Matches); 6 7 ? == OUTPUT: Array ( [0] = From: Wouter van Vliet [EMAIL PROTECTED] [1] = From [2] = Wouter van Vliet [EMAIL PROTECTED] ) From here you'd be able to manipulate the things you want in any format you'd want it to have. Or use preg_match_all() if you have all mail headers in one variable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Whats wrong with this query?
-Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED] Sent: maandag 10 november 2003 17:45 To: [EMAIL PROTECTED] Subject: [PHP] Whats wrong with this query? $addamysqluser = mysql_query(grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]); What is wrong with the above php based mysql_query ? The value you use for the IDENTIFIED BY clause (which is, of course, the password) should be quoted in mysql because it is a value. Both table and username are sortoff 'objects'. Try this: $Query = 'GRANT select, insert, drop, update, delete, create, index, alter ON '.$_POST['f2'].' TO '.$_POST['f2'].' IDENTIFIED BY '.mysql_escape_string($_POST['f3']).''; mysql_query($Query); if (mysql_error()) print mysql_error(); What I also just noted was that you use $_POST[f2] twice, if you are not also creating a table with the same name as the user this is probably not what you meant. It might just, but it looks odd to me. Wouter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pausing in PHP
--- Donpro [EMAIL PROTECTED] wrote: Is there a PHP function that would allow the script execution to pause 'N' seconds? This is analogous to the dBase inkey() function. When I search Google for PHP pause, the firt result mentions the sleep() function. Did you try finding the answer yourself first? Please try to do so in the future. Thanks. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode () question
Thanks to everyone who replied. I have taken the short route and changed the source data. I should have thought of that first I suppose. Now I have a few existing records to edit but from now on I'll be automagic. On Mon, 10 Nov 2003 19:00:52 +0100, Wouter Van Vliet [EMAIL PROTECTED] wrote: (after more and more discussion, this will be my first non-top post) $rint1= rtrim($rintydata); echo $rint1; $rint2= explode(:, $rint1); The data starts like this (from and email, there are many) ; Time: November 9th 2003, 10:37AM - PST IP Address: xx.xx.xxx.xxx Browser Type: Opera/7.20 (Windows NT 5.1; U) [en] Referer: The problem is that when I do this ; while( $res=each($rint2) ) { echo br$res[1]br; }; the colon in Time messes things up. here is the result ; Time November 8th 2003, 07 15PM - PST IP Address xx.xx.xx.xxx Browser Type Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer when what I really want is ; Time - November 8th 2003, 07:15PM - PST IP - Address xx.xx.xx.xxx Browser Type - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Referer - I'd try something like: 1 ?php 2 $String = 'From: Wouter van Vliet [EMAIL PROTECTED]'; 3 preg_match('/^\s*([^:]*)\s*:\s*(.*)$/', $String, $Matches); 4 5 print_r($Matches); 6 7 ? == OUTPUT: Array ( [0] = From: Wouter van Vliet [EMAIL PROTECTED] [1] = From [2] = Wouter van Vliet [EMAIL PROTECTED] ) From here you'd be able to manipulate the things you want in any format you'd want it to have. Or use preg_match_all() if you have all mail headers in one variable. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New module
Hello I'm planing to build a module for debuging like i use in my programs... i can explain... i just wanna do debug some lines from my script, just to know any var or lineand i'll use this function: debug() function debug() will display line number and filenamethis is the problem! how can i get __LINE__ and __FILE__ constants from my module code? and i plan to create debugvar($var) too is possible to get this var on my module code too?? Thanks for any help! __ Jonis (Work) ICQ#: 8931053 Current ICQ status: + More ways to contact me __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to handle the POST data
I wrote a discussion board in PHP recently The board consis of three php files: forum.php, readforum.php, writeforum.php In my design, - The writeforum.php file will generate a form. - Once user submit the form, it return a new thread in POST to the forum.php. - The forum.php will receive the data and process them, afterward - The forum.php (ALSO) will generate an index table of it. The problem is: right after a submit process, POSTDATA still stored in the user's browser. When one submit a thread, read the index table of forum.php, and press Reflash, the browser will give a message like: The page you are browsing contains POSTDATA. If you Re-submit the information, the webpage will do the action again... What can I do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Great! Thanks Dan. I'll be making a php version of something similar. Martin Dan Joseph [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, sounds like a good idea. How does 'gateway' actually listen in on the website session? Is it simply invoked by the website with specific arguments? It has a socket connection that waits for an incoming request from the web site, and then it takes what was sent from the web site, processes it, and sends a response. here's some code: Perl: #!/usr/bin/perl use IO::Socket; $SIG{CHLD} = sub { wait () }; my $nc_sock = new IO::Socket::INET ( LocalHost = '192.168.3.4', LocalPort = '7070', Proto = 'tcp', Listen= 5, Reuse = 1 ); while ( $nclive_sock = $nc_sock-accept() ) { $pid = fork(); if ($pid == 0) { while ( defined( $buf = $nclive_sock ) ) { print $buf; if ( substr( $buf, 0, 3 ) eq '000' ) { print $nclive_sock 4230994111470002220001423\n ; } else { print $nclive_sock Hello to you too!\n; } } exit(0); } } close ( $nc_sock ); Here is the PHP Web site: $fp = fsockopen (192.168.3.4, 7070, $errno, $errstr, 90); if ( !$fp ) { echo $errstr ($errno)br\n; } else { fputs ( $fp, $auth_msg\n ); $response = process_response( fgets( $fp ) ); printf( %s - %s, process_code( $response['code'] ), $response['msg'] ); fclose( $fp ); } Hope that helps... -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to handle the POST data
Koala Yeung mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 11:05 AM said: When one submit a thread, read the index table of forum.php, and press Reflash, the browser will give a message like: The page you are browsing contains POSTDATA. If you Re-submit the information, the webpage will do the action again... What can I do? I suggest you do your processing on a separate page THEN redirect* the user to whatever page you want them to be at after the processing is done. This will eliminate your problem. HTH, Chris. * redirect in PHP using the header() function. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to handle the POST data
--- Koala Yeung [EMAIL PROTECTED] wrote: The problem is: right after a submit process, POSTDATA still stored in the user's browser. When one submit a thread, read the index table of forum.php, and press Reflash, the browser will give a message like: The page you are browsing contains POSTDATA. If you Re-submit the information, the webpage will do the action again... What can I do? There are many solutions. My favorite: 1. Have an intermediate page that does whatever processing you need, then redirect to a different URL for display using: header('Location: http://example.org/path/to/script.php'); In this case, the series of events would look something like this: writeforum.php - add_post.php - forum.php The add_post.php script will not appear in the browser's history mechanism, and the user will not see a warning whenever refreshing the forum.php page. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] location= Construct Doc
Hi... I'm looking at an existing application that uses a number of statements like: location = page2.php; I thought I'd seen it somewhere in the PHP doc, but can't find it now.. Can anyone point me to where it's written up? Thanks, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] location= Construct Doc
[snip] I'm looking at an existing application that uses a number of statements like: location = page2.php; I thought I'd seen it somewhere in the PHP doc, but can't find it now.. Can anyone point me to where it's written up? [/snip] http://www.php.net/header -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems configuring --with-xpm-dir
Hi, I'm in the middle of setting up a new box to test Apache/PHP on the new Fedora 1 core, and I'm having some issues getting configure to run with --with-xpm-dir. I've installed the libXpm libraries (libXpm.3.4f-ELF) from ftp://metalab.unc.edu/pub/Linux/libs/X/!INDEX.html, but I get this error when running configure checking for XpmFreeXpmImage in -lXpm... no configure: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information. config.log has this configure:30608: checking for XpmFreeXpmImage in -lXpm configure:30627: gcc -o conftest -g -O2 -DDMALLOC_FUNC_CHECK -Wl,-rpath,/usr/X1 1R6/lib -L/usr/X11R6/lib -Wl,-rpath,/usr/lib/gcc-lib/i386-redhat-linux/3.3.2 -L /usr/lib/gcc-lib/i386-redhat-linux/3.3.2 -Wl,-rpath,/usr/local/ssl/lib -L/usr/lo cal/ssl/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lX11 conftest.c -lXpm - lpng -lz -ljpeg -lexslt -lxsltbreakpoint -lxml2 -lxslt -lz -lgdbm -lcurl -lcrack -lcpdf -ltiff -ljpeg -lbz2 -lz -lssl -lcrypto -ldmalloc -lresolv -lm -ldl -lnsl -lgcc -lcurl -lz -lssl -lcrypto -ldl -lz -lxml2 -lz -lm 15 /usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status configure: failed program was: #line 30616 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XpmFreeXpmImage(); int main() { XpmFreeXpmImage() ; return 0; } The libXpm binaries are installed in /usr/X11R6, and I use that directory with the configure line... --with-xpm-dir=/usr/X11R6 This is a Fedora 1 core box with Apache 1.3.29, trying to install php 4.3.4. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location= Construct Doc
I see the Location: of the Header function there, but what I see in the code is just a location = and a page name... No header function... Is it the same thing? Lee Jay Blanchard wrote: [snip] I'm looking at an existing application that uses a number of statements like: location = page2.php; I thought I'd seen it somewhere in the PHP doc, but can't find it now.. Can anyone point me to where it's written up? [/snip] http://www.php.net/header -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location= Construct Doc
--- Lee Stewart [EMAIL PROTECTED] wrote: I'm looking at an existing application that uses a number of statements like: location = page2.php; I thought I'd seen it somewhere in the PHP doc, but can't find it now.. Can anyone point me to where it's written up? The HTTP header itself is defined in RFC 2616 in section 14.30: -- 14.30 Location The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource. For 201 (Created) responses, the Location is that of the new resource which was created by the request. For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI. Location = Location : absoluteURI An example is: Location: http://www.w3.org/pub/WWW/People.html Note: The Content-Location header field (section 14.14) differs from Location in that the Content-Location identifies the original location of the entity enclosed in the request. It is therefore possible for a response to contain header fields for both Location and Content-Location. Also see section 13.10 for cache requirements of some methods. -- PHP can send HTTP headers using the header() function: http://www.php.net/header Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] location= Construct Doc
Lee Stewart mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 12:18 PM said: I see the Location: of the Header function there, but what I see in the code is just a location = and a page name... No header function... Is it the same thing? $location = page.php; is nothing more than a value being assigned to a variable. that variable needs to be used somewhere (or else it'd just be a waste of resources). the most likely situation is what people have suggested so far. that is, the $location variable is being used in a redirect, i.e. header(Location: $location); but in answer to your question, no they are not the same thing. HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New module
Jonis Maurin Ceara wrote: Hello I'm planing to build a module for debuging like i use in my programs... i can explain... i just wanna do debug some lines from my script, just to know any var or lineand i'll use this function: debug() function debug() will display line number and filenamethis is the problem! how can i get __LINE__ and __FILE__ constants from my module code? and i plan to create debugvar($var) too is possible to get this var on my module code too?? In php = 4.3.2 you need to pass the information to the function: debugvar($var, __FILE__, __LINE__); In php = 4.3.3 you can use debug_backtrace() function, check the manual. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location= Construct Doc
It's not $location = xxx, just location = page.php; And it seems to work as a redirect... But not part of the header fuction, and not just setting a variable... Lee Chris W. Parker wrote: Lee Stewart mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 12:18 PM said: I see the Location: of the Header function there, but what I see in the code is just a location = and a page name... No header function... Is it the same thing? $location = page.php; is nothing more than a value being assigned to a variable. that variable needs to be used somewhere (or else it'd just be a waste of resources). the most likely situation is what people have suggested so far. that is, the $location variable is being used in a redirect, i.e. header(Location: $location); but in answer to your question, no they are not the same thing. HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SESSION[''] variable not get passed
S.P.Vimala wrote: Now the session_id get passwd across forms but the session variable does not get passwed. Any guess what is the problem. -vimala/. You need to call session_start() on frm2.php to resume the session http://us2.php.net/manual/en/function.session-start.php -- [EMAIL PROTECTED] http://www.phpexamples.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble sending an image's contents as output using header Content-Type...
Type http://server.com/getthumbnail.php?fileid=12230983 in the location bar and see what happens. I have already done it; it didn't work. Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location= Construct Doc
--- Lee Stewart [EMAIL PROTECTED] wrote: It's not $location = xxx, just location = page.php; So the dollar sign is missing? Can you show us all of the code in question? (Or did I miss it?) And it seems to work as a redirect... But not part of the header fuction, and not just setting a variable... Location is an HTTP header. If that name is being used in any code for some other reason, then the name may be purely coincidental. However, if it is the header you are speaking of, then it is specified using: header('Location: http://example.org/path/to/script.php'); Of particular note is that the URL is an absolute URL, not a relative one. This is in the snippet of the specification that I quoted earlier. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] location= Construct Doc
Lee Stewart mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 12:42 PM said: It's not $location = xxx, just location = page.php; And it seems to work as a redirect... But not part of the header fuction, and not just setting a variable... Hmm.. Never seen that before and the only time I've seen variables without a $ is for a constant, but then again I don't think you can set a constant dynamically, i.e. constant = value; (hence the name constant). If you're not already doing it, posting the code would be good. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location= Construct Doc
Here's a *working* section of code... Note the location = browse.php; on line 23 ? $errmsg = ''; if( isset($username) ) { require_once('Connections/mySql.php'); mysql_select_db($database_mySql, $mySql); $rs = mysql_query(select * from employee where initials = ' . strtoupper($username) . ', $mySql) or die(mysql_error($mySql)); if( !(mysql_num_rows($rs)) ) { // not a valid username mysql_free_result($rs); $errmsg = Invalid Userid; unset($username); } else { // valid user, now validate password and status $row = mysql_fetch_assoc($rs); mysql_free_result($rs); if( $row['pw'] == $password ) { // if correct password if( $row['status'] == 'a' || $row['status'] == 'm' ) { // if active user $username = strtoupper($username); session_register(username); $authlevel = $row['status']=='a'?1:2; session_register(authlevel); mysql_query(update employee set lastlogin = . (time()-10800) . where initials = '$username', $mySql) or die(mysql_error($mySql)); session_write_close(); location = browse.php; exit; } else { // not active user $errmsg = Invalid Userid; unset($username); } } else { // incorrect password $errmsg = Invalid Password; unset($password); } } } session_write_close(); ? Chris Shiflett wrote: --- Lee Stewart [EMAIL PROTECTED] wrote: It's not $location = xxx, just location = page.php; So the dollar sign is missing? Can you show us all of the code in question? (Or did I miss it?) And it seems to work as a redirect... But not part of the header fuction, and not just setting a variable... Location is an HTTP header. If that name is being used in any code for some other reason, then the name may be purely coincidental. However, if it is the header you are speaking of, then it is specified using: header('Location: http://example.org/path/to/script.php'); Of particular note is that the URL is an absolute URL, not a relative one. This is in the snippet of the specification that I quoted earlier. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php Losing apache environment vars
Greetings list, I have run into a problem that has me at my wits end. We run an affiliate program, and have forum software (phpBB) wrapped in our menu system. There are 2 sides to the site, Affiliates and Admin, and I have 2 installs of the board using the same database. This all works fine. The mind-boggling problem is that while the board works perfectly from the Affiliate side of the site, it exhibits some strange behavior from the Admin side of the site. In particular, we are using an apache environment variable to point to our includes directory, and any time an http post is made from the admin side of the board, php loses the environment vars and throws all kinds of errors about not being able to find the includes. The only difference between the Affiliate and Admin sides is the include used for the actual menu, though the only difference in those files is the actual links that make up the menu. I have never seen this behavior, and was wondering if anyone has seen anything like it before, and possibly found a solution. We are running php 4.3.2, Apache 1.3.26 on FreeBSD 4.5. Any help would be very appreciated. Keith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.ini file contents
Hi, I was browsing through the php.ini file to see if maybe functions = that execute shell commands are disabled, but I didn't see anything, can = somebody confirm this just to make sure i didn't skip over it? I am = still trying to execute shell commands and I have been unsuccessful, I = know the security risks and such. The system that will be running it is = a closed system that won't be able to be accessed through the web, so I = don't have to worry about it getting hacked, I am just experimenting = some code. Thanks Teren
Re: [PHP] location= Construct Doc
--- Lee Stewart [EMAIL PROTECTED] wrote: Here's a *working* section of code... Note the location = browse.php; on line 23 How does that not generate a parse error? I must be missing something. It seems to me that either a dollar sign is missing, or the line is intended to define a constant (although I prefer my constants to be uppercase), in which case the wrong syntax is being used. What version of PHP are you using that does not generate a parse error? Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location= Construct Doc
It's version 4.0.3 Lee Chris Shiflett wrote: --- Lee Stewart [EMAIL PROTECTED] wrote: Here's a *working* section of code... Note the location = browse.php; on line 23 How does that not generate a parse error? I must be missing something. It seems to me that either a dollar sign is missing, or the line is intended to define a constant (although I prefer my constants to be uppercase), in which case the wrong syntax is being used. What version of PHP are you using that does not generate a parse error? Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php.ini file contents
[snip] Hi, I was browsing through the php.ini file to see if maybe functions = that execute shell commands are disabled, but I didn't see anything, can = somebody confirm this just to make sure i didn't skip over it? I am = still trying to execute shell commands and I have been unsuccessful, I = know the security risks and such. The system that will be running it is = a closed system that won't be able to be accessed through the web, so I = don't have to worry about it getting hacked, I am just experimenting = some code. Thanks [/snip] Check the safe_mode directive in the php.ini, if it is on this may be causing your problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_list_fields() bug?
Hey All - just wanted to check in with anyone who has used this function. I currectly have a function that I created, and inside it I have this function. Outside of my custom function I have a mysql_pconnect() statement and a mysql_select_db() statement. I also have another custom function that runs a SQL query and returns the results. My problem is why does the custom function with mysql_list_fields(), fail to run unless I put a separate pconnect and select_db statement in the custom function itself and my other custom function can query the DB fine. $db = mysql_pconnect(ip, user, password); mysql_select_db(db); function one() { $db = mysql_pconnect(ip, user, password); mysql_select_db(db); $fields = mysql_list_fields(db, table); } function two() { $q = SELECT * FROM user; $result = mysql_query($q); return $result; } So the end result being if I take the connect statement out of the function one(), it fails, but function two() still works! Am I doing something wrong here? Thanks, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini file contents
Teren wrote: Hi, I was browsing through the php.ini file to see if maybe functions = that execute shell commands are disabled, but I didn't see anything, can = somebody confirm this just to make sure i didn't skip over it? I am = still trying to execute shell commands and I have been unsuccessful, I = know the security risks and such. The system that will be running it is = a closed system that won't be able to be accessed through the web, so I = don't have to worry about it getting hacked, I am just experimenting = some code. Thanks Teren Safe mode on disables execution functions too, have you looked at that setting? If safe_mode is on, use safe_mode_exec_dir setting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems configuring --with-xpm-dir [SOLVED]
John Nichel wrote: Hi, I'm in the middle of setting up a new box to test Apache/PHP on the new Fedora 1 core, and I'm having some issues getting configure to run with --with-xpm-dir. I've installed the libXpm libraries (libXpm.3.4f-ELF) from ftp://metalab.unc.edu/pub/Linux/libs/X/!INDEX.html, but I get this error when running configure checking for XpmFreeXpmImage in -lXpm... no configure: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information. config.log has this configure:30608: checking for XpmFreeXpmImage in -lXpm configure:30627: gcc -o conftest -g -O2 -DDMALLOC_FUNC_CHECK -Wl,-rpath,/usr/X1 1R6/lib -L/usr/X11R6/lib -Wl,-rpath,/usr/lib/gcc-lib/i386-redhat-linux/3.3.2 -L /usr/lib/gcc-lib/i386-redhat-linux/3.3.2 -Wl,-rpath,/usr/local/ssl/lib -L/usr/lo cal/ssl/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lX11 conftest.c -lXpm - lpng -lz -ljpeg -lexslt -lxsltbreakpoint -lxml2 -lxslt -lz -lgdbm -lcurl -lcrack -lcpdf -ltiff -ljpeg -lbz2 -lz -lssl -lcrypto -ldmalloc -lresolv -lm -ldl -lnsl -lgcc -lcurl -lz -lssl -lcrypto -ldl -lz -lxml2 -lz -lm 15 /usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status configure: failed program was: #line 30616 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XpmFreeXpmImage(); int main() { XpmFreeXpmImage() ; return 0; } The libXpm binaries are installed in /usr/X11R6, and I use that directory with the configure line... --with-xpm-dir=/usr/X11R6 This is a Fedora 1 core box with Apache 1.3.29, trying to install php 4.3.4. After searching numerous php mailing list, and just general php sites, and only finding either my own posts, or others asking the same with no responses, I expanded my search beyond php, and looked for anything having the problem, /usr/bin/ld: cannot find -lX11. I found that I needed libX11.a (reading the error, I thought xpm could use either libX11 or libXpm, not that it needed both). Anyway, for Red Hat / Fedora, this is supplied by the XFree86-devel RPM. Also, it's good to not that the path for your X11 libs should be in /etc/ld.so.conf, and if you have to add them, run 'ldconfig' afterwards. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_list_fields() bug?
[snip] Outside of my custom function I have a mysql_pconnect() statement and a mysql_select_db() statement. So the end result being if I take the connect statement out of the function one(), it fails, but function two() still works! Am I doing something wrong here? [/snip] It's just a small misunderstanding Matt. Your $db = mysql_pconnect(ip, user, password); is LOCAL to the function http://us3.php.net/language.variables.scope The other connection string you mention sits OUTSIDE of any other function, so it is GLOBAL (you didn't show that code). You are not calling for the GLOBAL connection in function one. As someone famous once said, Location, location, location! If you add the resource identifier to the request in function one to $fields = mysql_list_fields(db, table, $db); it should work just fin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php Losing apache environment vars
After restarting apache, the error is gone. Still not sure what was causing it. The site was running fine to begin with, and the environment vars have been in use for over a year throughout the site. Keith At 12:56 PM 11/10/2003, Keith Greene wrote: Greetings list, I have run into a problem that has me at my wits end. We run an affiliate program, and have forum software (phpBB) wrapped in our menu system. There are 2 sides to the site, Affiliates and Admin, and I have 2 installs of the board using the same database. This all works fine. The mind-boggling problem is that while the board works perfectly from the Affiliate side of the site, it exhibits some strange behavior from the Admin side of the site. In particular, we are using an apache environment variable to point to our includes directory, and any time an http post is made from the admin side of the board, php loses the environment vars and throws all kinds of errors about not being able to find the includes. The only difference between the Affiliate and Admin sides is the include used for the actual menu, though the only difference in those files is the actual links that make up the menu. I have never seen this behavior, and was wondering if anyone has seen anything like it before, and possibly found a solution. We are running php 4.3.2, Apache 1.3.26 on FreeBSD 4.5. Any help would be very appreciated. Keith -- 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] mysql_list_fields() bug?
On Mon, 2003-11-10 at 16:43, Jay Blanchard wrote: [snip] Outside of my custom function I have a mysql_pconnect() statement and a mysql_select_db() statement. So the end result being if I take the connect statement out of the function one(), it fails, but function two() still works! Am I doing something wrong here? [/snip] It's just a small misunderstanding Matt. Your $db = mysql_pconnect(ip, user, password); is LOCAL to the function http://us3.php.net/language.variables.scope The other connection string you mention sits OUTSIDE of any other function, so it is GLOBAL (you didn't show that code). You are not calling for the GLOBAL connection in function one. As someone famous once said, Location, location, location! If you add the resource identifier to the request in function one to $fields = mysql_list_fields(db, table, $db); it should work just fin Ok, I added the resource identifier, and got an error. I think what is happening now is the resource identifier $db is outside the function one(), so it cannot be referenced from the mysql_list_fields() fuction which is inside. Does that make sense? Is the resource indentifier a GLOBAL thing, because I sure didn't make it one :) The error I got was, supplied argument is not a valid Mysql-Link resource. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_list_fields() bug?
[snip] Ok, I added the resource identifier, and got an error. I think what is happening now is the resource identifier $db is outside the function one(), so it cannot be referenced from the mysql_list_fields() fuction which is inside. Does that make sense? Is the resource indentifier a GLOBAL thing, because I sure didn't make it one :) The error I got was, supplied argument is not a valid Mysql-Link resource. [/snip] Add GLOBAL to the function function one() { global $db; mysql_select_db(db); $fields = mysql_list_fields(db, table, $db); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble sending an image's contents as output using header Content-Type...
Manuel Vázquez Acosta wrote: Type http://server.com/getthumbnail.php?fileid=12230983 in the location bar and see what happens. I have already done it; it didn't work. Manu. Did you see any error? If not, do you have display_errors set to on? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_list_fields() bug?
as said, use the global construct. This is a scope problem, read the manual about variable scope. php.net/variables.scope PS: sorry Jay, new mail frontend :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble sending an image's contents as output using header Content-Type...
Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Manuel Vázquez Acosta wrote: Type http://server.com/getthumbnail.php?fileid=12230983 in the location bar and see what happens. I have already done it; it didn't work. Manu. Did you see any error? If not, do you have display_errors set to on? I have a log file and nothing is logged; my error_reporting setting is to E_ALL; but now that you metion it I call some functions with an appending @; I will check this. Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_list_fields() bug?
Ok, this ended up working well. I'm still wondering why in my example function two() works, without needing to provide the resource identifier to mysql_query(), how can mysql_query() pick up the resource identifier automatically while mysql_list_fields does not? Thx- Matt On Mon, 2003-11-10 at 17:00, Jay Blanchard wrote: [snip] Ok, I added the resource identifier, and got an error. I think what is happening now is the resource identifier $db is outside the function one(), so it cannot be referenced from the mysql_list_fields() fuction which is inside. Does that make sense? Is the resource indentifier a GLOBAL thing, because I sure didn't make it one :) The error I got was, supplied argument is not a valid Mysql-Link resource. [/snip] Add GLOBAL to the function function one() { global $db; mysql_select_db(db); $fields = mysql_list_fields(db, table, $db); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running CLI from a web page
There are already plenty of echo statements in foo! They DO show up when I run php foo. It's when I try to use system(php foo) that I don't get anything. Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] I have a php cli that creates a file. It works fine when I execute it from the Linux command line as php foo bar. I'm trying to also execute this by clicking a form button on a web page via system('php foo bar'). I can see that the file bar gets created but it's always empty. I've tried executing system('php foo') (directly to STDOUT) but get no output. I've tried exec('php foo',$output) but there's nothing in the array when it's done. Suggestions??? [/snip] Put something in script foo that will echo out some information echo foo is running\n; and then run it from the command line. If that works then run it from your form. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n and br
On Mon, Nov 10, 2003 at 06:57:54AM -0800, Chris Shiflett wrote: : : --- PHPLover [EMAIL PROTECTED] wrote: : : is \n same as br : : This is not true. : : I know that \n creates a break in source and not in display. : Is it possible to make \n does the same function as br : : No, but you can convert your newlines to the HTML equivalent: : : http://www.php.net/nl2br Warning: nl2br() is not safe because it emits br / tags which do not always work on all browsers (especially browsers not explicitly advertised to be XHTML-compliant). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] \n and br
Eugene Lee mailto:[EMAIL PROTECTED] on Monday, November 10, 2003 3:58 PM said: Warning: nl2br() is not safe because it emits br / tags which do not always work on all browsers (especially browsers not explicitly advertised to be XHTML-compliant). My original response (in my mind) was Which happens to be none. But then I got curious. Pray tell Eugene, which browsers (text or graphical) do not support the br / and other XHTML type tags? Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running CLI from a web page
--- Ron Rudman [EMAIL PROTECTED] wrote: There are already plenty of echo statements in foo! They DO show up when I run php foo. It's when I try to use system(php foo) that I don't get anything. I missed the original question, but why are you trying to use the PHP CLI from within PHP itself? Can you perhaps use eval() instead? http://www.php.net/eval Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n and br
--- Eugene Lee [EMAIL PROTECTED] wrote: Warning: nl2br() is not safe because it emits br / tags which do not always work on all browsers (especially browsers not explicitly advertised to be XHTML-compliant). Can you name a single browser that cannot properly render a br / tag? Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n and br
Chris Shiflett wrote: --- Eugene Lee [EMAIL PROTECTED] wrote: Warning: nl2br() is not safe because it emits br / tags which do not always work on all browsers (especially browsers not explicitly advertised to be XHTML-compliant). Can you name a single browser that cannot properly render a br / tag? Chris The old Prodigy 'browser' from the early 90's? ;) -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running CLI from a web page
I have a report that I would like to run as a cron job, hence the need for a standalone CLI version that just reads the database and has no other context. But...I would also like to run this report on demand from within a web application. It seemed obvious that all I'd have to do was execute my command line via the system/exec/passthru type of function. I can't see how I would use eval() here, since in the command line: php foo, foo is a file. A possibility here, however, is to use include foo. The only reason I didn't want to do that is because then the code in foo might conflict with the context surrounding the include. I was hoping for a simpler solution, but I might be able to isolate the include in a function. Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Ron Rudman [EMAIL PROTECTED] wrote: There are already plenty of echo statements in foo! They DO show up when I run php foo. It's when I try to use system(php foo) that I don't get anything. I missed the original question, but why are you trying to use the PHP CLI from within PHP itself? Can you perhaps use eval() instead? http://www.php.net/eval Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n and br
Eugene Lee wrote: On Mon, Nov 10, 2003 at 06:57:54AM -0800, Chris Shiflett wrote: : : --- PHPLover [EMAIL PROTECTED] wrote: : : is \n same as br : : This is not true. : : I know that \n creates a break in source and not in display. : Is it possible to make \n does the same function as br : : No, but you can convert your newlines to the HTML equivalent: : : http://www.php.net/nl2br Warning: nl2br() is not safe because it emits br / tags which do not always work on all browsers (especially browsers not explicitly advertised to be XHTML-compliant). If that is the case and you would not like the xhtml compliancy, then just do a str_replace('br /','br',$data); after you do the nl2br, everything cured :) Rolf Brusletto http://www.phpExamples.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random Character Generator
I would like to have a script that randomly generates alpha-numeric characters. Does anyone know of any scripts that can do this or perhaps the basic code to generate random characters? Thank You, Jason Williard
[PHP] Delete after 30 Days
Hey, Here's my situation. I'm making a message board and I want posts to be deleted after 30 days. Does anyone know of a script, or how, I can delete an entry on my database after a certain amount of time (ie. 30 days) automatically. Dimitri Marshall -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php