php-general Digest 16 Dec 2002 10:17:04 -0000 Issue 1766 Topics (messages 128347 through 128382):
Re: how to send an MSWORD email? 128347 by: Chris Shiflett 128349 by: Andy Turegano 128360 by: Jonathan Sharp 128367 by: See kok Boon select * From ???? 128348 by: Bruce Levick 128350 by: Martin Towell 128353 by: Seraphim 128355 by: Martin Towell 128357 by: Javier Re: Getting full HTTP request the page was requested with? 128351 by: Chris Shiflett Re: Querying two tables 128352 by: Javier Re: Executing a Perl/CGI program from PHP 128354 by: John W. Holmes 128361 by: Jonathan Sharp Print bgcolors in table 128356 by: Lars Espelid 128381 by: Bogdan Stancescu Print text and image in the same page. 128358 by: Naif M. Al-Otaibi 128359 by: Chris Shiflett Re: Simple text editor for Windows? 128362 by: David T-G 128363 by: Chris Shiflett Re: approaching a relational database 128364 by: David T-G to php or to perl, that is the question 128365 by: David T-G 128366 by: Rasmus Lerdorf could an audio streaming reflector be written in php? 128368 by: Kendal Can php auto execute it's script in schedule without opening a webpage? 128369 by: Jack 128370 by: Chris Shiflett 128382 by: John W. Holmes notice prevents setting cookie in 4.3.0RC2? 128371 by: Alex Pukinskis Re: Passing text info using $PHP_SELF 128372 by: Ernest E Vogelsinger Re: INSERT using subqueries 128373 by: Evan Nemerson 128374 by: Ernest E Vogelsinger 128376 by: Evan Nemerson needle in a haystack (Can't find :) 128375 by: John Taylor-Johnston 128377 by: Jason Wong 128378 by: Ernest E Vogelsinger Re: Mail() Not working right 128379 by: Miguel González Castaños PDF Lib 128380 by: Bogomil Shopov Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message ------ See Kok Boon <[EMAIL PROTECTED]> wrote: > I want to send emails that have graphics, for example > the pub logo. I know that there are 2 ways to do so > (maybe there are more, pls enlighten me): > > 1. use html email with > <img src="http://www.mydomain.com/logo.gif"> > > 2. use MSWORD to insert the logo into the email. > MSWORD will then send the logo.gif as an > attachment and will ALSO use <img> tags. I doubt anyone on this list is going to know what your second method is, though I would guess that MS Word does nothing special and does the same thing you mention in your first method, except that it attaches the image to the email rather than reference it via URL. You can probably search the archives for more information on sending HTML email as well as sending attachments, which is all you are trying to do. I detest such email myself, so I cannot offer any help. Chris--- End Message ---
--- Begin Message ---The easiest way to include a picture in the email would be through the html. The second way sounds much more complex. Right now, I really don't know of any other ways. Perhaps copy and paste? On Sun, 15 Dec 2002, Chris Shiflett wrote: > --- See Kok Boon <[EMAIL PROTECTED]> wrote: > > I want to send emails that have graphics, for example > > the pub logo. I know that there are 2 ways to do so > > (maybe there are more, pls enlighten me): > > > > 1. use html email with > > <img src="http://www.mydomain.com/logo.gif"> > > > > 2. use MSWORD to insert the logo into the email. > > MSWORD will then send the logo.gif as an > > attachment and will ALSO use <img> tags. > > I doubt anyone on this list is going to know what your > second method is, though I would guess that MS Word does > nothing special and does the same thing you mention in your > first method, except that it attaches the image to the > email rather than reference it via URL. > > You can probably search the archives for more information > on sending HTML email as well as sending attachments, which > is all you are trying to do. I detest such email myself, so > I cannot offer any help. > > Chris > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >--- End Message ---
--- Begin Message ---search google for RFC HTML email, or look at phpmailer.sourceforge.net. It's roughly along the lines of: <Headers...> Subject: My html email Content-type: multipart/mime Content-boundry(????): BOUNDRY-ABC ---BOUNDRY-ABC--- Content-type: text/html ...more headers... Hello! This is an html email with an image -> <img src="cid:abc123"> ---BOUNDRY-ABC--- Content-type: image/jpeg Content-id: abc123 Content-encoding: base64 BKJSDFIWEIJELFJSELIFJEL.... On Sun, 15 Dec 2002 14:35:48 -0800 (PST) Chris Shiflett wrote: > --- See Kok Boon <[EMAIL PROTECTED]> wrote: > > I want to send emails that have graphics, for example > > the pub logo. I know that there are 2 ways to do so > > (maybe there are more, pls enlighten me): > > > > 1. use html email with > > <img src="http://www.mydomain.com/logo.gif"> > > > > 2. use MSWORD to insert the logo into the email. > > MSWORD will then send the logo.gif as an > > attachment and will ALSO use <img> tags. > > I doubt anyone on this list is going to know what your > second method is, though I would guess that MS Word does > nothing special and does the same thing you mention in your > first method, except that it attaches the image to the > email rather than reference it via URL. > > You can probably search the archives for more information > on sending HTML email as well as sending attachments, which > is all you are trying to do. I detest such email myself, so > I cannot offer any help. > > Chris > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > >--- End Message ---
--- Begin Message ---Hi jonathan, Just to let you know, there is no image in "an html email with an image -> <img src="cid:abc123"> " in you last email replying to this same subject. Maybe you should check again? But thanks for you reply anyway. I got my answer at pear.php.net. also, thanks to <Jason wards> Cheers. -----Original Message----- From: Jonathan Sharp [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 10:04 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] how to send an MSWORD email? search google for RFC HTML email, or look at phpmailer.sourceforge.net. It's roughly along the lines of: <Headers...> Subject: My html email Content-type: multipart/mime Content-boundry(????): BOUNDRY-ABC ---BOUNDRY-ABC--- Content-type: text/html ...more headers... Hello! This is an html email with an image -> <img src="cid:abc123"> ---BOUNDRY-ABC--- Content-type: image/jpeg Content-id: abc123 Content-encoding: base64 BKJSDFIWEIJELFJSELIFJEL....--- End Message ---
--- Begin Message ---Hi, Am just a newbie at this and was going great until I have hit this smell snag. I am connecting to mysql and all works well there. I query a table "Illustrations" ($query = "SELECT * FROM Illustrations";), and want to print the values of two columns ("titletext" & "img")within each row as the request loops. Print "<td><tr>$row[titletext]<br></td></tr>"; Print "<td><tr>$row[img]<br></td></tr>"; The code inplace seems all ok, but for some reason I am only being returned the value of "titletext" and not also the value of "img". Am I to be setting a new value for returning the info within "img"?? (eg $row2). I am sorry if this is hard to understand and also a silly Q, I am two days into learning this stuff. All I want to do is to return these two values from within the table. "titletext" and "img". They are both text fields. Cheers--- End Message ---
--- Begin Message ---can you post some more of your code? I think, if it's not too big, the entire while loops Martin -----Original Message----- From: Bruce Levick [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 9:45 AM To: [EMAIL PROTECTED] Subject: [PHP] select * From ???? Hi, Am just a newbie at this and was going great until I have hit this smell snag. I am connecting to mysql and all works well there. I query a table "Illustrations" ($query = "SELECT * FROM Illustrations";), and want to print the values of two columns ("titletext" & "img")within each row as the request loops. Print "<td><tr>$row[titletext]<br></td></tr>"; Print "<td><tr>$row[img]<br></td></tr>"; The code inplace seems all ok, but for some reason I am only being returned the value of "titletext" and not also the value of "img". Am I to be setting a new value for returning the info within "img"?? (eg $row2). I am sorry if this is hard to understand and also a silly Q, I am two days into learning this stuff. All I want to do is to return these two values from within the table. "titletext" and "img". They are both text fields. Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---> Print "<td><tr>$row[titletext]<br></td></tr>"; > Print "<td><tr>$row[img]<br></td></tr>"; check if the img field in the returned row even has a value or try: $row[0] and $row[1] instead of $row['titletext'] and $row['img'] -Peter--- End Message ---
--- Begin Message ---Looks good to me, but as Peter said, see if you really are getting something in ['img'] try print_r($row) or var_dump($row) to make sure -----Original Message----- From: Bruce Levick [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 10:01 AM To: Martin Towell Subject: RE: [PHP] select * From ???? Here is the display code that I started with. <?php // Request the text From Illustrations table $result = mysql_query( "SELECT * FROM Illustrations"); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); } // Display the text of each joke in a paragraph while ( $row = mysql_fetch_array($result) ) { print"<td><tr>$row[titletext]<br></td></tr>"; print"<td><tr>$row[img]<br></td></tr>"; } ?> Not sure why it only displays just the titletext. -----Original Message----- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 8:47 AM To: Bruce Levick; [EMAIL PROTECTED] Subject: RE: [PHP] select * From ???? can you post some more of your code? I think, if it's not too big, the entire while loops Martin -----Original Message----- From: Bruce Levick [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 9:45 AM To: [EMAIL PROTECTED] Subject: [PHP] select * From ???? Hi, Am just a newbie at this and was going great until I have hit this smell snag. I am connecting to mysql and all works well there. I query a table "Illustrations" ($query = "SELECT * FROM Illustrations";), and want to print the values of two columns ("titletext" & "img")within each row as the request loops. Print "<td><tr>$row[titletext]<br></td></tr>"; Print "<td><tr>$row[img]<br></td></tr>"; The code inplace seems all ok, but for some reason I am only being returned the value of "titletext" and not also the value of "img". Am I to be setting a new value for returning the info within "img"?? (eg $row2). I am sorry if this is hard to understand and also a silly Q, I am two days into learning this stuff. All I want to do is to return these two values from within the table. "titletext" and "img". They are both text fields. Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---[EMAIL PROTECTED] (Bruce Levick) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: If you want to access the data in an array try $row['field'] > I am connecting to mysql and all works well there. I query a table > "Illustrations" ($query = "SELECT * FROM Illustrations";), and want to > print the values of two columns ("titletext" & "img")within each row > as the request loops. > > Print "<td><tr>$row[titletext]<br></td></tr>"; > Print "<td><tr>$row[img]<br></td></tr>"; > I am sorry if this is hard to understand and also a silly Q, I am two > days into learning this stuff. All I want to do is to return these two > values from within the table. "titletext" and "img". They are both > text fields. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)--- End Message ---
--- Begin Message ------ Leif K-Brooks <[EMAIL PROTECTED]> wrote: > Thanks, but I'm trying to see what the client sent to > get my page, not what a host returns when I send it > a request... :-) I think he misunderstood your question or something. There are a few different ways to do what you want to do. First, if you dig through the output of phpinfo(), you can usually determine what the exact request was, though it is not going to be obvious unless you know what you are looking for. In the case of a POST request, you will need to have always_populate_raw_post_data turned on in your php.ini to see the POST data. Another method is to use a utility such as tcpdump on your Web server. This works very well except when you need to capture a specific HTTP request on a busy site. The method I choose is to use software specifically created for this purpose. Most software to do this functions as an HTTP proxy, so that you configure your browser to use it for a proxy, and it reveals the HTTP requests and responses that pass through. I wrote a basic one of these that embeds the HTTP transaction into the page itself, so that you do not need to reference a log and can just scroll to the bottom of each page to see both the request and response. It is written in PHP (as a CLI application), and you are welcome to take a look and see if it would be useful to you - http://protoscope.org/. Chris--- End Message ---
--- Begin Message ---[EMAIL PROTECTED] (Cesar Aracena) wrote in news:005801c2a3c6$8ac4f190 $4200a8c0@NOTEBOOK: And the subcategories are related to categories with the Relationships table? If that's the case: SELECT * FROM Relationships WHERE CatId = '1' And if you want the names. SELECT * FROM Subcategories as sc, Relationships as r WHERE r.CatId = 'minumber' and r.SubCatId = sc.subcatid > Hi all, > > I have several tables from which I have to fetch certain products & > categories based on customer selection. The tables are as follows: > > Table 1 - Categories > catid (autonum) > catname > > Table 2 - Sub categories > subcatid (autonum) > subcatname > > Table 3 - Products > prodid (autonum) > prodname > > Table 4 - Relationships > Catid > Subcatid > Prodid > > Now, the question is how to fetch all the sub-categories let's say that > are related to category 0001. I know it's as simple as relating two > tables in one query, but I don't remember how. Any help appreciated. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)--- End Message ---
--- Begin Message ---> I have a logging program I wrote in Perl that writes basic info to a MySQL > database. I can't get it working from within PHP. I've tried: > > print "<!--#exec cgi='vislog.cgi'-->"; > echo ("<!--#exec cgi='vislog.cgi'-->"); > include("vislog.cgi"); Maybe virtual() ? www.php.net/virtual ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/--- End Message ---
--- Begin Message ---You're trying to mix two different things. SSI (Server Side Includes) and PHP. The page you're calling gets parsed ONLY by PHP. So echoing #exec won't work. Look at the virtual() function ~~> http://php.net/virtual -js On Sun, 15 Dec 2002 14:10:17 -0800 Troy May wrote: > Hello, > > I have a logging program I wrote in Perl that writes basic info to a MySQL > database. I can't get it working from within PHP. I've tried: > > print "<!--#exec cgi='vislog.cgi'-->"; > echo ("<!--#exec cgi='vislog.cgi'-->"); > include("vislog.cgi"); > > Nothing works. What am I missing? > > Thanks, > Troy > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > >--- End Message ---
--- Begin Message ---Hello, I have been looking for a newsgroup where I can post questions about css/html. I did not find any. Any suggestions? If you want a break from php, my problem is as follows: Have got a table in html with different background colors on the rows. When I print the page to my printer, the colors won't show. I have tried to specify output media, but it won't work. Tried f.ex. this: in print.css: @media print { TR.graaOver { BACKGROUND-COLOR: #E5E5E5; } } in report.html: ......... <link href="../print.css" rel="stylesheet" media="print, screen" type="text/css"> </head> <body> <table> <tr class="graaOver"> .......... thanks, Lars--- End Message ---
--- Begin Message --- As far as I can see, this is not even an HTML question - it's more of a user agent question.
Lars Espelid wrote:
Hello, I have been looking for a newsgroup where I can post questions about css/html. I did not find any. Any suggestions? If you want a break from php, my problem is as follows: Have got a table in html with different background colors on the rows. When I print the page to my printer, the colors won't show. I have tried to specify output media, but it won't work. Tried f.ex. this: in print.css: @media print { TR.graaOver { BACKGROUND-COLOR: #E5E5E5; } } in report.html: ......... <link href="../print.css" rel="stylesheet" media="print, screen" type="text/css"> </head> <body> <table> <tr class="graaOver"> .......... thanks, Lars--- End Message ---
--- Begin Message ---Hi all, I try to print some information (text and image) that I retrieve from an oracle DB, but I got the image printed as binary junk. When I put the line that print the image in a html image tag, I got a red square with "X" inside. What can I do to solve this problem? This is my code: -------------------------------------- <? echo "<html>"; echo "<head><title>Retrieve Results</title></head>"; echo "<body bgcolor=#Fge89j><br><br><br><br>"; $conn = OCILogon("*","*","*"); $query = "select country,continent,population,area,language,capital,map from countries where country="; $query .= "'$country'"; $stmt = OCIParse($conn,$query); OCIExecute($stmt); OCIFetchInto($stmt, &$blob); echo "<p><b>Retrieve Result:</b>"; echo "<br>"; echo "<b> Country:</b> $blob[0]"; echo "<br>"; echo "<b> Continent:</b> $blob[1]"; echo "<br>"; echo "<b> Population:</b> $blob[2]"; echo "<br>"; echo "<b> Area:</b> $blob[3]"; echo "<br>"; echo "<b> Language:</b> $blob[4]"; echo "<br>"; echo "<b> Capital:</b> $blob[5]"; echo "<br>"; echo "<img src=\"$blob[6]->load()\">"; echo "</p>"; OCIFreeStatement($stmt); OCILogoff($conn); echo "</body>"; echo "</html>"; ?> -------------------------------------------------- End Message ---
--- Begin Message ------ "Naif M. Al-Otaibi" <[EMAIL PROTECTED]> wrote: > I try to print some information (text and image) that I > retrieve from an oracle DB, but I got the image printed > as binary junk. When I put the line that print the image > in a html image tag, I got a red square with "X" inside. > What can I do to solve this problem? This is really just an HTML question. The <img> tag has an attribute called src that should be given a URL as a value. The URL should be an image. For example: <img src="http://www.php.net/gifs/php_snow.gif"> On the other hand, if you want to dump the raw image to the browser and expect it to render it properly, you must tell it that you are sending an image. For example: header("Content-Type: image/gif"); Chris--- End Message ---
--- Begin Message ---John -- ...and then John W. Holmes said... % % I know the text editor question has been beat to death, but I'm looking Heh. % for a simple editor with syntax highlighting that can be installed in % Windows by a general user. It would have to be something that didn't % access the registry, as normal users can't do that. Does anyone know of % a program like this? Thanks. gvim and vim, hands-down. % % ---John Holmes... % % PS: Yes, I already know what program you use and it's the best and I use % it every day to... does it answer the question above?? ;) Of course it does :-) 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://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!--- End Message ---
msg89705/pgp00000.pgp
Description: PGP signature
--- Begin Message ---I would recommend UltraEdit: http://www.ultraedit.com/ Chris--- End Message ---
--- Begin Message ---Doug -- ...and then Doug Parker said... % % I'm about to embark on a project where I have to enter many, many fields % into a MySQL database, and I don't know how to approach the database ... % % Any suggestions would be greatly appreciated... Have you asked on the mysql list? I'd think that that's a better place to start... 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://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!--- End Message ---
msg89705/pgp00001.pgp
Description: PGP signature
--- Begin Message ---Hi, all -- I am starting a project that will have a web front end and mysql back end and handle staff input (eg not general web surfers, though an Internet face may come about one day)and updating for client records and scheduling. I am comfortable with both perl and php (and expect to be much more so with at least one of them by the project's maturity :-) In general, is there a checklist of when to use perl and when to use php in a web site design? Perhaps a comparison of the two languages, like I think I've seen long ago for C, Pascal, assembler, perl, and python? I read both lists (as I'm able, anyway; Hi perl guys!) and so you can reply to either or both of the lists or just to me as you see fit. I'll be happy to post a summary of any answers or directions I get. 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://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!--- End Message ---
msg89705/pgp00002.pgp
Description: PGP signature
--- Begin Message ---Folks, even if perhaps not intended as a troll, the effect will be the same. Please refrain from cross-posting dozens of messages. David, pick whichever language you are more comfortable with. There is pretty much nothing in one that can't be done in the other. It's like asking the Beef and Pork industries what to have for dinner tonight. -Rasmus On Sun, 15 Dec 2002, David T-G wrote: > Hi, all -- > > I am starting a project that will have a web front end and mysql back end > and handle staff input (eg not general web surfers, though an Internet face > may come about one day)and updating for client records and scheduling. I > am comfortable with both perl and php (and expect to be much more so with > at least one of them by the project's maturity :-) > > In general, is there a checklist of when to use perl and when to use php > in a web site design? Perhaps a comparison of the two languages, like I > think I've seen long ago for C, Pascal, assembler, perl, and python? > > I read both lists (as I'm able, anyway; Hi perl guys!) and so you can > reply to either or both of the lists or just to me as you see fit. I'll > be happy to post a summary of any answers or directions I get. > > > 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://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! > >--- End Message ---
--- Begin Message --- I would like to stream audio data from a low bandwidth computer to a high bandwidth server, and then have listeners connect and listen via the high bandwidth server.
In java I would have a small process run on the server that would receive the audio stream and echo a copy of it down to each listener.
Since PHP is so widely supported on servers, I find myself wondering if the same thing has been done, or could be done, through PHP?
Thanks,
Kendal
http://www.freedomaudio.com
--- End Message ---
--- Begin Message ---Dear all I just wonder did anyone know if php can act as a scheduler rather than execute script manually? i want to set a schedule for php to run certain script at specify time, to what i understood in php is : the script can only be process when a homepage had been execute. but i want the script to be excute even no one open a homepage contain php script in it! is there anyway i can do that? thx Jack--- End Message ---
--- Begin Message ------ Jack <[EMAIL PROTECTED]> wrote: > i want to set a schedule for php to run certain > script at specify time, to what i understood in > php is : the script can only be process when a > homepage had been execute. but i want the script > to be excute even no one open a homepage contain > php script in it! > > is there anyway i can do that? Sure, though it varies depending on your platform. Assuming you are on Unix, it is likely that you already have a CLI (command line interface) PHP installed somewhere. You can use this to create a PHP script that can be executed like any other shell script. Just put something like this at the top: #! /usr/bin/php -q Be sure it points to the location of your PHP parser (/usr/bin/php in this example). To automate scripts, look into cron: man cron man crontab Good luck. Chris--- End Message ---
--- Begin Message ---> Dear all > I just wonder did anyone know if php can act as a scheduler rather than > execute script manually? > i want to set a schedule for php to run certain script at specify time, to > what i understood in php is : the script can only be process when a > homepage > had been execute. but i want the script to be excute even no one open a > homepage contain php script in it! Sure. Write the PHP script you want to use. There shouldn't be any output from the script or it should all go to a database or file, since no one will be executing it to see it. Use "cron" on a *nix server to schedule when you want it to run. You should have a standalone version of PHP installed somewhere and you can just do php -q filename.php as what you want to run. You can also run it through lynx or wget if you don't have a standalone version of PHP available. Lynx --dump http://yourdomain/file.php. If you're on Windows, you can use task scheduler to run the program through php.exe like php.exe -q c:\path\to\file.php. Or you can load it up through Internet Explorer, iexplore.exe http://youdomain/file.php. If you use IE, there is a checkbox in the Task Scheduler program that will end the program after X minutes. Check that to have it shut down IE after a couple minutes, you PHP script should be done executing by then. Hope that helps. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/--- End Message ---
--- Begin Message ---I've been having trouble with a script that works fine in 4.1 and 4.2.3, but doesn't work in 4.3.0RC2. It seems that if your script generates a php notice (which is logged, not displayed to the screen) something gets output anyway; this prevents setting cookies. Here's the simplest example I could come up with: <? if (!$undefinedVariable) { if (setcookie ("code","123456")) { print "Cookie set"; } else { print "Could not set cookie"; } } ?> Since $undefinedVariable is undefined, we get the following in the server log: PHP Notice: Undefined variable: undefinedVariable in /home/www/dev/pLogin.php on line 2 which is fine; unfortunately, it's followed by: PHP Warning: Cannot modify header information - headers already sent in /home/www/dev/pLogin.php on line 3 This shouldn't happen because display_errors is set to Off (which to me means that nothing should be output to the user when there is a notice. Can someone who's running 4.3.0RC3 try this script? (You probably have to make sure error_reporting is set to E_ALL). If this has been fixed in RC3, it should say "Cookie set". If it says "Could not set cookie", it seems to me like this bug should be reported. By the way, is there any easy way to see what's changed in pre-release versions of PHP, short of digging through the CVS logs? -Alex--- End Message ---
--- Begin Message ---At 20:23 15.12.2002, Lightfirst said: --------------------[snip]-------------------- >I am using PHP and MySql and wanted to know if it possible to pass the value >inserted in a text box back to the page using PHP_SELF. Bellow is the >snipped of code. The part that is not working is &q=input. Any ideas? > ><form name=\"update\" method=\"post\" >action=\"$PHP_SELF?action=change&id=$id&q=input\"> --------------------[snip]-------------------- Most certainly register_globals is off in your php.ini file. Try using $_SERVER['PHP_SELF'] instead of $PHP_SELF. -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/--- End Message ---
--- Begin Message --------BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 First off, sorry it's a SQL question not PHP, but I don't subscribe to mysql-general (or whatever it's called), and I have a feeling someone on this list will be able to help... Anyways, my question is rather simple- how do I do an INSERT using a subquery? I want something like this- only one that works: INSERT INTO myTable SET owner=(SELECT id FROM users WHERE username='myUsername'); Actually, I want to set a few more fields too, but not using subqueries. I would prefer the ..() VALUES ()... syntax, but I converted to this when I suspected that was the problem- it wasn't. I realize that I _could_ get put the id into a PHP variable, then make another query from that (which is what I'll be doing until i get a response ;)), but I'd prefer not to. Any help would be much appreciated, and thanks in advance! - -Evan - -- To achieve adjustment and sanity and the conditions that follow from them, we must study the structural characteristics of this world first and, then only, build languages of similar structure, instead of habitually ascribing to the world the primitive structure of our language. - -Alfred Korzybski -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9/YiD/rncFku1MdIRAg13AJ0VWveL8D79oMGuD+LVXpliqecbYgCeKlBw S+j22cnoMS/WNm0Iwbxjzlo= =EC92 -----END PGP SIGNATURE-------- End Message ---
--- Begin Message ---At 09:01 16.12.2002, Evan Nemerson said: --------------------[snip]-------------------- >Anyways, my question is rather simple- how do I do an INSERT using a >subquery? >I want something like this- only one that works: > >INSERT INTO myTable >SET owner=(SELECT id FROM users WHERE username='myUsername'); --------------------[snip]-------------------- INSERT INTO myTable SELECT id as "owner" FROM users where username='myUsername'; other columns, not selected from source table: INSERT INTO myTable SELECT id as "owner", 92 as "data1", 'hello world' as "data2" FROM users where username='myUsername'; should do it (untested on mySQL) -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/--- End Message ---
--- Begin Message --------BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ohhh you're close. A little tweak, and it works. Here's what I came up with: INSERT INTO myTable (owner, name) SELECT id as "owner", 'myName' as "name" FROM users where username='myUserName'; I think if you omit the (owner, name), it thinks you want to fill the whole table, so by doing it this way you can specify only what you want to change. Thanks for your help, Ernest! - -Evan On Monday 16 December 2002 12:13 am, you wrote: > At 09:01 16.12.2002, Evan Nemerson said: > --------------------[snip]-------------------- > > >Anyways, my question is rather simple- how do I do an INSERT using a > >subquery? > >I want something like this- only one that works: > > > >INSERT INTO myTable > >SET owner=(SELECT id FROM users WHERE username='myUsername'); > > --------------------[snip]-------------------- > > INSERT INTO myTable > SELECT id as "owner" FROM users where username='myUsername'; > > other columns, not selected from source table: > > INSERT INTO myTable > SELECT id as "owner", 92 as "data1", 'hello world' as "data2" > FROM users where username='myUsername'; > > should do it (untested on mySQL) - -- Cats are intended to teach us that not everything in nature has a function. - -Garrison Keillor -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9/Y+w/rncFku1MdIRAtjFAJ9k8CaAVyHxe3Rdubo0cXPYMMP14gCfdZoN /AXg9bAvjtt+xWCJMmY8r3E= =byql -----END PGP SIGNATURE-------- End Message ---
--- Begin Message ---http://www.php.net/manual/en/function.in-array.php Can't find the °ù¢# $needle in my $haystack. Why? :p (It is a serious example :) <?php $needle = "Ten things I hate about you"; if(in_array($needle, $haystack)) { echo "Found it"; }else{ echo "Not there"; } $haystack = array ("Ten Things I Hate About You", "10 Things I Hate About You", "Ten things I hate about you", "10 things I hate about you", "Ten Things That I Hate About You", "10 Things That I Hate About You", "Ten things that I hate about you", "10 things that I hate about you", "ten things I hate about you");--- End Message ---
--- Begin Message ---On Monday 16 December 2002 16:23, John Taylor-Johnston wrote: > http://www.php.net/manual/en/function.in-array.php > > Can't find the °ù¢# $needle in my $haystack. Why? :p > > (It is a serious example :) > > <?php > > $needle = "Ten things I hate about you"; > > if(in_array($needle, $haystack)) { > echo "Found it"; > }else{ > echo "Not there"; > } > > > $haystack = array ("Ten Things I Hate About You", > "10 Things I Hate About You", > "Ten things I hate about you", > "10 things I hate about you", > "Ten Things That I Hate About You", > "10 Things That I Hate About You", > "Ten things that I hate about you", > "10 things that I hate about you", > "ten things I hate about you"); How about defining $haystack *before* trying to use it? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Fay: The British police force used to be run by men of integrity. Truscott: That is a mistake which has been rectified. -- Joe Orton, "Loot" */--- End Message ---
--- Begin Message ---Define the haystack _before_ you look into it, and you'll find it. At 09:56 16.12.2002, Jason Wong said: --------------------[snip]-------------------- >On Monday 16 December 2002 16:23, John Taylor-Johnston wrote: >> http://www.php.net/manual/en/function.in-array.php >> >> Can't find the °ù¢# $needle in my $haystack. Why? :p >> >> (It is a serious example :) >> >> <?php >> >> $needle = "Ten things I hate about you"; >> >> if(in_array($needle, $haystack)) { >> echo "Found it"; >> }else{ >> echo "Not there"; >> } >> >> >> $haystack = array ("Ten Things I Hate About You", >> "10 Things I Hate About You", >> "Ten things I hate about you", >> "10 things I hate about you", >> "Ten Things That I Hate About You", >> "10 Things That I Hate About You", >> "Ten things that I hate about you", >> "10 things that I hate about you", >> "ten things I hate about you"); > >How about defining $haystack *before* trying to use it? > >-- >Jason Wong -> Gremlins Associates -> www.gremlins.biz >Open Source Software Systems Integrators >* Web Design & Hosting * Internet & Intranet Applications Development * > >/* >Fay: The British police force used to be run by men of integrity. >Truscott: That is a mistake which has been rectified. > -- Joe Orton, "Loot" >*/ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php --------------------[snip]-------------------- -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/--- End Message ---
--- Begin Message ---Dear all, Sorry for my English...I am not a native speaker... I am experiencing the same problem with the mail function. I am using exactly the same test php script to test the PHP mail function. I have two RedHat linux boxes. In one box, the PHP mail function work and in the other one doesnt work. In both using sendmail command line work fine. I have checked the maillogs and I only can see any maillog in the one that PHP mail function works. In both I have set SMTP like localhost, sendmail_path=/usr/sbin/sendmail -t besides I have double checked the permissions for the nobody user to either execute the php script or the sendmail command. Could it be an issue of either the PHP version or the sendmail version? How could I use PHP logs or whatever tool to check what is going on? Many thanks in advance and sorry if this is considered a lame question Miguel--- End Message ---
--- Begin Message ---hi folks Is there any way to include in PDF file .gif file with more than 8 colors? Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file regards Bogomil--- End Message ---