[PHP] Submitting form in new window!
Hi, When i press the Submit button, i would like it to open in a new Javascript Windows with well-defined characteristics like size, width etc. I create a window.open function and gave the name of my PHP page .. but the Form Variables are not passing into it.. Thanks, T. Edison Jr. = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mbstring: Japanese conversion not working for me
I tried the following but it did not seem to do anything. [some text here in japanese ...] 1 : 111$B$"$$$&$($*!!4A;z$R$i$,$J(B1235 [now i want to change the charset so] 2 : 111$B!"!V!"!"!"%r!"%#!"%'!#!#%(%A%5yh%a!"r&%c!"%O(B1235 (I tried EUC/EUC-JP/EUC_JP but nothing worked). Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Delete me from this fuckin list!!!!!!!! My mailbox is full
[PHP] PLZ HELP -- - GET & POST form problem
Hi, I've this problem: Server Apache / PHP v.4.1.2 At the moment the parametere register_globals is still set to on; I'm triyng to use $_POST and $_FILES between different pages, but variables are always empty !!! Page1 Page2 -- $text = $_POST['mytext']; $files = $_FILES['img1']['name']; $filestmp = $_FILES['img1']['tmp_name']; these variables are empty.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] don't want to receive but email please
> only if user stupidity can be considered a virus. It can indeed ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mbstring: Japanese conversion not working for me
ðÒÉ×ÅÔ! > > 2 : 111??1235 > language codes are zh = chinese ko = korean ja = japanese the charset codes must be fully specified, such as ISO-2022-JP (the one you are using yourself) SHIFT-JIS EUC-JP otherwise it will make no sense to your browser. Usually looking at what you can find in your "preferences->navigator->languages" will do the trick (talking about Mozilla). EUC-KR would mean korean, and so on, which is which just EUC will not mean anything. ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ× @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Grr SQL syntax error silghtly OT
Sorry :} I get a SQL syntax error at line two of the query: $query = "select 2count(*) as tececo_stats.views, meta_data.title from meta_data, tececo_stats where meta_data.id = tececo_stats.id"; I have stared at this 'till i felt dizzy. can someone tell me what I am doing wrong so that I can learn from it? Thanks in advance -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] imagecopyresized() problems
Hi, Output the correct headers before you output the image ie header("Content-type: image/jpeg"); imagejpeg($dst_img, '', 50); Remove all print statements from this code. You cannot output anything but the headers and the image itself. Use imagecopyresampled if you can. It gives much better quality. Then to output the image from another script (not within test.php) use this: Regards Joakim Andersson > -Original Message- > From: Lance Earl [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 8:54 AM > To: [EMAIL PROTECTED] > Subject: [PHP] imagecopyresized() problems > > > I am trying to create a piece of code that will create and display > thumbnail image. When trying to send the image to a browser, I see > binary data rather then an image. You can see the problem at > www.dallypost.com/a/test.php > > The troubled cose for this page follows: > > > //a master image may be any image of any size > > //If the master image exists, the thumb will be created and output to > the browser > > //requires path from the file system home directory as > $master_image_path > > //requires the name of the master image as $master image > > > //test variables -- will eventually be defined by the calling module > $master_image_path = "/home/html/74ranch/uploads/"; > $master_image = "chex34.jpg"; > > > > if(!isset($thumb_width)) > { > $thumb_width = 80; > }//end if > > > //make sure that the master file exists > $master_image_all = "$master_image_path"; > $master_image_all .= "$master_image"; > > //remove this section after coding is complete > $master_image_all_link = "/74ranch/uploads/"; > $master_image_all_link .= "$master_image"; > print(""); > > if(file_exists($master_image_all)) > { > $size = getimagesize("$master_image_all"); > $width = $size[0]; > $height = $size[1]; > > > //calculate thumb height > $factor = $width / $thumb_width; > $thumb_height = $height * $factor; > $thumb_height = $thumb_height * .1; > $thumb_height = round($thumb_height); > print(" Origional: height: $height width: > $widthTarget: > height:$thumb_height width: $thumb_width"); > > //build the thumbnail > $src_img = imagecreatefromjpeg("$master_image_all"); > $dst_img = imagecreate($thumb_width,$thumb_height); > //$dst_img = > > imagecreatetruecolor($thumb_width,$thumb_height);//requires > gd 2.0 > or higher > > print("Variables that will be inserted into > the imagecopyresized > function"); > print("width: $width"); > print("height $height"); > print("thumb_width $thumb_width"); > print("thumb_height $thumb_height"); > > print("Display the new thumb image"); > > imagecopyresized($dst_img, $src_img, 0, 0, 0, > 0,$thumb_width, > $thumb_height, $width, $height); > > > //imagecopyresampled($dst_img, $src_img, 0, 0, > 0, 0, $thumb_width, > $thumb_height, $width, $height);//requires gd > 2.0 or higher > > > //imagejpeg($dst_img, "path and file name", > 75);//saves the image to > a file > > imagejpeg($dst_img, '', 50);//sends the image > to thebrowser > > imagedestroy($src_img); > imagedestroy($dst_img); > > > > }//end if > ?> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session data not being deleted on browser close.
Don't cross post such question... All you need to understand is how cookie is managed unless you are passing session id via URL. Read RFC2965 and RFC2964. You probably want to read netscape cookie spec also. -- Yasuo Ohgaki Youngie wrote: > Why would my session data not be deleted after my browser is closed? > > I can set some session variables, close my browser, reopen them and the old > values are still present, > I can verify this by seeing that the file still containts my session data > and values. > > Thanks > > John. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Grr SQL syntax error silghtly OT
2count(*)? don't look right > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: 09 July 2002 9:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Grr SQL syntax error silghtly OT > > > Sorry :} > > I get a SQL syntax error at line two of the query: > > $query = "select > 2count(*) as tececo_stats.views, meta_data.title > from > meta_data, tececo_stats > where > meta_data.id = tececo_stats.id"; > > I have stared at this 'till i felt dizzy. can someone tell me > what I am > doing wrong so that I can learn from it? > > Thanks in advance > > > -- > JJ Harrison > [EMAIL PROTECTED] > www.tececo.com > > > > -- > 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] Grr SQL syntax error silghtly OT
I assume that 2count should really be count and 2 is just the line-number you added in this post... tececo_stats.views is (probably) the name of a column and cannot be used as an alias. Change it to something else. change count(*) to count(tececo_stats.*) (I think that's what you want) And you probably need a group by-statement at the end: GROUP BY whatever_you_need_to_group_by It's really difficult to answer your questions without the table designs, the error message and what you expect this query to do. And, it's not slightly OT. It's totally OT. :-) Regards Joakim Andersson > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 10:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Grr SQL syntax error silghtly OT > > > Sorry :} > > I get a SQL syntax error at line two of the query: > > $query = "select > 2count(*) as tececo_stats.views, meta_data.title > from > meta_data, tececo_stats > where > meta_data.id = tececo_stats.id"; > > I have stared at this 'till i felt dizzy. can someone tell me > what I am > doing wrong so that I can learn from it? > > Thanks in advance > > > -- > JJ Harrison > [EMAIL PROTECTED] > www.tececo.com > > > > -- > 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] Converting PCX to ...
Thanks, installed and working "Miguel Cruz" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Mon, 8 Jul 2002, BB wrote: > > I'm writing a reporting system and I have a problem. > > > > I need to insert PCXs into a PDF (using PDFLib), but it doesn't support > > PCXs. > > > > So, to get round the problem, I need to convert the PCXs to JPGs or GIFs > > > > Does anyone know of a piece of PHP that can do this inline, (by that I mean, > > can be called and run in PHP script), because the images will have additions > > and modifications on a regular basis; and they come as PCXs. > > You can do it with Imagemagick. As I recall, there used to be direct PHP > functions for Imagemagick but they have disappeared many versions ago, so > you'll have to run it via system() et al. > > miguel > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending data in table, multiple rows, via mail()
Hi, Ok i have a bunch of rows in my table, with some data. I want my mail() function to be able to pick up the data from the rows and send to a specified email. Basicall let's say there are 3 fields, and 3 rows, the data sent in email should be something like : row1field1 : dkjhdkj row1field2 : dsjdkj row1field3 : skljskj row2field1 : dkjhdkj row2field2 : dsjdkj row2field3 : skljskj And so on, apart from the other mail info. Can anyone help me out with this... Thanks, T. Edison Jr. __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Grr SQL syntax error silghtly OT
table structure for tececo stats(Stores information about the visitors to my site.visited is either 0 or 1 depending on whether or not the stats cookie has been set): id int(11) unsigned NOT NULL auto_increment, page_id int(11) NOT NULL default '0', visited int(11) NOT NULL default '0', time int(11) NOT NULL default '0', remote_dns varchar(100) NOT NULL default '', remote_ip varchar(15) NOT NULL default '', referer varchar(200) NOT NULL default '', browser varchar(100) NOT NULL default '', system varchar(100) NOT NULL default '', PRIMARY KEY (id), KEY page_id (page_id,time) table structure for meta_data(contains information about the pages in my website): id int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', title varchar(200) NOT NULL default '', page_name varchar(75) NOT NULL default '', description text NOT NULL, keywords text NOT NULL, PRIMARY KEY (id), KEY pid (pid) main file(required.php automaticly does a DB connect and is used elsewhere so I know is not the problem). " . mysql_error()); $num_results = mysql_num_rows($result); ?> Page NameTota;Number of Sessions '.$row['meta_data.title'].''.$row['tececo_stats.views'].'< /td>'; } ?> error message: Query failed: select count(tececo_stats.*) as tececo_stats.views, meta_data.title from meta_data and tececo_stats where meta_data.id = tececo_stats.id order by meta_data.id You have an error in your SQL syntax near '*) as tececo_stats.views, meta_data.title from meta_data and tececo_stats whe' at line 2 What I want to do: This is essentially a script for a stats program that I am writting that returns the number of hits for each page. Instead of looping a query I decieded to try and join the two tables to make it more efficiant. I am trying to get it to work with hits now than make it sessions later. I hope this is enough info and thank you for your help. -- JJ Harrison [EMAIL PROTECTED] www.tececo.com "Joakim Andersson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I assume that 2count should really be count and 2 is just the line-number > you added in this post... > > tececo_stats.views is (probably) the name of a column and cannot be used as > an alias. Change it to something else. > change count(*) to count(tececo_stats.*) (I think that's what you want) > And you probably need a group by-statement at the end: GROUP BY > whatever_you_need_to_group_by > > It's really difficult to answer your questions without the table designs, > the error message and what you expect this query to do. And, it's not > slightly OT. It's totally OT. :-) > > Regards > Joakim Andersson > > > > -Original Message- > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, July 09, 2002 10:10 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Grr SQL syntax error silghtly OT > > > > > > Sorry :} > > > > I get a SQL syntax error at line two of the query: > > > > $query = "select > > 2count(*) as tececo_stats.views, meta_data.title > > from > > meta_data, tececo_stats > > where > > meta_data.id = tececo_stats.id"; > > > > I have stared at this 'till i felt dizzy. can someone tell me > > what I am > > doing wrong so that I can learn from it? > > > > Thanks in advance > > > > > > -- > > JJ Harrison > > [EMAIL PROTECTED] > > www.tececo.com > > > > > > > > -- > > 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] Grr SQL syntax error silghtly OT
I would try something like this... SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title FROM tececo_stats, meta_data WHERE meta_data.id = tececo_stats.page_id GROUP BY tececo_stats.page_id ORDER BY num_hits DESC /Joakim > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 11:07 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Grr SQL syntax error silghtly OT > > > table structure for tececo stats(Stores information about the > visitors to my > site.visited is either 0 or 1 depending on whether or not the > stats cookie > has been set): > > id int(11) unsigned NOT NULL auto_increment, > page_id int(11) NOT NULL default '0', > visited int(11) NOT NULL default '0', > time int(11) NOT NULL default '0', > remote_dns varchar(100) NOT NULL default '', > remote_ip varchar(15) NOT NULL default '', > referer varchar(200) NOT NULL default '', > browser varchar(100) NOT NULL default '', > system varchar(100) NOT NULL default '', > PRIMARY KEY (id), > KEY page_id (page_id,time) > > table structure for meta_data(contains information about the > pages in my > website): > > id int(11) unsigned NOT NULL auto_increment, > pid int(11) unsigned NOT NULL default '0', > title varchar(200) NOT NULL default '', > page_name varchar(75) NOT NULL default '', > description text NOT NULL, > keywords text NOT NULL, > PRIMARY KEY (id), > KEY pid (pid) > > main file(required.php automaticly does a DB connect and is > used elsewhere > so I know is not the problem). > include "includes/required.php"; > do_html_header('Page Detail Statistics'); > > $query = "select > count(tececo_stats.*) as tececo_stats.views, meta_data.title > from > meta_data, tececo_stats > where > meta_data.id = tececo_stats.id > order by meta_data.id > group by meta_data.id"; > $result = mysql_query($query) or die("Query failed: $query" . > mysql_error()); > $num_results = mysql_num_rows($result); > ?> > > Page NameTota;Number of > Sessions > for ($i=0; $i < $num_results; $i++) > { > $row = mysql_fetch_array($result); > echo > ''.$row['meta_data.title'].''.$row['tececo_st > ats.views'].'< > /td>'; > } > ?> > > do_html_footer(); > ?> > > error message: > Query failed: select count(tececo_stats.*) as tececo_stats.views, > meta_data.title from meta_data and tececo_stats where meta_data.id = > tececo_stats.id order by meta_data.id > You have an error in your SQL syntax near '*) as tececo_stats.views, > meta_data.title from meta_data and tececo_stats whe' at line 2 > > What I want to do: This is essentially a script for a stats > program that I > am writting that returns the number of hits for each page. Instead of > looping a query I decieded to try and join the two tables to > make it more > efficiant. I am trying to get it to work with hits now than > make it sessions > later. > > I hope this is enough info and thank you for your help. > > > -- > JJ Harrison > [EMAIL PROTECTED] > www.tececo.com > > > "Joakim Andersson" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I assume that 2count should really be count and 2 is just > the line-number > > you added in this post... > > > > tececo_stats.views is (probably) the name of a column and > cannot be used > as > > an alias. Change it to something else. > > change count(*) to count(tececo_stats.*) (I think that's > what you want) > > And you probably need a group by-statement at the end: GROUP BY > > whatever_you_need_to_group_by > > > > It's really difficult to answer your questions without the > table designs, > > the error message and what you expect this query to do. > And, it's not > > slightly OT. It's totally OT. :-) > > > > Regards > > Joakim Andersson > > > > > > > -Original Message- > > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, July 09, 2002 10:10 AM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] Grr SQL syntax error silghtly OT > > > > > > > > > Sorry :} > > > > > > I get a SQL syntax error at line two of the query: > > > > > > $query = "select > > > 2count(*) as tececo_stats.views, meta_data.title > > > from > > > meta_data, tececo_stats > > > where > > > meta_data.id = tececo_stats.id"; > > > > > > I have stared at this 'till i felt dizzy. can someone tell me > > > what I am > > > doing wrong so that I can learn from it? > > > > > > Thanks in advance > > > > > > > > > -- > > > JJ Harrison > > > [EMAIL PROTECTED] > > > www.tececo.com > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Grr SQL syntax error silghtly OT
Forgot. You have to change $row['tececo_stats.views'] to $row['num_hits'] /J > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 11:15 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] Grr SQL syntax error silghtly OT > > > I would try something like this... > > SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title > FROM tececo_stats, meta_data > WHERE meta_data.id = tececo_stats.page_id > GROUP BY tececo_stats.page_id > ORDER BY num_hits DESC > > /Joakim > > > -Original Message- > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, July 09, 2002 11:07 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] Grr SQL syntax error silghtly OT > > > > > > table structure for tececo stats(Stores information about the > > visitors to my > > site.visited is either 0 or 1 depending on whether or not the > > stats cookie > > has been set): > > > > id int(11) unsigned NOT NULL auto_increment, > > page_id int(11) NOT NULL default '0', > > visited int(11) NOT NULL default '0', > > time int(11) NOT NULL default '0', > > remote_dns varchar(100) NOT NULL default '', > > remote_ip varchar(15) NOT NULL default '', > > referer varchar(200) NOT NULL default '', > > browser varchar(100) NOT NULL default '', > > system varchar(100) NOT NULL default '', > > PRIMARY KEY (id), > > KEY page_id (page_id,time) > > > > table structure for meta_data(contains information about the > > pages in my > > website): > > > > id int(11) unsigned NOT NULL auto_increment, > > pid int(11) unsigned NOT NULL default '0', > > title varchar(200) NOT NULL default '', > > page_name varchar(75) NOT NULL default '', > > description text NOT NULL, > > keywords text NOT NULL, > > PRIMARY KEY (id), > > KEY pid (pid) > > > > main file(required.php automaticly does a DB connect and is > > used elsewhere > > so I know is not the problem). > > > include "includes/required.php"; > > do_html_header('Page Detail Statistics'); > > > > $query = "select > > count(tececo_stats.*) as tececo_stats.views, meta_data.title > > from > > meta_data, tececo_stats > > where > > meta_data.id = tececo_stats.id > > order by meta_data.id > > group by meta_data.id"; > > $result = mysql_query($query) or die("Query failed: $query" . > > mysql_error()); > > $num_results = mysql_num_rows($result); > > ?> > > > > Page > NameTota;Number of > > Sessions > > > for ($i=0; $i < $num_results; $i++) > > { > > $row = mysql_fetch_array($result); > > echo > > ''.$row['meta_data.title'].''.$row['tececo_st > > ats.views'].'< > > /td>'; > > } > > ?> > > > > > do_html_footer(); > > ?> > > > > error message: > > Query failed: select count(tececo_stats.*) as tececo_stats.views, > > meta_data.title from meta_data and tececo_stats where meta_data.id = > > tececo_stats.id order by meta_data.id > > You have an error in your SQL syntax near '*) as tececo_stats.views, > > meta_data.title from meta_data and tececo_stats whe' at line 2 > > > > What I want to do: This is essentially a script for a stats > > program that I > > am writting that returns the number of hits for each page. > Instead of > > looping a query I decieded to try and join the two tables to > > make it more > > efficiant. I am trying to get it to work with hits now than > > make it sessions > > later. > > > > I hope this is enough info and thank you for your help. > > > > > > -- > > JJ Harrison > > [EMAIL PROTECTED] > > www.tececo.com > > > > > > "Joakim Andersson" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > I assume that 2count should really be count and 2 is just > > the line-number > > > you added in this post... > > > > > > tececo_stats.views is (probably) the name of a column and > > cannot be used > > as > > > an alias. Change it to something else. > > > change count(*) to count(tececo_stats.*) (I think that's > > what you want) > > > And you probably need a group by-statement at the end: GROUP BY > > > whatever_you_need_to_group_by > > > > > > It's really difficult to answer your questions without the > > table designs, > > > the error message and what you expect this query to do. > > And, it's not > > > slightly OT. It's totally OT. :-) > > > > > > Regards > > > Joakim Andersson > > > > > > > > > > -Original Message- > > > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, July 09, 2002 10:10 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP] Grr SQL syntax error silghtly OT > > > > > > > > > > > > Sorry :} > > > > > > > > I get a SQL syntax error at line two of the query: > > > > > > > > $query = "select > > > > 2count(*) as tececo_stats.views, meta_data.title > > > > from > > > > meta_data, tececo_stats > > > > where > > > > meta_data.id = tececo_stats.id"; > > > > > > > > I have stared at this 'till i felt dizzy. can someone tell me > > > > what I am > > > > doing wrong so that I can
Re: [PHP] Converting PCX to ...
im having problem getting this converter to work, im running the following code: exec("cmd /c f:; cd \Products\legacyipc\ipc_dev\Chapter 21; convert test.pcx PDF_Cache\test.gif"); which is built from a load of data from a database. Unfortunatly, nothing happens. I don't see the new gif, and I don't get any errors. Nothing Someone please help, note: the location of the images cannot be changed "Miguel Cruz" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Mon, 8 Jul 2002, BB wrote: > > I'm writing a reporting system and I have a problem. > > > > I need to insert PCXs into a PDF (using PDFLib), but it doesn't support > > PCXs. > > > > So, to get round the problem, I need to convert the PCXs to JPGs or GIFs > > > > Does anyone know of a piece of PHP that can do this inline, (by that I mean, > > can be called and run in PHP script), because the images will have additions > > and modifications on a regular basis; and they come as PCXs. > > You can do it with Imagemagick. As I recall, there used to be direct PHP > functions for Imagemagick but they have disappeared many versions ago, so > you'll have to run it via system() et al. > > miguel > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Delete me from list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Re: [PHP] Sending data in table, multiple rows, via mail()
On Tuesday 09 July 2002 17:01, Thomas Edison Jr. wrote: > Hi, > > Ok i have a bunch of rows in my table, with some data. > > I want my mail() function to be able to pick up the > data from the rows and send to a specified email. > > Basicall let's say there are 3 fields, and 3 rows, the > data sent in email should be something like : > > row1field1 : dkjhdkj > row1field2 : dsjdkj > row1field3 : skljskj > > row2field1 : dkjhdkj > row2field2 : dsjdkj > row2field3 : skljskj > > And so on, apart from the other mail info. You've stated what you want to do, but you haven't stated what your problem is. > Can anyone help me out with this... Did you want someone to write the whole code for you? Or did you want pointers in how to go about writing the code? If you wanted pointers, then you should state _what_ you need help in. That way people needn't waste time in covering things that you already know. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* those damn racoons! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Grr SQL syntax error silghtly OT
Thanks "Joakim Andersson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I would try something like this... > > SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title > FROM tececo_stats, meta_data > WHERE meta_data.id = tececo_stats.page_id > GROUP BY tececo_stats.page_id > ORDER BY num_hits DESC > > /Joakim > > > -Original Message- > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, July 09, 2002 11:07 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] Grr SQL syntax error silghtly OT > > > > > > table structure for tececo stats(Stores information about the > > visitors to my > > site.visited is either 0 or 1 depending on whether or not the > > stats cookie > > has been set): > > > > id int(11) unsigned NOT NULL auto_increment, > > page_id int(11) NOT NULL default '0', > > visited int(11) NOT NULL default '0', > > time int(11) NOT NULL default '0', > > remote_dns varchar(100) NOT NULL default '', > > remote_ip varchar(15) NOT NULL default '', > > referer varchar(200) NOT NULL default '', > > browser varchar(100) NOT NULL default '', > > system varchar(100) NOT NULL default '', > > PRIMARY KEY (id), > > KEY page_id (page_id,time) > > > > table structure for meta_data(contains information about the > > pages in my > > website): > > > > id int(11) unsigned NOT NULL auto_increment, > > pid int(11) unsigned NOT NULL default '0', > > title varchar(200) NOT NULL default '', > > page_name varchar(75) NOT NULL default '', > > description text NOT NULL, > > keywords text NOT NULL, > > PRIMARY KEY (id), > > KEY pid (pid) > > > > main file(required.php automaticly does a DB connect and is > > used elsewhere > > so I know is not the problem). > > > include "includes/required.php"; > > do_html_header('Page Detail Statistics'); > > > > $query = "select > > count(tececo_stats.*) as tececo_stats.views, meta_data.title > > from > > meta_data, tececo_stats > > where > > meta_data.id = tececo_stats.id > > order by meta_data.id > > group by meta_data.id"; > > $result = mysql_query($query) or die("Query failed: $query" . > > mysql_error()); > > $num_results = mysql_num_rows($result); > > ?> > > > > Page NameTota;Number of > > Sessions > > > for ($i=0; $i < $num_results; $i++) > > { > > $row = mysql_fetch_array($result); > > echo > > ''.$row['meta_data.title'].''.$row['tececo_st > > ats.views'].'< > > /td>'; > > } > > ?> > > > > > do_html_footer(); > > ?> > > > > error message: > > Query failed: select count(tececo_stats.*) as tececo_stats.views, > > meta_data.title from meta_data and tececo_stats where meta_data.id = > > tececo_stats.id order by meta_data.id > > You have an error in your SQL syntax near '*) as tececo_stats.views, > > meta_data.title from meta_data and tececo_stats whe' at line 2 > > > > What I want to do: This is essentially a script for a stats > > program that I > > am writting that returns the number of hits for each page. Instead of > > looping a query I decieded to try and join the two tables to > > make it more > > efficiant. I am trying to get it to work with hits now than > > make it sessions > > later. > > > > I hope this is enough info and thank you for your help. > > > > > > -- > > JJ Harrison > > [EMAIL PROTECTED] > > www.tececo.com > > > > > > "Joakim Andersson" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > I assume that 2count should really be count and 2 is just > > the line-number > > > you added in this post... > > > > > > tececo_stats.views is (probably) the name of a column and > > cannot be used > > as > > > an alias. Change it to something else. > > > change count(*) to count(tececo_stats.*) (I think that's > > what you want) > > > And you probably need a group by-statement at the end: GROUP BY > > > whatever_you_need_to_group_by > > > > > > It's really difficult to answer your questions without the > > table designs, > > > the error message and what you expect this query to do. > > And, it's not > > > slightly OT. It's totally OT. :-) > > > > > > Regards > > > Joakim Andersson > > > > > > > > > > -Original Message- > > > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, July 09, 2002 10:10 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP] Grr SQL syntax error silghtly OT > > > > > > > > > > > > Sorry :} > > > > > > > > I get a SQL syntax error at line two of the query: > > > > > > > > $query = "select > > > > 2count(*) as tececo_stats.views, meta_data.title > > > > from > > > > meta_data, tececo_stats > > > > where > > > > meta_data.id = tececo_stats.id"; > > > > > > > > I have stared at this 'till i felt dizzy. can someone tell me > > > > what I am > > > > doing wrong so that I can learn from it? > > > > > > > > Thanks in advance > > > > > > > > > > > > -- > > > > JJ Harrison > > > > [EMAIL PROTECTED] > > > > www.tececo.com > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (h
[PHP] Moderator where are you, delete me from the list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
RE: [PHP] Moderator where are you, delete me from the list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
look at the footer > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -Original Message- From: Erik Hegreberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 7:40 PM To: [EMAIL PROTECTED] Subject: [PHP] Moderator where are you, delete me from the list -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Delete me from list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Obviously you are one of those ppl who dont keep important emails... I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address: For help and a description of available commands, send a message to: <[EMAIL PROTECTED]> To subscribe to the list, send a message to: <[EMAIL PROTECTED]> To remove your address from the list, just send a message to the address in the ``List-Unsubscribe'' header of any list message. If you haven't changed addresses since subscribing, you can also send a message to: <[EMAIL PROTECTED]> or for the digest to: <[EMAIL PROTECTED]> For addition or removal of addresses, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction. If you need to get in touch with the human owner of this list, please send a message to: <[EMAIL PROTECTED]> Please include a FORWARDED list message with ALL HEADERS intact to make it easier to help you. > -Original Message- > From: Erik Hegreberg [mailto:[EMAIL PROTECTED]] > Sent: 09 July 2002 10:28 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Delete me from > list!! > !! > !! > !! > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Image Functions
I have a directory of jpegs that I want to display thumbnails of and have a link to the original jpeg. I would rather not create separate thumbnails images preferring to create them in memory to display them. I have installed GD v.1.8.4. The code below outputs jumbled text to the browser (possibly the jpeg stream?). Code is as follows: Why will this not work? This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bad table iso-8859-1
Hello everyone, I have a problem with charset iso-8859-1. My configuration is : Apache 1.3.26 on MacOS X with PHP 4.2.1 when I execute this script : I have result 142 which is the code of the macinstosh table and when i send it to my browser or in a email, this doesn't work. I must have the windows table where this caracter has the code 233. I've added in Apache a "AddDefaultCharset iso-8859-1". I also made a ini_set("default_charset","iso-8859-1") But it doesn't change anything. It seems to change the 'local values' but not the 'master values' I canno't change the value in php.ini because on MacOS X, there wans't a file php.ini So I've made a personal function to change code on fly but it isn't speed. Any suggestions ?? best regards. Philippe BARRIELLE Sce Informatique --- * S.A. Editions et Publicites - ABRITEL * 109, La Canebière - B.P 2033 - 13201 Marseille cedex 01 - France Tél : 33 (0)4 91 11 00 72 Wap : http://wap.abritel.fr Email: [EMAIL PROTECTED] Web : http://www.abritel.fr --- LOCATIONS VACANCES - FRANCE - SPAIN - DOM - PORTUGAL --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting PCX to ...
batch files rock! :o) "Bb" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > im having problem getting this converter to work, im running the following > code: > > exec("cmd /c f:; cd \Products\legacyipc\ipc_dev\Chapter 21; convert test.pcx > PDF_Cache\test.gif"); > > which is built from a load of data from a database. > > Unfortunatly, nothing happens. > > I don't see the new gif, and I don't get any errors. Nothing > > Someone please help, > > note: the location of the images cannot be changed > > "Miguel Cruz" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Mon, 8 Jul 2002, BB wrote: > > > I'm writing a reporting system and I have a problem. > > > > > > I need to insert PCXs into a PDF (using PDFLib), but it doesn't support > > > PCXs. > > > > > > So, to get round the problem, I need to convert the PCXs to JPGs or GIFs > > > > > > Does anyone know of a piece of PHP that can do this inline, (by that I > mean, > > > can be called and run in PHP script), because the images will have > additions > > > and modifications on a regular basis; and they come as PCXs. > > > > You can do it with Imagemagick. As I recall, there used to be direct PHP > > functions for Imagemagick but they have disappeared many versions ago, so > > you'll have to run it via system() et al. > > > > miguel > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mbstring: Japanese conversion not working for me
Alberto Serra wrote: > > the charset codes must be fully specified, such as > ISO-2022-JP (the one you are using yourself) > SHIFT-JIS > EUC-JP I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much for a nice idea quick hack to displaying multiple charsets at once. Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser Troubles...
OK... I have developed a web-application... on Windows 2k Server, IIS5, PHP, MsSQL/MySQL. Now... on certain browser platforms the browser spuriously dies for no reason. (Primarily Oldish IE 5.0(but not all releases) and 5.5). I have tried MS's mailing lists/support but not had any usefull feedback. Has anyone came accross this kind of thing before? Thanks In Advance... [ http://www.the-local-guide.com :: http://www.mcgarvie.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] EXIF and thumbnails
Hello! I know it's possible to read thumbnails from the EXIF-headers in for example jpeg-images. But is it also possible to _write_ EXIF-data, that is, if I want to create a thumbnail where there is none? Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Figuring Out the Best Day in stats program
>$query = "select count(*) as monthly_views from visitors group by >extract('year', time), extract('month', time) order by monthly_view desc >limit 1"; >Warning: Supplied argument is not a valid MySQL result resource in >C:\Inetpub\TecEco_PHP\stats_interface\summary.php on line 75 >You have an error in your SQL syntax near ''year', time), extract('month', >> Dig through the manual of your database (you didn't say which one) in the >> Date/Time functions section, and see if you can find one that will extract >> the year and month from a timestamp. >> 1. 'extract' is probably not the right function name. You'll have to look >> that up. http://www.mysql.com/doc/D/a/Date_and_time_functions.html -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser Troubles...
>Now... on certain browser platforms the browser spuriously dies for no reason. >(Primarily Oldish IE 5.0(but not all releases) and 5.5). > >Has anyone came accross this kind of thing before? > > > > What? M$ software crashing? Na... never seen that ;-) sorry... coudn't help that! What output do you produce with your PHP script? Is it plain HTML, does it include Javascripts or some our scripts? Did you check the HTML code of the output? Does it contain invalid tags or missing end tags? René -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thanks
>Probably a stupid question. Is there anyway to force POSTing a form from >the refresh META? > > > >IMHO that is NOT possible, but maybe I am wrong. You are correct -- it cannot be done. If there is no JavaScript, you can only "force" a POST by getting the user to click on a FORM element, some how, some way... *UNLESS* Use PHP in a GET URL to call something like Rasmus' old 'posttohost' function which will do the POST. I don't know if that will "work" for what you are trying to achieve... I guess the root question is *WHY* do you want to force a POST? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL and parameterized queries
>Does MySQL support parameterized queries (e.g., "INSERT INTO table >(Col1,Col2) VALUES (?,?)"), and if so, is there a PHP function that allows >you to create and attach parameters to MySQL queries? I don't believe MySQL supports that, so there's no PHP mechanism for it. However, you *can* insert a bunch of rows at once with something like: $query = "insert into table (col1, col2) values (1, 2), (3, 4), (5, 6)"; I don't guarantee I got the MySQL syntax correct, though. This is, however, not supported under other database engines, so be aware that you'll need to alter it if you ever move to something other than MySQL. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Error: Parse error: parse error, unexpected $ in...
>Hi all. Im getting the above mentioned error: *Parse error*: parse >error, unexpected $ in *c:\program files\apache >group\apache\htdocs\login.php* on line *38* when I try to view the page >I just created. As a forewarning, I am very new to PHP, so I may have >done something stupid, and if it matters, I am also using windows, not >*nix. Any help with this would be greatly appreciated. You kinda gotta show us line 38, and the lines before it... Wild Guess would be a missing ; in the line *BEFORE* 38. Second choice would be a missing } somewhere, or a missing quote. Consider looking into configuring your editor to "syntax-highlight" your PHP for you. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thanks -> Actually POSTING without javascript
>javascript in this page verifies user configuration (screen, java >enabled, platform etc) and stuffs this data into a hidden form then >sends it back to index.html where data will be used to understand >whether we can rely on jscript and cookies within this session. Aha! What you probably should do is have your index.php page spew out some JavaScript that re-directs them to the JavaScript-enabled home page, and then whatever you wish to display to the non-JavaScript users. The JavaScript users will end up on the other home page, and the non-JavaScript users won't. Separate the non-JavaScript users right away. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with SQL query
>LIMIT was not included in the SQL92 SQL standards and very few vendors >implement all of SQL99; the use of ANSI standards to promote "portable" >programs has always been beset by this kind of problems. Wow! There's actually an SQL99 that vendors are targeting, kinda sorta? Hey, with any luck, but 2009, they'll all be SQL99-compliant, and we can start all over! Not that they ever all reached SQL92 compliance. Oh, just in case people don't know. SQL92 is named SQL92 because it was defined in... [drum roll] 1992 That's 100 years ago in doggie years :-) Consider yourself lucky if any of your SQL is really portable without jumping through hoops. I do want to apologize for my month_view/monthly_views typo. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: transporting variable via post to another site
>I do have a multisite form. There are several fields on page 1 and several >on page 2. > >Everything works fine exept of error handling. Which means if a user wants >to go back from step 2 to one and has already filled in some data in site 2 >he will loose this data for sure. It is not possible to transport the data >via get anymor because the text is way to long. POST text can be very large, but your server is allowed to limit it as low as 2K, I think. GET data can be limited as small as 255 characters, I think. Those limits may have increased, but the bottom line is still GET *can* have a much lower limit. It's up to the server to impose (or not) this limit. >So how could this be done with post? I tryed to include a hidden text field, >but since this must be another form (action links to page 1) I can't get the >value of the entered data. You'll be able to do a quick hack to fix it just using POST, but, truly, you'll save yourself a lot of headache long-term to use: http://php.net/session_start to just keep track of the user's ID, and store all the data as they fill it in in a 'temporary' table in your database. Create a table with all the fields in all the forms, and call it something like 'incomplete_applications' Then, when the user has clicked around on all the pages and is happy, they can submit the 'final' application. You can then double-check all the data and make sure it's good, and then insert it to the "real" table, and delete it from the "temp" table. You'll need to sit down and plan this out a bit more, but you'll be much happier with the results. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mailing all the elements of a form
>I have looked in PHP manual but I cannot seem to find what I am looking for. > >I have a very large form that I need to be able to mail. I just don't want >to have to code all of the field into my mail() function. I think this one is still in the FAQ, so maybe it's time to re-read that. I asked the same question myself, lo these many years ago, when I had *read* the FAQ, but didn't understand the question, much less the answer... Felt pretty silly when I went and re-read the FAQ, and there it was, plain as day. :-) Also cleared up a few other things that had been bugging the back of my brain: http://php.net/FAQ.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Stored Procedures
>On Sat, 06 Jul 2002 15:27:47 -0500 >> Do you have *ANY* idea how quickly: >> >> "select * from MyTable" can be parsed and an execution plan selected?! >> >> It's CHUMP CHANGE in time. >> >> *ONLY* if your SQL is so incredibly complicated that you can't even >> understand it will the parse/compile time of SQL be a factor in >> performance. > >It is "CHUMP CHANGE" when you make a tinie web site with 2 users. Do the >math. If you have a SQL statement that takes 250 milliseconds to parse >and create an execution plan, then 250 * 1,000,000 page request per week >(which is what the site I finished averages, the company I >work for has 110,000 employees) = ??? This is second grade math. > >No matter how you look at it, 10 extra milliseconds here or there >adds up when you work on a big site. The db's I work with are not >simple "select foo from bar" queries. An enterprise db is usually pretty >complex. My main reason for posting a reply was not to start a stupid >flame war with you. It was from stopping you from filling the heads of >new programmers on this list with bunk. Stored procedures are not junk! >I wonder why they are the most requested feature for MySQL? Why would all >the Big DB's (Oracle, DB2, PostgreSQL, SQL Server, etc.) support them >if they had no benifit? The biggest benifit is SPEED, the second is >the ability to encapsulate the underlying database structure. A DBA can >change the db structure at will as long as the sproc returns the same >columns. Yes, if your site gets millions of hits, an SPROC can improve raw SPEED. And it *MAY* be the only option available to wring out that performance you need. There are some significant down-sides to the administration of SRPOC, as I noted earlier. The company I was working for was *NOT* getting millions of hits, had no *CHANCE* of getting millions of hits, and mindlessly wasted weeks' of developer time and drastically increased maintenance costs because "SPROCS make it faster" has been the watch-word. Their DBA was their chief IT who was their main lead developer, and then there was me. Two programmers in the entire 7-person company. If somebody actually *HAS* a system large enough to need SPROCs and *has* a DBA who isn't also the chief-bottle-washer, they almost-for-sure don't need me, or you, to tell them about SPROCs. :-) My primary concern is the little guy who's going to run out and change their entire architecture around for a 3000-hits-a-month web-site because they keep hearing "SPROCs will make it faster" without anybody ever bothering to mention little things like "overhead" and "administration" and "maintenance" to them. I'm sorry my rant touched off a nerve, and if there *IS* anybody stuck with a million-hits-a-day site, by all means, *TEST* some SPROCs and see if they improve your performance enough to make the maintenance hit worthwhile! By all means, *DESIGN* the darn thing with as many layers of solid, clean, simple API as it takes. But if you're trying to improve page load speed on a low-traffic site, SPROCs are almost for sure not your answer. If you don't even *have* a speed problem, running out and spending a gazillion $$$ worth of people-hours on SPROCs is downright silly. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: suppressing errors with "@"
>Doesn't @ surpress output (in general)? >Variables don't usually produce an output so putting @ before it shouldn't >make any difference. @ suppresses *ERROR* output, not just any old output. @ echo "foo"; will echo foo out. @ echo $foo; will echo out anything in $foo, but if you haven't *PUT* anything in $foo yet, and if you have E_ALL turned on like you should, then the @ will suppress the "Warning:" message. @ can generally appear just about anywhere, and not necessarily just in front of functions (unless this changed on purpose in 4.2 for some reason beyond my ken) I don't use @ a whole lot, except for pg_fetch_row() where you pretty much have to (ugh!) Anyway, this is legal (or was before 4.2), if silly: if (@$foo){ } Here, the test for $foo, which might not be set, will suppress the "Warning:" about $foo not being set, because there is an @ in front of it. Of course, you *OUGHT* to be using: if (isset($foo)){ } in the first place! I dunno why the @ behaviour changed in the original post's case. Might even be an actual bug... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] inserting linebrakes in multisite forms
>That looks like the result of htmlentities(nl2br($string)). Actually, it's probably the result of just nl2br($string) and being in the midst of the INPUT tag in the first place... >Do it the other way around. > >Better yet, don't call nl2br or htmlentities or anything else on data that >you are inserting into your database. Madness that way lies. >Instead, use those functions only when outputting data to the browser. Yes! I forgot to say that part. Don't put the nl2br() part in before you insert it to the database. You'll give yourself a major headache some day, like when you need to send that data off to something that's *not* a browser. And it *will* happen, sooner or later. You *DO* need the htmlentities() to change your $string into valid HTML, so you can send it to the browser and fish it back out reliably. You are essentially treating the browser as a "data storage facility", but a browser only accepts HTML data. Thus, you must convert your data into HTML using htmlentities() when storing it there. You do *NOT* want to convert it with htmlentities() or nl2br() when storing it in MySQL. You only want to use Magic Quotes *OR* addslashes() to store into MySQL. Then, only when you *finally* output it to the end-user do you want to use nl2br() to add any HTML needed to properly display it. I hope this is making some sense now. It's hard to know when to apply these functions, but the two basic rules I would suggest you try to follow are: Be sure you use the right function to store the data in the place you're putting it: htmlentities to "store" HTML data addlashes() to "store" MySQL data (Or Magic Quotes instead of addslashes) nl2br() only to output the data in the final rendering to the end-user And, only apply these functions at the last minute that you have to -- Applying them any sooner than that will give you a data-headache. Still, though, using the browser as "data storage facility" in a multi-page FORM is not such a Good Idea (tm) in the first place. The browser is really good at *presenting* data, but wasn't really designed as a substitute for a database. Put your data into the database as soon as possible. MySQL is *really* good at data storage. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: About submitting multipart.forms
>has anyone met with this problem.. using IE to submit multipart forms. in >text fields if there is "&" ... all text after it will disappear..quite a >nuisance when submitting You probably aren't using http://php.net/htmlentities as you pass data back out to the browser. Microsoft, in it's infinite wisdom, has decided that things like: © don't really need the semi-colon to be HTML Character Entity thingies, and © is just as good. (Try it!) Thus, if you don't use htmlentities to turn "®ulation require" into "®ulations require", then MS has foolishly decided that "®" *must* be the HTML Entity ®, and you're just forgetting the ; You should be using htmlentities anyway, but it's quite annoying when dumping data to the browser that MS does such stupid things with it. Sigh. Anyway, moral of the story: *ANY* time you are sending strings out to the browser as data, use on the data part. EG: -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Survey: MySQL vs PostgreSQL for PHP
>I've been using MySQL/PHP for quite some time. Several months ago, I >wanted to port a project over to PostgreSQL. I found everything about pg >(eg the website, documentation, installation process) far less straight >ahead than MySQL. So much so, that I didn't get around to actually >installing pg. I actually found PostgreSQL more straight-forward, since the arguments are required. (Or used to be.) So I better understood what was going on in PostgreSQL. Not as many examples "out there" but, really, changing: mysql_query($query) to pg_exec($connection, $query) in reading the examples is not that tricky... Oh well. Different tastes for different folks. >Plus, as others have pointed out, the supporting functions in PHP aren't >as powerful/diverse. For example, there's no insert id function. Yes, there *IS* such a function, but it's a two-step process. $oid = pg_getlastoid() followed by a SELECT ... where oid = $oid http://www.php.net/manual/en/function.pg-last-oid.php OID stands for "Object ID", and every PosgreSQL object has a unique OID. Every row, every Large Object, every everything. Whoops. Just double-checked, and apparently pSQL 7.2 doesn't *have* to have OIDs for everything. This could get interesting, folks... A quick perusal of the PHP Docs makes me say: Only get rid of the optional OID if you are 100% sure you'll never need go use pg_last_oid() or you'll be in deep trouble. You do *NOT* want to "just use the oid as my own id" however. OIDs can change when you export/import database data, if you're not careful, and it's just bad form to use that internal ID as your own. PostgreSQL (and any SQL database) would be completely un-usable (*) if there wasn't some way to reliably get the last tuple inserted from your own connection. Kinda funny that never made it into SQL92 :-) (*) Yeah, okay, you can generate your own unique ID before the insert, and then SELECT on that to get the auto-generated ID... Might as well not bother with an auto-generated ID, then, eh? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: inserting linebrakes in multisite forms
>One Form has a textfield, I submit it to another html site where there is >another form with a textfield. Inside this textfield I place a hidden field >with the value of the field from page 1 then I submit to the actual php site >inserting the values into a db. On the "middle" page, use "View Source" in your browser to look at the HTML and your HIDDEN text. I'm guessing that where you spit that HIDDEN text out, you are not using: http://php.net/htmlentities EG: \n"; ?> >at this point I do insert the linebrakes (nl2br) but only the field from >page 2 is really stored with linebrakes the other one is not. How come? > >Has anybody a good idea or even know how to do this? You may also want to consider storing each page's worth of data in a temporary table, kinda like a shopping cart, and then you only have to pass the User's ID around to keep track of all their stuff. I'll go into this more in the answer to your next question :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: newbie: a couple basic questions
>1) in a fuction, does a return statment automatically exit the function as >well? Yes. Nothing more will get executed inside the function after the "return;" Some purists claim that you should *NEVER* have a return *ANYWHERE* except the last line of a function. EG: # WRONG function divide($numerator, $denominator){ if ($denomiator == 0){ return ''; } else{ return $numerator/$denominator; } } # RIGHT function divide($numerator, $denominator){ $result = ''; if ($denominator == 0){ $result = ''; } else{ $result = $numerator/$denominator; } return $result; } It probably seems "silly" here, but when your functions get to be three or four screenfuls long, a "return" you aren't seeing on the monitor can frequently get you very confused, very fast. >2) can someone give me a better explination of $HTTP_POST_VARS If you give somebody an HTML FORM (like those forms you fill out on-line), after they fill it out, the PHP page that *proccess* the FORM page will find all the data in an array named $HTTP_POST_VARS. Actually, it got renamed to $_POST recently. (The old one will still work for a while, but convert ASAP). Sample HTML: Sample PHP: (note the filename must match the ACTION= part above) \n"; echo "search button was clicked: ", isset($_POST['search']), "\n"; ?> You could even not "know" what fields are in the FORM, and just output all of them: (this would be a "replacement" process.php file) \n"; } ?> -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: configure breaks at return type of qsort...
>configure: error: Cannot find header files under /usr/include/mysql >Bad exit status from /home/askwar/RPM/tmp/rpm-tmp.64223 (%build) > >I called configure with these parameters: > >--with-mysql=/usr/include/mysql >host:/S.u.S.E. # ls -la /usr/include/mysql >Does anyone have an idea about why this error happens? Here's the thing: PHP needs to find the MySQL headers, and you made a really good guess on the --with-mysql part so it could have found those... But, PHP *ALSO* needs to find the MySQL "libraries", which are probably under /usr/lib/mysql Now, you only get to specify *ONE* pathname in your --with-mysql=xxx So, here's the deal-io. You tell ./configure the directory *UP* *TO* the "common" part of where MySQL headers and libraries are, and it digs down inside there to find both: --with-mysql=/usr Does that make sense? PHP needs to dig inside of that to find the "include" dir, *AND* the "lib" dir where stuff like libmysql.so are living. So only give ./configure enough info to know where to start digging, not the whole path to just the "include" and then it can't find the "lib" -- and, paradoxically enough, it can't "dig" down to find the "include" inside the include, because you dug too deep already. In your case, it's just /usr Somebody else might have: /usr/local/mysql/ include/ lib/ and they would use /usr/local/mysql Don't worry about exactly how ./configure is going to dig down inside of /usr/include/mysql and /usr/lib/mysql as opposed to /usr/local/mysql/include and /usr/local/mysql/lib on some other system (See how the directory structures are "inverted" ?) ./configure is real good at digging "down" the directories either way it's laid out. It just ain't good at backing up a directory or two to find the parts it needs. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Printing Problem
>I'll repeat my ealier question because some people can not think for >themselves.. There are actually two (2) possibilities here... One is that you actually want to print the invoices on the printer connected to the *WEB* *SERVER* If that is the case, you really should skip the whole JavaScript part, and just mess with lp and PHP from the command line, if at all possible. The other is that you have a little "hole" in the background knowledge you need to understand why you're really not making a lot of sense by insisting that PHP "pause" the dialogs... >I want to run a print job of 200+ invoices > >I have a javascript code to open a print dialog box and >Then go to next invoice and do the loop.. > >Problem I am having is that I want it to pause if the ok button on the >dialog Box is not pressed.. >When I run the script it fly's throught and brings up a heap of printer >Dialog boxes which causes me to ctrl+alt+del... > >Anyway or pausing the script untill ok is pressed? > >Thanks in advance.. > >(PS: I have sent this to this group because > 1. The loop is done in php and NOT javascript The loop you are using in PHP is *generating* JavaScript. The *PRINTING* is being done on the *BROWSER* and PHP lives on the *SERVER* So the loop speed is not the controlling factor. Honest. More on this in a minute. > 2. My question is regarding php and pausing the loop and not >with the javascript code) You can, if you like, use http://php.net/sleep to pause that loop as much as you want. *BUT* this is almost for sure *NOT* going to work all by itself. Look at this picture: +---+ +-+ | Browser 1.|-- URL>|2. Web Server| | | |3, 4, 5. | | JavaScript 7.|<--|6. PHP | | 8.| | | | 9.| +-+ +---+ | | | | v PRINTER Now, take this in "slow motion" 1. Browser asks for URL. 2. Web-Server gets Request. 3. Web-Server identifies it as PHP page. 4. Web-Server fires up PHP. 5. PHP spews out HTML/JavaScript response. 6. PHP finishes HTML/JavaScript output. 7. Browser gets HTML/JavaScript. 8. Browser displays HTML. 9. Browser executes JavaScript. As you can see, it really doesn't matter how fast or how slow your PHP script delivers the HTML/JavaScript to the browser, really. The *JAVASCRIPT* execution determines how fast those dialogs are going to pop up, no matter how quick/fast PHP delivers it. Think of it this way: Whether the pitcher throws a fast ball or a curve, it's how hard the batter *HITS* the ball that makes it a home run or not. So the speed of the ball delivery is irrelevent to the distance the ball travels. [Technically, Newton's action/reaction laws do factor in a trifle on the ball's speed, but let's not pick nits, okay?] Similarly, no matter what speed PHP delivers the JavaScript, it's the Java engine that runs it. Don't matter if PHP delivers it slow or fast, the *BROWSER* gonna run it the same speed. Actually, 5, 6, 7, and 8 can "over-lap" a little. So, really long and complicated PHP with lots of HTML going out *might* have the browser displaying the top of the HTML before PHP finishes spewing out the bottom of the HTML... But, honestly, even when you *think* that's happening, it's usually really just the browser being slow to *draw* the HTML, and PHP has finished and gone home already. So for all practical purposes, you might as well just think of each of those 9 steps as one after the other. (And if you have TABLE tags, it *IS* going to be one after the other.) Now, you just *MIGHT* achieve a very crude control over PHP output and convince *SOME* browsers to execute the JavaScript if you do this "just right" 1. You'll probably have to have all the "print" happen in the HEAD tag, or maybe even before the HTML tag, so the browser doesn't get "distracted" by the layout of the BODY. 2. You'll almost-for-sure have to send each "Print" job in a *SEPARATE* tag, or the JavaScript compiler will be waiting for the closing before it compiles the JavaScript and executes it. 3. You'll need to call http://php.net/flush after each "print" is output, so that the JavaScript is forced out to the browser. Even, then, I'm betting this just isn't gonna work... It *might* on *some* browsers, but not reliably... Still, here it is: \n"; echo javaprint($invoice); # Whatever it takes to do the "print" in JavaScript echo "\n"; flush(); sleep(5); } ?> Whatever You *MIGHT* be able to get away with putting the JavaScript into the HEAD part, but almost-for-sure if you put it into the BODY or lower, it ain't gonna work. I could be wrong on that part, but I doubt it. Of course, if it's in the HEAD or higher, then while you're waiting for the printing, the browser can't display the B
Re: [PHP] Re: suppressing errors with "@"
>I use it in front of variables (never tried it on $GLOBALS, etc though) > >eg: (using register_globals = on thingo - hey don't blame me, it's the >tech guys who have it on, and there's too much legacy code to turn it off :( >- anyway) > > if (@$var) { echo "Yep, var is there"; } else { echo "nope"; } >?> The risk is in hackers using an un-initialized $var to pass in their own data. If you've *correctly* programmed and caught *every* single case where that might happen, by using isset() or even something like the above, only doing something more useful, you're almost-for-sure okay. register_globals off just annoys me since I *always* initialize variables, and there's no point to me re-writing the tons of scripts for it, but that's life. That said, the sheer number of non-programmers writing PHP made register_globals on a Bad Idea (tm) really... I guess even some good programmers could occasionally miss a variable initialization, though I never do :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Software on web Accessing mySQL/PHP
>Basically we have created a Software in Visual Basic. >Now the software uses mySQL on the internet as >Backend. However, our server does not allow Remote >Host Connection, which means we cannot access our >mySQL Database on the Internet by our Software on a >local client. We need the mySQL Database on the >Internet because basically everything will be >available on a website later through PHP Pages. > >Now, my problem is how to connect to my mySQL DB on >the Internet, via my Software, when my Server Company >doesn't allow Remote Host Connection to mySQL. > >What is suggested to me is to place the Software on >the Internet. I have no clue how to do that. Because >if i place an .exe file on the net, it will just start >downloading instead of running. *IF* your ISP is running PHP on Windows, you *MIGHT* be able to just upload your .exe to the CGI-BIN directory and get it to work somehow through that... But, really, your ISP is gonna be able to clarify this much faster than any of us... If all else fails, and this is really, really crude, you *COULD* build a PHP script that would spew out whatever data you needed from MySQL, and you *COULD* (I assume) get your VB program to read the HTML via HTTP, and then you *COULD* POST back to the web-server from VB any changes and PHP could process them... This would be really ugly, but does satisfy the conditions I think you have laid out... >How then can i accomplish this? >The software feeds in Data in the mySQL DB on the >internet, and then the PHP pages access the mySQL DB >to show data to users on the Website. It's something >like that. The software involves a lot of processing, >decryption, conversion etc. to convert a .dat data >into usable mySQL Tables Data. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A problem in mysql_fetch_array
>I have insert some text with space to mysql DB with varchar() > >When I use mysql_fetch_array function to retrieve the data from DB . I >found only the first session text can be shown . It means if any space >there . It will split like session by session. for example. my DB have a >text "Hello World" , It can retrieve only "HELLO" by using mysql_fetch_array . Wild Guess: Somewhere, you have something like this: echo ""; (Where $hello is your variable with "Hello World" in it.) This turns into this in the HTML Which, in HTML terms, means that "World" is part of the *TAG*, not the data -- It's an attribute, because there is a space and no quotes around your data. You need to convince the HTML to look like this: so the PHP should be: echo ""; And, just in case $hello might some day contain < or > or " or & or anything else that has special meaning in HTML, it should *really* be this: echo ""; http://php.net/htmlentities -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Little php execution question.
>Hello php-general, > > I finally finish my work on one of the projects. I got a question > how PHP executes a script. > Let's say i got a little script but it takes him a long time to work > (don't blame me please) If a user stops loading page of will close > the window. Will Script continue working till the end or php will > kill that process? Yes. :-) http://php.net/ignore_user_abort Test thoroughly! -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parsing CGI for PHP?
>Can this be done with apache 1.3 ? >I want to have the output of my CGI-script to be parsed with PHP, or >rather, have the php within the parsed, of course, since the >script outputs alot more than just php-code. > >Is it possible? I don't think so. Apache 1.x was designed to "hand off" the URL to one, and only one, CGI or Handler pre-processor. Only with Apache 2.x can you "stack" handlers. I dunno if Apache 2.x lets you mix&match CGI with Handlers, though. Unless you can output to some kind of file somewhere, and send the user there with a Location: header, which is really ugly -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Converting PCX to ...
>I'm writing a reporting system and I have a problem. > >I need to insert PCXs into a PDF (using PDFLib), but it doesn't support >PCXs. > >So, to get round the problem, I need to convert the PCXs to JPGs or GIFs > >Does anyone know of a piece of PHP that can do this inline, (by that I mean, >can be called and run in PHP script), because the images will have additions >and modifications on a regular basis; and they come as PCXs. I think you will be stuck with using http://php.net/exec to run some external process to convert them. Image Magik seems to convert almost every format known to man... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: keep textformating ?
>Lets say I have a guestbook, and I want the text the visitors write in it be >saved in a database(mysql) and when retrieved, if should have the same >textformating, I guess this is a really basic thing, but I don't know what >to look for :) >I've caught \n and ereg*, but I'm not sure that's the thing, help bitte .) Also use WRAP=VIRTUAL in the TEXTAREA tags, unless you want annoyed users when they type too much... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Editing Word Documents
>I have an intranet, which provides access to, amongst others, Word >Documents about policies, etc. What the guys are looking for is a way to >do the following: > >1. Show a list of files available for editing >2. If a file is clicked, then it is locked for other users (no access) >3. The file opens on the client's machine >4. The client edits it >5. The client then closes the file, it "auto-saves" and he goes about >his business. > >Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5) >have me lost. > >How do you get a file to be edited, and then automatically returned to >the server by M$ Word in it's changed format. Is this possible? > >How would this change in a database-backended system (including the >files as BLOBs)? They'd have to be "uploaded" *SOMEHOW*... If the employees can't do that "by hand", then perhaps some kind of "scheduled" task on the Win boxes could be programmed to do it. Don't forget to *UNLOCK* after a successful upload, but not when, not if, when, the upload fails. There's simply NO WAY the server can reach out and suck in a file of its own volitoin... Major privacy/security problem there. You *COULD* also install Apache + PHP on every desktop, and have them serving up their edited Word files to the Intranet, and then PHP could use HTTP to suck them back in... But that's probably not gonna fly for non-technical reasons. Well, not counting really bad Security as a "technical" reason. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: add to basket
>What's the best way to implement functions like 'add to basket' or 'add to >wishlist' and so on. > >I mean: you are on a page with detail information about a product. If the >user clicks the link for 'add to basket' I have to perform a piece of >script and then go back to the detail page of the given product. But >clicking on this link leads me away form the page... > >I was thinking of using $HTTP_REFERER i the "ad_to_basket.php" page in >order to retrieve the last url, but now I don't know how to go back to this >detailpage, is there a php command for this, or is my approach totally wrong?? - sample.php Display rest of page here. ?item_id=42>Item # 42 Display items already in cart: \n"; } ?> - basket.inc --- --- You'll want to complicate this horribly with a "quantity" so you'll need to check if they have any or not, and then do an "insert" if they don't and an "update quantity = quantity + 1" if they do, and then validating data, and so on, but that's really all there is to a shopping cart at its most simplistic. What most people mean when they say "shopping cart" these days is "shopping cart" and "shipping charges" and "catalog system" and "pricing structures" and "secure checkout" and... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regex for emoticon codes
>i have something like >$str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; > >i would like to use regex to replace those codes into: >sometext sometext /images/emot/01.gif sometext /images/emot/23.gif sometext > >all numerics after the code "emoticon" consisted of exactly 2 digits; and they >are in the range from emoticon01 to emoticon30. > >i have spent the whole day starring at my crt and reading manpages plus >examples. i achieved nothing but sore eyes. > >i would GREATLY-GREATLY appreciate if someone could gimme a code snippet on how >to this sorta thing. You're lucky. You don't have to strain your brain with Regex. :-) http://php.net/str_replace -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_REQUEST???
>Can the $_REQUEST be trusted?? The documentation said it is the combination >of $_GET, $_POST, $_COOKIE & $_FILE. If the PHPSESSID is found in >$_REQUEST, I can tell it is from $_COOKIE. I wonder if the PHPSESSID can be >stored into $_REQUEST if hte $_COOKIE is unavailable or turned off? Since *NONE* of $_GET $_POST or $_COOKIE can be trusted, I don't think any combination of them should be trusted. $_REQUEST is useful when you con't *CARE* if the data came from GET/POST, and have a script that accepts either. I have written several such scripts, and the interface of one site/application accesses it with GET, and the other with POST, and I really don't give a [bleep] whether the incoming data is GET or POST. It's all coming from the Internet and is not to be trusted. Forging a POST is not significantly more "tricky" than changing a URL. Just do "Save As..." HTML from somebody's site, change the HTML FORM elements, and then open the local file in your browser and POST away. I've even used this technique to make use of "broken" sites simply by providing the FORM elements they forgot that their processing script told me it needed. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Passing variables
>After reading Kevin Yank's "Managing Users ..." at www.sitepoint.com, I >tried the following 2 scripts. Unfortunately, the variable $course is NOT >being passed to the 2nd script. Thus, per the script, the Home page is >displayed. Why? In addition to needing session_start() in page 2, you simply cannot reliably use session_start() which sends a Cookie and a Location: to the browser. You're going to have to send your data as GET data, or not do all those header("Location: ...") calls, and just combine the three scripts into one. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cross-Site Sesison ID Propagation
>Hello all fellow-hackers > >I am working on a project that includes a number of web sites, which are >grouped together into one network. Kind of like the OSDN network, of which >Slashdot.org, for example, is a member. > >I need to implement a cross-site session. Using a technique, similar to the >one described at PHPBuilder >(http://www.phpbuilder.com/columns/chriskings20001128.php3) I implemented >this without too much difficulty. > >The links at the top of each site (links to other sites in the network) >simply include the session id in the GET request: > >http://www.site.com/?sid=1234567";>Site1 | href="http://www.site2.com/?sid=1234567";>Site2 | href="http://www.site3.com/?sid=1234567";>Site3 etc > >As per article, the session id is passed between the sites with ease and the >session from Site 1 can be continued on Site 3 for example. > >However, there are a number of cross-site links in the main body of the site >(i.e. not in the network link bar at the top of the page) that link various >articles from one site to another. > >Thus, when a user clicks on one of these cross-site links, s/he cannot >continue her/his session, as the session ID is not propagated; the >--enable-trans-sid option only works on internal links (a very wise design >choice, may I add). > >However, in my case, I would like to be able to define a list of external >sites that the --enable-trans-sid option works with. (i.e. the sites in >the network). > >Is this possible? > >If not, which method could I use to propagate the session id between the >sites in the network? > >I know, it would be possible to manually add the session id to each >cross-site link, but this is not a great idea, as a number of the links are >from web site visitors in user-comments / forum posts they have submitted. > >I may be possible to use output buffering to rewrite the cross-site links to >include the session id (like the --enable-trans-sid option works, I >guess). But, as I am using compression >(ob_start("zlib.output_compression");), that may not work. Plus, it seems a >very fiddly method to me. > >Any suggestions from anyone, on how I may perform the cross-site session >propagation? Wild Guess: Would setCookie('user_id', $PHPSESSID, 0, '/othersite.com'); let you get away with setting the cookies for the "other" site? Surely not, or you could wipe out other site's cookies, or worse, replace them with hacker data... But 5 minutes will tell you for sure... Hey, but all those stupid "Banner Ad" sites give me a cookie from the *other* guy's site. All ya gotta do is have three invisible GIFs on all three sites that come from the *other* sites and the GIF does the set_cookie() of whatever their user ID is. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time to Calculate Time
>i have variables $Start, $End each with a timestamp 2 hours apart >(2002070714, 2002070716) respectively 01234567890123 > >How do i calculate those to timestamps to get the answer 2? > >I've tried working them into unix timestamps and then calculating but no >luck... > >any one got any ideas ?? I'm guessing these are coming from MySQL... If so, you can subtract the two in MySQL much easier/faster than PHP... http://mysql.com/ If not: $s = mktime(substr($Start, 8, 2), substr($Start, 10, 2), substr($Start, 12, 2), substr($Start, 4, 2), substr($Start, 6, 2), substr($Start, 0, 4)); $e = mktime(substr($End, 8, 2), substr($End, 10, 2), substr($End, 12, 2), substr($End, 4, 2), substr($End, 6, 2), substr($End, 0, 4)); $delta = $e - $s; At this point, it boils down to the question -- Will it ever be, like, *DAYS* instead of hours, or, more importantly, *MONTHS*? Because as soon as you get into "months" or larger time units, it gets complicated... Until then, you can divide by 60, or 60*60, or 60*60*24 to get the number of minutes, hours, days respectively... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Script Speed
>but I am wondering if it is at the cost of a slower page loading. The reason >I think this is whenever I would like to display a variable I have to put in >a script tag like . I might have as many as 20 of >these on a page. Every time doesn't PHP have to start again and parse out >this information causing it to be really slow? PHP is already started, and going, and reading your HTML. It only has to notice when you have http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mbstring: Japanese conversion not working for me
ðÒÉ×ÅÔ! Jean-Christian Imbeault wrote: > I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much > for a nice idea quick hack to displaying multiple charsets at once. They should. I checked out w3c.org at that and it definitely should. No exception for japanese mentioned anywhere. The two parameters actually open a local exception from the headers. And SPAN sections can be nested. At least, so the standard goes. Besides, while checking the docs I stepped onto something really funny (to say the very least). I quote from http://www.htmlcompendium.org/attributes-list/attributes-notes/lang.htm --- The argument to the "lang=" attribute is made up of two parts; a primary code and an optional subcode (separated by a "-" hyphen). The primary code is a two character language code. i.e. The subcode is "understood to be a (ISO 3166) country code". However, W3C also gives several examples: They also propose a method of handling such "artificial languages" as Elfish and Klingon. For such languages they propose the primary code of "x" - Now I hope I shall never manage a porting to a Klingon repository LOLOL Anyway, if you do not need it for your application but just for a debugging procedure you can just forget about it :) ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ× @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Browser Troubles...
There is rather a lot to check... i have checked *most* of it... the only JS is to open a pop-up window, but that functions correctly... In one particular version of IE it fails even to submit the login form ;\ Works perfectly in Mozzilla/NN(4->6)... also fine in IE 6, and as I mentiond most IE5.0 except a handfull... but I obviously cant let the client view it as I am unsure what browser they will use... > -Original Message- > From: René Moonen [mailto:[EMAIL PROTECTED]] > Sent: 09 July 2002 11:05 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] Browser Troubles... > > > > > >Now... on certain browser platforms the browser spuriously > dies for no reason. (Primarily Oldish IE 5.0(but not all > releases) and 5.5). > > > >Has anyone came accross this kind of thing before? > > > > > > > > > What? M$ software crashing? Na... never seen that ;-) > > sorry... coudn't help that! > > What output do you produce with your PHP script? Is it plain > HTML, does > it include Javascripts or some our scripts? Did you check the > HTML code > of the output? Does it contain invalid tags or missing end tags? > > > René > > > > > > > > -- > 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] PHP Image Functions
Well, you're halfway there... You just have to separate the image-script from the rest like this: image_spewing_script.php: and in the other file (your actual page): Regards Joakim Andersson > -Original Message- > From: Mark Colvin [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 11:27 AM > To: Php (E-mail) > Subject: [PHP] PHP Image Functions > > > I have a directory of jpegs that I want to display thumbnails > of and have a > link to the original jpeg. I would rather not create separate > thumbnails > images preferring to create them in memory to display them. I > have installed > GD v.1.8.4. The code below outputs jumbled text to the > browser (possibly the > jpeg stream?). Code is as follows: > > Why will this not work? > > > > This e-mail is intended for the recipient only and > may contain confidential information. If you are > not the intended recipient then you should reply > to the sender and take no further ation based > upon the content of the message. > Internet e-mails are not necessarily secure and > CCM Limited does not accept any responsibility > for changes made to this message. > Although checks have been made to ensure this > message and any attchments are free from viruses > the recipient should ensure that this is the case. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bug in SQL can you help?
Here is my SQL(used in a PHP script so this isn't ot) SELECT extract(year FROM time), extract(month FROM time), count(*) as monthly_views, time FROM tececo_stats group by extract(year FROM time), extract(month FROM time) order by monthly_views desc limit 1 the problem is that is counts the number of rows in the whole thing not the echoed row. How can I get it count the best days only? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Editing Word Documents
The only way I see this can be done is simly let every user mount a share under the same letter, all you need to do then is file, then locking files is up to samba or windows server. Marek Richard Lynch wrote: >>I have an intranet, which provides access to, amongst others, Word >>Documents about policies, etc. What the guys are looking for is a way to >>do the following: >> >>1. Show a list of files available for editing >>2. If a file is clicked, then it is locked for other users (no access) >>3. The file opens on the client's machine >>4. The client edits it >>5. The client then closes the file, it "auto-saves" and he goes about >>his business. >> >>Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5) >>have me lost. >> >>How do you get a file to be edited, and then automatically returned to >>the server by M$ Word in it's changed format. Is this possible? >> >>How would this change in a database-backended system (including the >>files as BLOBs)? >> >> > >They'd have to be "uploaded" *SOMEHOW*... > >If the employees can't do that "by hand", then perhaps some kind of >"scheduled" task on the Win boxes could be programmed to do it. > >Don't forget to *UNLOCK* after a successful upload, but not when, not if, >when, the upload fails. > >There's simply NO WAY the server can reach out and suck in a file of its own >volitoin... Major privacy/security problem there. > >You *COULD* also install Apache + PHP on every desktop, and have them >serving up their edited Word files to the Intranet, and then PHP could use >HTTP to suck them back in... > >But that's probably not gonna fly for non-technical reasons. Well, not >counting really bad Security as a "technical" reason. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Somehone having a problem to write to the list
To the *list* *maintainers*: this guy says he is registered but cannot write to the list. So he wrote me in instead. úÄÒÁ×Ï! (it's like that, right?) Djurovski Dejan wrote: > $aDBLink=@mysql_connect("$host", "$user", "$password"); > mysql_select_db("$db", $aDBLink); you might want to take the @ sign off the connection step to get the error message. Looks like you did not connect at all but got no warning because you told your function to keep shut. At that point you cannot query anything, but you cannot know about it. ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ× @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bug in SQL can you help?
On Tuesday 09 July 2002 18:32, JJ Harrison wrote: > Here is my SQL(used in a PHP script so this isn't ot) Aside from the fact that this has _nothing_ to do with php, you would most likely get a better response from the php-db list where, hopefully, the sql experts hangout. > SELECT > extract(year FROM time), > extract(month FROM time), > count(*) as monthly_views, > time [snip] -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Philadelphia is not dull -- it just seems so because it is next to exciting Camden, New Jersey. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Image Functions
Thanks for your reply. Its a bit further forward but still not working. I have split the files and the output now shows the text part of 'img alt="text" src="...' ie it won't recognise the image. Anything else you can think of? This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending data in table, multiple rows, via mail()
Thank you for your *extreme* kindness... I do not know where to begin to make this happen. I created a variable and ran the entire do while loop to read contents of the table and tried storing them in the variable, which could be used as Content of the mail. However, i just get the Last Row in my DB Table sent in mail.. not all the rows. Following is part of the code i'm using, and it could be absolutely wrong, but that's all i know.. $myrow[nm] $myrow[q] } while ($myrow = mysql_fetch_array($result)); } "; $to = "[EMAIL PROTECTED]"; $subject = "Purchase order Website"; $from = "Purchase Order"; $stuff = " Name : $name\n Phone : $phone\n Fax : $fax\n Email : $email\n Address : $address\n Country : $country\n Order:\n\n $realcontent\n\n"; mail($to,$subject,$stuff,$from); ?> __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: qmail with perl and php
try to specify the sender with -f: mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"," From: [EMAIL PROTECTED]" , [EMAIL PROTECTED]); > > - Original Message - > From: "Jeff MacDonald" <[EMAIL PROTECTED]> > To: "Qmail" <[EMAIL PROTECTED]> > Sent: Thursday, August 08, 2002 8:05 AM > Subject: qmail with perl and php > > > > Hi > > > > I've installed qmail with vopmail, it works the way i want it, however > > > > php does not want to send mail [i've made the change re qmail-inject in > > php.ini] > > > > as well Mail::Mailer with perl does not work. > > > > This is on FreeBSD, i've symlinked /usr/sbin/sendmail to > > /var/qmail/bin/sendmail > > as well > > > > any insight would be REALLY appreciated. > > > > > > Thanks. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Image Functions
imagejpeg($thumbnail,'test.jpg',$quality); should of course be imagejpeg($thumbnail,'',$quality); Otherwise you are creating a new image on your server and not outputting it to the browser. /Joakim > -Original Message- > From: Mark Colvin [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 12:30 PM > To: [EMAIL PROTECTED] > Cc: Php (E-mail) > Subject: RE: [PHP] PHP Image Functions > > > Thanks for your reply. Its a bit further forward but still > not working. I > have split the files and the output now shows the text part of 'img > alt="text" src="...' ie it won't recognise the image. > Anything else you can > think of? > > > > > This e-mail is intended for the recipient only and > may contain confidential information. If you are > not the intended recipient then you should reply > to the sender and take no further ation based > upon the content of the message. > Internet e-mails are not necessarily secure and > CCM Limited does not accept any responsibility > for changes made to this message. > Although checks have been made to ensure this > message and any attchments are free from viruses > the recipient should ensure that this is the case. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Image Functions
That's the winner!! Everything working good now. Thanks again. This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submitting form in new window!
Thomas, If using JavaScript to open the window, then php is not going to be able to transfer variables as it is not being used. As you form is not being submitted (you intercepted it with a JavaScript call, right?) then you need to transfer them manually by getting the JavaScript to add the variables to the end of the url as GET data. If I have this wrong (and I've had to make some assumptions) then please show us some code. HTH Chris Thomas Edison Jr. wrote: >Hi, > >When i press the Submit button, i would like it to >open in a new Javascript Windows with well-defined >characteristics like size, width etc. > >I create a window.open function and gave the name of >my PHP page .. but the Form Variables are not passing >into it.. > >Thanks, >T. Edison Jr. > > > >= >Rahul S. Johari (Director) >** >Abraxas Technologies Inc. >Homepage : http://www.abraxastech.com >Email : [EMAIL PROTECTED] >Tel : 91-4546512/4522124 >*** > >__ >Do You Yahoo!? >Sign up for SBC Yahoo! Dial - First Month Free >http://sbc.yahoo.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Editing Word Documents
I think what the OP meant (certainly what I meant), is that the Word doc is accessed from a normal link. Clients use windows and the browser has the .doc mime type set and spawns Word. The user edits it. I had (vainly) hoped for a way of setting the "File..Save As" to trigger PHP's File Upload facility. Has anyone had this need, found a way around it or found it not possible? Thanks for the WebDAV pointer. I shall certainly be looking into that but I had hoped for a simpler way compatible with existing windows versions. Longer term it looks the right way to go. Thanks Chris Kevin Stone wrote: >Of course you can open and edit any file in PHP you just need to know the >file format. But I highly doubt there is any method using PHP that will >allow you to prompt the opening of a file into an external application. >Editing of the file would have to be done in memory, or manually in the >browser (HTML form, textarea field). Unfortunately Microsoft is notoriously >protective of its file formats. >-Kevin > >- Original Message - >From: "Chris Hewitt" <[EMAIL PROTECTED]> >To: "David Russell" <[EMAIL PROTECTED]> >Cc: "php-general" <[EMAIL PROTECTED]> >Sent: Monday, July 08, 2002 11:51 AM >Subject: Re: [PHP] Editing Word Documents > > >>David Russell wrote: >> >>>snip-- >>>5. The client then closes the file, it "auto-saves" and he goes about >>>his business. >>> >>By coincidence, I'd be very interested in this too, particularly from a >>linux server. >> >>Regards >> >>Chris >> >> >>-- >>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] Sending data in table, multiple rows, via mail()
This bit looks kind of wierd. Don't know if it even should be possible to do like that... > $realcontent=" > > if ($myrow = mysql_fetch_array($result)) { > do { > > >$myrow[pid] >$myrow[nm] >$myrow[q] > > > } while ($myrow = mysql_fetch_array($result)); > } > > "; You might wanna do like this instead: $realcontent = ""; while ($myrow = mysql_fetch_array($result)) { $realcontent .= "$myrow['pid']"; $realcontent .= "$myrow['nm']"; $realcontent .= "$myrow['q']"; } Regards Joakim Andersson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submitting form in new window!
Hi, Ok, let me show some code : Quantity This is the SUBMIT button that submits the form alongwith the Form Variables to a file called "Add2Cart.php" !! But this file simply opens in an unadministered new window. i would like to use the window.open function, or whatever can accomplish this, to restrict parameters of the window in which add2cart.php opens, at the same time the variables of my form should get submitted into the add2cart.php T. Edison Jr. __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Editing Word Documents
Marek, Yes I thought about windows shares. On the internet (as opposed to intranet) the word "security" leapt to mind and I went away from the idea. Has anyone used Samba shares on the internet or know if its secure/insecure? Thanks Chris Marek Kilimajer wrote: > The only way I see this can be done is simly let every user mount a > share under the same letter, > all you need to do then is href="file:///X:/directory/file.doc">file, then locking files is up > to samba or windows server. > >Marek > > Richard Lynch wrote: > >>> I have an intranet, which provides access to, amongst others, Word >>> Documents about policies, etc. What the guys are looking for is a >>> way to do the following: >>> >>> 1. Show a list of files available for editing >>> 2. If a file is clicked, then it is locked for other users (no access) >>> 3. The file opens on the client's machine >>> 4. The client edits it >>> 5. The client then closes the file, it "auto-saves" and he goes >>> about his business. >>> >>> Points 1 through 3 are relatively trivial. Point 4 and 5 (especially >>> 5) have me lost. >>> >>> How do you get a file to be edited, and then automatically returned >>> to the server by M$ Word in it's changed format. Is this possible? >>> >>> How would this change in a database-backended system (including the >>> files as BLOBs)? >>> >> >> >> They'd have to be "uploaded" *SOMEHOW*... >> >> If the employees can't do that "by hand", then perhaps some kind of >> "scheduled" task on the Win boxes could be programmed to do it. >> >> Don't forget to *UNLOCK* after a successful upload, but not when, not >> if, >> when, the upload fails. >> >> There's simply NO WAY the server can reach out and suck in a file of >> its own >> volitoin... Major privacy/security problem there. >> >> You *COULD* also install Apache + PHP on every desktop, and have them >> serving up their edited Word files to the Intranet, and then PHP >> could use >> HTTP to suck them back in... >> >> But that's probably not gonna fly for non-technical reasons. Well, not >> counting really bad Security as a "technical" reason. >> >> >> > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Bug in SQL can you help?
> -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 12:33 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Bug in SQL can you help? > > > Here is my SQL(used in a PHP script so this isn't ot) PHP-script or not, it's still an SQL-query, right? I'll give it a shot anyway... > SELECT > extract(year FROM time), > extract(month FROM time), > count(*) as monthly_views, > time > FROM > tececo_stats > group by >extract(year FROM time), >extract(month FROM time) > order by >monthly_views desc > limit 1 > > the problem is that is counts the number of rows in the whole > thing not the > echoed row. How can I get it count the best days only? SELECT CONCAT(YEAR(time), MONTH(time)) AS my_period, MAX(COUNT(*)) AS monthly_views FROM tececo_stats GROUP BY my_period /Joakim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bug in SQL can you help?
Thanks "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Tuesday 09 July 2002 18:32, JJ Harrison wrote: > > Here is my SQL(used in a PHP script so this isn't ot) > > Aside from the fact that this has _nothing_ to do with php, you would most > likely get a better response from the php-db list where, hopefully, the sql > experts hangout. > > > SELECT > > extract(year FROM time), > > extract(month FROM time), > > count(*) as monthly_views, > > time > > [snip] > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Philadelphia is not dull -- it just seems so because it is next to > exciting Camden, New Jersey. > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sending data in table, multiple rows, via mail()
Hi, WOW... THANKS A LOT!! This actually did it .. i was on a slight wrong track.. > $realcontent = ""; > while ($myrow = mysql_fetch_array($result)) > { > $realcontent .= "$myrow['pid']"; > $realcontent .= "$myrow['nm']"; > $realcontent .= "$myrow['q']"; > } > Thanks, T. Edison Jr. __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Converting PCX to ...
I got a problem with that! I've written a batch file that sits in the same dir as the PHP script and when I exec it, it doesn't work! I've thouroghly thrashed the batch file for errors and it came up ok every time. if I echo the exec it only returns the first line of the batch file. Anyone? "Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > >I'm writing a reporting system and I have a problem. > > > >I need to insert PCXs into a PDF (using PDFLib), but it doesn't support > >PCXs. > > > >So, to get round the problem, I need to convert the PCXs to JPGs or GIFs > > > >Does anyone know of a piece of PHP that can do this inline, (by that I mean, > >can be called and run in PHP script), because the images will have additions > >and modifications on a regular basis; and they come as PCXs. > > I think you will be stuck with using http://php.net/exec to run some > external process to convert them. > > Image Magik seems to convert almost every format known to man... > > -- > Like Music? http://l-i-e.com/artists.htm > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: getting the IP address off a visitor
Despite all downfalls of using IP addresses, if you are in North America most people in a University or business environment use a fast connection (DSL or Cable) you may choose to use the following chunk of code to retrieve someone's IP number if (getenv(HTTP_X_FORWARDED_FOR)){ $ip=getenv(HTTP_X_FORWARDED_FOR); } else { $someones = getenv(REMOTE_ADDR); } // From Klemens Karssen's code from www.php.net Alternatively use Cookies which are easy to use (check the cookie function on www.php.net Cookies and Sessions from my understanding of earlier discussions in this forum might be a wiser idea... Spike.. "Sebastian Marcu" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi there, > > I am new to PHP and need some help. > I was wondering if there is a way to get hold of the IP address of a site > visitor with PHP. I'm trying to develop an interaction where the server > would recognise a new visitor from a returning visitor via the IP address. > > Regards, > > > Sebastian > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Converting PCX to ...
[snip] I've written a batch file that sits in the same dir as the PHP script and when I exec it, it doesn't work! I've thouroghly thrashed the batch file for errors and it came up ok every time. if I echo the exec it only returns the first line of the batch file. [/snip] I have found that even though the batch, shell, or other procedural call in an exec(), system(), sits in the same directory as the PHP script you must include the /full/path/to/the/script in order for it to work properly. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mbstring: php.ini: need help understanding some settings/functions
I am trying to use the mbstring library so I can receive user input in japanese and then put it into my pgsql DB. But the documentation is really sparse and sometimes confusing. I can't understand some of the functions provided by mbstring or it's settings in php.ini. Some functions/settings don't seem to do what they say or the explanation of how to use them is missing. For example I tought internal_encoding was used along with --enable-mbstring-enc-trans so that any input would be automatically converted to the internal encoding. But it is isn't. When I check what charset POST data is in it is always in the charset the user used, never in the internal_encoding charset. I have to manually convert myself using mbstring functions. I guess I don't understand what the settings of mbstring in php.ini and at compile time really do. Can someone explain to me what is the use of: --enable-mbstring-enc-trans at compile time mb_http_input() mb_http_output() mb_internal_encoding() mb_language() mb_output_handler() Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Print Question
I wasn't in the office hence haven't visited this group for a while... Here's an idea though I still may not understand the whole situation but from what I think it is here goes: I guess you will have to mix javascript and php in the following manner... use onclick for a particular HTML variable and create a function in Java Script that runs when you click this and returns true or writes to an HTML variable say input type= hidden name=hasClicked value=false... the HTML value will give this hidden variable the value true when clicked otherwise it will be defaulted at false... You can use document.write.formName.hasClicked.value = true... Then continue with: if($hasClicked == "true") Run the Script... This will mean your script won't run until OK is pressed... I hope this helps and I hope its not too late... Spike... "Chris Kay" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... Question I have is I want to run a print job of 200+ invoices I have a javascript code to open a print dialog box and Then go to next invoice and do the loop.. Problem I am having is that I want it to pause if the ok button on the dialog Box is not pressed.. When I run the script it fly's throught and brings up a heap of printer Dialog boxes which causes me to ctrl+alt+del... Anyway or pausing the script untill ok is pressed? Thanks in advance.. --- Chris Kay Technical Support - Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for Business --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Editing Word Documents
If you can use virtual private network, it is secure. But I don't know about plain Samba solution. Chris Hewitt wrote: > Marek, > > Yes I thought about windows shares. On the internet (as opposed to > intranet) the word "security" leapt to mind and I went away from the > idea. Has anyone used Samba shares on the internet or know if its > secure/insecure? > > Thanks > > Chris > > Marek Kilimajer wrote: > >> The only way I see this can be done is simly let every user mount a >> share under the same letter, >> all you need to do then is > href="file:///X:/directory/file.doc">file, then locking files is up >> to samba or windows server. >> >>Marek >> >> Richard Lynch wrote: >> I have an intranet, which provides access to, amongst others, Word Documents about policies, etc. What the guys are looking for is a way to do the following: 1. Show a list of files available for editing 2. If a file is clicked, then it is locked for other users (no access) 3. The file opens on the client's machine 4. The client edits it 5. The client then closes the file, it "auto-saves" and he goes about his business. Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5) have me lost. How do you get a file to be edited, and then automatically returned to the server by M$ Word in it's changed format. Is this possible? How would this change in a database-backended system (including the files as BLOBs)? >>> >>> >>> >>> They'd have to be "uploaded" *SOMEHOW*... >>> >>> If the employees can't do that "by hand", then perhaps some kind of >>> "scheduled" task on the Win boxes could be programmed to do it. >>> >>> Don't forget to *UNLOCK* after a successful upload, but not when, >>> not if, >>> when, the upload fails. >>> >>> There's simply NO WAY the server can reach out and suck in a file of >>> its own >>> volitoin... Major privacy/security problem there. >>> >>> You *COULD* also install Apache + PHP on every desktop, and have them >>> serving up their edited Word files to the Intranet, and then PHP >>> could use >>> HTTP to suck them back in... >>> >>> But that's probably not gonna fly for non-technical reasons. Well, not >>> counting really bad Security as a "technical" reason. >>> >>> >>> >> >> >> > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submitting form in new window!
On Tuesday 09 July 2002 19:25, Thomas Edison Jr. wrote: > Hi, > > Ok, let me show some code : > >method=post target=\"blank\"> > > $result[vProID] > > $result[vProName] > >Quantity > type=\"submit\" value=\"Add To Cart\"> > > > This is the SUBMIT button that submits the form > alongwith the Form Variables to a file called > "Add2Cart.php" !! But this file simply opens in an > unadministered new window. > > i would like to use the window.open function, or > whatever can accomplish this, to restrict parameters > of the window in which add2cart.php opens, at the same > time the variables of my form should get submitted > into the add2cart.php Attach a javascript event to the submit button such that on submit opens up a window with your required specs. Then set the url of that window to point to add2cart.php, and also attach the form values to the url. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* People need good lies. There are too many bad ones. -- Bokonon, "Cat's Cradle" by Kurt Vonnegut, Jr. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Executing Script through image
I am making a stats program. When the nessicary include file is included it does a reverse-DNS lookup to find the remote host's DNS name. The problem with this is that is seems slow(at least on my test server with a DSL connection). I thought the best way to speed things up would be putting the entire script into a file and then using within the page. The problem is that I don't know how to output the image with PHP. The image would not be dynamic just a file on the server. I would appreciate peoples comments or other suggestions JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Executing Script through image
$filename = "your/file.gif"; header("Content-Type: image/gif"); header("Content-length:".filesize($filename)); $fn=fopen($filename,"rb"); while(!feof($fn)) { echo fread($fn, 4096); } in fopen( , ""); the b denotes to read as binary and is only nessecary on a windows system "Jj Harrison" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am making a stats program. > > When the nessicary include file is included it does a reverse-DNS lookup to > find the remote host's DNS name. The problem with this is that is seems > slow(at least on my test server with a DSL connection). I thought the best > way to speed things up would be putting the entire script into a file and > then using within the page. The problem is that I > don't know how to output the image with PHP. > > The image would not be dynamic just a file on the server. > > I would appreciate peoples comments or other suggestions > > JJ Harrison > [EMAIL PROTECTED] > www.tececo.com > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I am out of pleases now get me off this fuckin list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[PHP] Re: newbie: a couple basic questions
Thank you kindly ... "Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > >1) in a fuction, does a return statment automatically exit the function as > >well? > > Yes. Nothing more will get executed inside the function after the "return;" > > Some purists claim that you should *NEVER* have a return *ANYWHERE* except > the last line of a function. > > EG: > > # WRONG > function divide($numerator, $denominator){ > if ($denomiator == 0){ > return ''; > } > else{ > return $numerator/$denominator; > } > } > > # RIGHT > function divide($numerator, $denominator){ > $result = ''; > if ($denominator == 0){ > $result = ''; > } > else{ > $result = $numerator/$denominator; > } > return $result; > } > > It probably seems "silly" here, but when your functions get to be three or > four screenfuls long, a "return" you aren't seeing on the monitor can > frequently get you very confused, very fast. > > > >2) can someone give me a better explination of $HTTP_POST_VARS > > If you give somebody an HTML FORM (like those forms you fill out on-line), > after they fill it out, the PHP page that *proccess* the FORM page will find > all the data in an array named $HTTP_POST_VARS. > > Actually, it got renamed to $_POST recently. (The old one will still work > for a while, but convert ASAP). > > Sample HTML: > > > > > > Sample PHP: > (note the filename must match the ACTION= part above) > >echo "Searchkey is ", $_POST['searchkey'], "\n"; > echo "search button was clicked: ", isset($_POST['search']), "\n"; > ?> > > You could even not "know" what fields are in the FORM, and just output all > of them: > > (this would be a "replacement" process.php file) >while (list($variable, $value) = each($_POST)){ > echo "$variable is $value\n"; > } > ?> > > -- > Like Music? http://l-i-e.com/artists.htm > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I am out of pleases now get me off this fuckin list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Maybe everybody should send him a copy then he'll get the message? Maybe To remove your address from the list, just send a message to the address in the ``List-Unsubscribe'' header of any list message. If you haven't changed addresses since subscribing, you can also send a message to: <[EMAIL PROTECTED]> or for the digest to: <[EMAIL PROTECTED]> For addition or removal of addresses, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction. - Original Message - From: "Erik Hegreberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 09, 2002 2:15 PM Subject: [PHP] I am out of pleases now get me off this fuckin list ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] another php_functions.c compile problem
HI, I just joined the list - reviewed the archives, and found that Chip Weigand (2002-07-05) entered a problem with php_functions.c in the ~/php-4.2.1/sapi/apache2filter directory. I have a similar situation - my error: php_functions.c:93:27: missing binary operator before '!' make[3]: *** [php_functions.lo] Error 1 Same line as Chip's compile failure. I'm running gcc 3.0.4 under Solaris 8. I'm not sure if this is a gcc issue or just the syntax of line 93 in php_functions.c. Has anyone else had a problem with this in compiling php4.2.1? Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Server does somethingwierd
Whenn i acces a page then there will automatichly be a phpsesion id created but i dont have got any key pressed or used sersion start in the code. i just wanne login to my page wich the page sets a cookie in my browser but this doest work because the cookies does not be created in my browser www.bos.hn.org(to see it your self) please reply thx -AcIDeR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php loopholes
Hi every1, i am currently undertaking some research into PHP security and its flaws / loopholes etc. What i am looking for is information on any aspects of PHP that can be hacked or cracked and how developers have got around these problems. Any help would b much appreciated Thanks - Relive the FIFA World Cup goals with exclusive video highlights! http://fifaworldcup.yahoo.com/fc/en
Re: [PHP] I am out of pleases now get me off this fun list!
My favorite part is that he requests a read receipt for every one of these messages. I hope everyone is sending him one of those, too, to clutter up his email even more. ---John Holmes... - Original Message - From: "Zac Hillier" <[EMAIL PROTECTED]> To: "Erik Hegreberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, July 09, 2002 9:16 AM Subject: Re: [PHP] I am out of pleases now get me off this fuckin list !!! > Maybe everybody should send him a copy then he'll get the message? > Maybe > > > To remove your address from the list, just send a message to > the address in the ``List-Unsubscribe'' header of any list > message. If you haven't changed addresses since subscribing, > you can also send a message to: ><[EMAIL PROTECTED]> > > or for the digest to: ><[EMAIL PROTECTED]> > > For addition or removal of addresses, I'll send a confirmation > message to that address. When you receive it, simply reply to it > to complete the transaction. > > > > - Original Message - > From: "Erik Hegreberg" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 09, 2002 2:15 PM > Subject: [PHP] I am out of pleases now get me off this fuckin > list > > ! > > > > > > -- > 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] newbie: question about question marks
How bout the question marks in the following line of php generated html: what do they mean? "Miguel Cruz" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sun, 7 Jul 2002, Alexander Ross wrote: > > Can someone explain to me what the ? does. I have a vague idea of what > > it means in a URL (please cearify that) but I haven't the slightest what > > it means in php code. Thanks for your help > > Read about the ternary operator at: > > http://www.php.net/manual/en/language.operators.comparison.php > > miguel > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing an array in mysql - what's the best data type?
Kevin, >> I have an array that I want to store in a field of a mysql db. I've got >> it set as type text currently, but when I retrieve it, I can't get the >> arrary to parse. >> >> If I look at the listings in the mysql cli, it just says "Array" for >> that field. >> >> Here's my retrieval code: >> >> $storyid = $_REQUEST['storyid']; >> >> $db = mysql_connect("localhost", "user", "pass") or die ("Could Not >> connect to db."); >> mysql_select_db("storiestest", $db) or die("Could not select >> database."); >> $query = "SELECT * FROM ADGstories WHERE (storyid='$storyid')"; >> $results = mysql_query($query, $db); >> $num_results = mysql_num_rows($results); >> >> for ($i=0; $i < $num_results; $i++) >> { >> $row = mysql_fetch_array($results); >> while ($element = each($row)) >> { >> echo $element["key"]; >> echo ": "; >> echo $element["value"]; >> echo "\n"; >> >> $varname = $element["key"]; >> $$varname = $element["value"]; >> } >> >> echo "$headline\n >> $byline\n"; >> >> // just as a test, not looping through the array. Loop code not >> included. >> echo "$bodycopy[0]\n"; >> } >> >> Even with the version at the end there, I get "A" echoed to the screen. >> >> If I try a print_r($bodycopy), it says "Array". >> >> Where did I screw up? > You can store arrays as strings with.. > > $str = serialize($ary); > > .. and turn a serialized string back into an array with.. > > $ary = unserialize($str); > > The string can be stored in either a TEXT or TINYTEXT field. Is this > what > you wanted to know? Yes. That worked. > I had trouble following your code after the for loop. > $headline, $byline and $bodycopy are variable names stored in the > database? Yes. Sorry about that. I should have explained what those variables were. In any case, your solution worked for me. thanks! Steven -- Steven Jarvis Web Publishing Manager/Web Developer NWAnews.com: Arkansas Democrat-Gazette, Northwest Edition Northwest Arkansas Times Benton County Daily Record -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php