Re: [PHP] svg graphics and php : is it possible
Perhaps this relates to the original question as an additional feature. What would be the best way to offer SVG content from the main opening page? Since SVG requires a browser that has the approprite plugin or a dedicated browser, is it better to create a hyperlink or maybe have the SVG capability detected and content redirected automatically. Another question. What is the best and lightest way to offer SVG content from the server side? Java seems real slow and resource hungry at sites I visit that use it. On Wed, Jul 03, 2002 at 12:39:21PM +1000, Justin French wrote: > If you output the right headers, then output the file (by either passing > thru an existing file or "building" a file), then it should work > although I have no experience with exactly what you want -- only with MP3s, > images, etc. > > Justin French > > > on 01/07/02 7:52 PM, Herve le Martret ([EMAIL PROTECTED]) wrote: > > > Hello, > > > > I am interested in creating svg graphics with php like creating a image with > > gd. > > I tried a PHP script with : > > > > header ("Content-type: image/xml+svg"); > > > > but I don't know how to output correctly svg lines. > > > > It is not possible to ouput svg lines with the print command and a command > > like > > "imagesvg($im);" does'nt exit. > > -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: synchronizing php functions
Well I have a system that people can login to, and I want to produce an array (or something of the sort) that holds who is logged in so that I can monitor it. The problem is that sessions are local to the clients machine so if I tried to put this information in the session then the only information that I would get back is the people that are logged in on my machine, not the server (Please tell me if I wrong in what I say here). Therefore I need to be able to but this information in the session and have it available to all sessions (sort of like the way static variables in Java belong to the class and not the individual objects that are created from that class). So if you undersatnd what I'm trying to do here and know of a way to do it I would love to here it. On Tue, 02 Jul 2002 18:45:40 -0500 [EMAIL PROTECTED] (Richard Lynch) wrote: > >Does anyone know anyway to synchronize calls to php functions. > >I was thinking of writting a hack that uses a lock file on the server put > >if there is a proper way to do it then I would > >rather use that. > >Any suggestions would be good. > > Shared memory may be faster than lock files... > > *WHY* you think you need synched PHP functions might be an interesting > discussion, though if it's just for fun, have at it. > > -- > Like Music? http://l-i-e.com/artists.htm > |---| Philip MacIver |---| | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOCUMENT_ROOT disappeared on me!
David E. Weekly wrote: >>IMHO you're better off > > I agree and understand why, but... > >>but yes, if you set register_globals = on then >>you shouldn't need to have retooled your scripts. > > I agree. =) > >>Did you restart your >>webserver after you adjusted php.ini? > > Yes. Full stop/start cycle. And you're sure to be out of any caching? regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FW: Help please!
Hi, Maybe you can do something like this (if you have access to GD on the server): /Joakim > -Original Message- > From: Steve Vernon [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 02, 2002 9:43 PM > To: [EMAIL PROTECTED] > Subject: [PHP] FW: Help please! > > > Hello, > I have a PHP script which gets data from a MySQL database and > returns an image. So returns the image of > id 3 from the database. What I really want is to state width > is 100 and > height is 100 for example so I do not have to downlaod the entire > picture and specify the width and height as part of the image: > > Do not want > > > WHat I want > > > WHich will be a lot quicker on the client side. > > I cannot make a permanent file to use when I get the information > from the PHP database due to server security, only a tmpfile which the > data can then be placed. But to use the image functions you need to > specify a filename. THere does not seem to be a way to get > the filename > of a file pointer so how do I do it please? > > I have asked the ISP to give me permissions to create files int > he server directory but they will not let me. > > Thanks you! > > Steve > > > -- > 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] $this in an XML data handler ... in a class
Here's a brain-bender ... At least it is for me at the moment. : ) When I use an XML parser inside a class, the xml_*_handler functions aren't recognizing "$this->" variables. I can kind of see why ... But would like it to work anyway. : ) Here's an example: class Blah { var $xmlparser; var $current_element; // ... function _parseXML($data) { $this->xmlparser = xml_parser_create(); xml_set_element_handler( $this->xmlparser, array($this,"_xml_start_element"), array($this,"_xml_end_element")); xml_set_character_data_handler( $this->xmlparser, array($this,"_xml_character_data")); xml_parse($this->xmlparser, $data); xml_parser_free($this->xmlparser); } function _xml_start_element($p, $e_name, $e_attributes) { $this->current_element = $e_name; } function _xml_end_element($p, $e_name) { // ... } function _xml_character_data($p, $data) { echo "element is: ".$this->current_element."\n"; echo "data is: $data\n"; } } // end of class Blah When this XML parser gets called from within the Blah class, the "element is:" portion of _xml_character_data comes out blank! This sort of makes sense, because the callback functions are "children" of the xml_parser_create "parent" ... But should that make the children ignorant of the "grandparent" variables referred to by $this->varname? I hope this makes sense ... Has anyone else encountered this sort of problem? I'm an old hat at PHP, but am relatively new to both XML parsing and writing my own classes. Thanks, Clay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Installation de PHP 4.2.1 with Apache and extension Frontpage 2002
Hello, I've recently installed Mandrake v 8.1 on my computer and then successfully compiled and installed PostgreSQL and Apache 1.3.24 and PHP 4.2.1... All that works well... When I installed Frontpage 2002 extensions on the same computer, PhP didn't work any more. I then tried to compile again php with "make clean"; but same result PhP isn't working I then tried to make a "/configure --with-apxs=/usr/local/apache/bin/apxs --with-pgsql=/usr/local/pgsql dans php" and the following error appeared : Sorry, I was not able to successfully run APXS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Program executing in PHP. Please help
Hello php-general, Dear php list, I've got completely lost in program execution under php. I need to run a command grab it's output for the next processing, So I wrote a script: "; echo $kick_my_ass; echo ""; ?> And I get nothing :(. Script like below: "; echo $kick_my_ass; echo ""; ?> Work fine outputting me command line parameters. What have I done wrong? -- Best regards, Latex mailto:[EMAIL PROTECTED] BTW: PHP not running SAFE MODE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Submitting Form Data
I have a php script that performs a query and then dynamically builds a section of a page for every row returned. Each section has some fields and three submit buttons. My problem is this. If I make a change to one particular section, how can I submit the form passing only the relevant section data? 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] PHP and COM - Excel
I am trying to create a Pivot Table with PHP's COM functions. I managed to get the data and charts functions going but the pivot table is tricky. Anyone that managed it before? I am looking for examples, plz. Tx MH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem With ora_do
I'm having a weird problem with ora_do. It works fine as long as I don't have a "WHERE" clause in the query. For example: select * from table_name works just fine but select * from table_name where col_name = value returns nothing. However, if I use ora_open, ora_parse and ora_exec everything works fine. I'm running on Compaq Tru64 ver 5.1. I compiled PHP with gcc 3.1. I'm not getting any errors or warnings and nothing is being logged in the Apache logs. I guess it's not a big deal since I have been able to work around it, but it would be nice to know what the problem is. Thanks, Dean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I split an alphabetical list (array) into A-M and N-Z?
Anyone have a function that will take an alphabetical list of names (in an array already) and split it into two 'chunks' (arrays) A-M and N-Z? So, let's say I have: Abby Road BobbyCraft Darren's doodads Farenheit 456 generic name MyCom.com Ninety Nine NoCo O U 1 O'reilly Publishing Oracle PSI Test Company I want to end up with one array/chunk that has (A-M): Abby Road BobbyCraft Darren's doodads Farenheit 456 generic name MyCom.com And the other that contains (N-Z): Ninety Nine NoCo O U 1 O'reilly Publishing Oracle PSI Test Company -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple Example of Passing on a file through a PHP script
I want to show info when my docs are viewed though my stats program. I have decieded the best way would be to put the info into a DB through php file then output the PDF, Excel, Zip or Powerpoint file. Only trouble is I have no Idea how to do this -- 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] Displaying the table records along with check boxes.
Hi friend, I would like to display the table records along with check boxes for the purpose of selecting particular records or select all and for deleteing them or for other purpose. Anybody have ready made code for this type... Any help would be greatly appreciated. Thanks and Regards Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stock Prices
Hi all How would I get recent stock prices in a page? I obviously need to get this from some source. I am looking for local (South African) and international share prices for a portal-type system. What I will probably do (for the sake of speed) is have a cron job periodically fetch the relevant prices, and put them in a database. This will then be displayed from the database (I know - delayed stock prices are ok) What I am really after is a method of getting share prices from the net. I have no idea about how to go about doing this - where to get them from, etc. Please help... Thanks David R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying the table records along with check boxes.
The code to create a check box is: HTH, ---John Holmes... PS: It might help if you actually try to do something yourself and then ask a question. We're not here to feed you code. Anyways, a way you might approach it is to name all of your checkboxes the same, something like Where $id is a unique identifier for the row/field/etc... Then, you simply use some code like this to delete all of the rows where the box was checked. HTHSM, ---John Holmes... - Original Message - From: "Balaji Ankem" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 8:05 AM Subject: [PHP] Displaying the table records along with check boxes. > Hi friend, > I would like to display the table records along with check boxes for > the purpose of > selecting particular records or select all and for deleteing them or > for other purpose. > > Anybody have ready made code for this type... > > Any help would be greatly appreciated. > > Thanks and Regards > Balaji > > > -- > 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] Submitting Form Data
Put a form around each section, so only the data in the form will be submitted. You can have more than one form on a page, and only the form containing the submit button that's pressed will be sent, the others will be ignored/dropped/whatever... ---John Holmes... - Original Message - From: "Mark Colvin" <[EMAIL PROTECTED]> To: "Php (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 6:58 AM Subject: [PHP] Submitting Form Data > I have a php script that performs a query and then dynamically builds a > section of a page for every row returned. Each section has some fields and > three submit buttons. My problem is this. If I make a change to one > particular section, how can I submit the form passing only the relevant > section data? > > > > 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] revecom + php
Hi again, php gurus! Does anyone of you have any experience working with revecom rfom php script? Will be grateful for any comments and links to articles of the subject -- Sincerely, val petruchek http://val.zp.ua -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting a cookie and redirecting
> No, it just happens to have sent them in the order his browser liked. > > ASP can't do anything "different" from PHP. > > I used to laugh when ASPers asked why PHP had to do all this extra stuff > with cookies and stuff to do sessions. Sigh. :-) > > Some browsers will process the headers in one order, others in the reverse. > > Some will see the Location: and ignore the rest. > > You can't do both and support all browsers. Actually Richard, I'll have to disagree. I replied to Chris Shiflett privately but perhaps I should cc my reply to the group (it is rather lengthy & I hate cluttering mailboxes). The long and the short of it is that, after analysing the data returned to the browser from both ASP and PHP, there is a difference. Essentially, the redirect headers are identical (including the status code), but ASP appends the rest of the header including the "Set-Cookie" header and the Cache requirements. While some of this data is no doubt redundant it allows the the browser to process the cookie correctly. I tested this on numerous different browsers (IE, Netscape, Opera, Mozilla and NeoPlanet) and in all cases without exception, the ASP script worked and the PHP didn't. Unless returning all the headers as ASP does totally deviates from the HTML protocol specification, why not make PHP a more well-rounded product and include this functionality? Just because using "goto" is bad programming practice and should be avoided (like the plague!), it has stopped it being included in most decent languages... > Re-design and re-factor your code so you don't need to re-direct. :-) Please understand that I am not defending ASP in any way - I am merely pointing out that there *is* a difference in the way that the two languages process the pages. Frankly, I believe that ASP is very poor as scripting languages go and have spent 3 months motivating a move to PHP. I am not however that proficient in PHP yet (although I already know more PHP than ASP) and cannot afford the time it would require to "re-design and re-factor" all of my code to avoid using redirects and accomodate PHP idiosyncrasies. In my mind, the migration from one scripting language to another should really be a case of changing language syntax. It took three hours to convert all my code from ASP-based to PHP-based scripting. If PHP wants to gain market share, this is the kind of bonus a developer is looking for. > I'm sure a zillion people will disagree with this "rule" I can only say > that when I started focussing on what my code was *really* doing, and really > factoring out the common things, and organizing my pages better, the > header("Location: ...") tool got thrown out (mostly) of my tool box. I agree 100%. There is no excuse for poor programming, and no substitute for good programming. But, that comes with experience in the language and as one learns the ins and outs of the environment one can improve one's code. And, since I don't do anything but sleep between 3am and 6am, I may just redevelop the legacy code into a better solution.. :) Kind regards, Cord -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Displaying the table records along with check boxes.
Hi John, Thanks for the reply. Here the thing is I already tried and I desparately need urgently, thats why I mailed to the group. Anyway thanx for u'r suggestion. Rgds Balaji -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 5:56 PM To: Balaji Ankem; [EMAIL PROTECTED] Subject: Re: [PHP] Displaying the table records along with check boxes. The code to create a check box is: HTH, ---John Holmes... PS: It might help if you actually try to do something yourself and then ask a question. We're not here to feed you code. Anyways, a way you might approach it is to name all of your checkboxes the same, something like Where $id is a unique identifier for the row/field/etc... Then, you simply use some code like this to delete all of the rows where the box was checked. HTHSM, ---John Holmes... - Original Message - From: "Balaji Ankem" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 8:05 AM Subject: [PHP] Displaying the table records along with check boxes. > Hi friend, > I would like to display the table records along with check boxes for > the purpose of > selecting particular records or select all and for deleteing them or > for other purpose. > > Anybody have ready made code for this type... > > Any help would be greatly appreciated. > > Thanks and Regards > Balaji > > > -- > 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 **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I split an alphabetical list (array) into A-M and N-Z?
On Wednesday 03 July 2002 19:52, Daevid Vincent wrote: > Anyone have a function that will take an alphabetical list of names (in > an array already) and split it into two 'chunks' (arrays) A-M and N-Z? Psuedo-code: loop through array array_shift() if element is A-M add to the A-M array, else add to N-Z array -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I wish I was on a Cincinnati street corner holding a clean dog! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] whats wrong with this function
whats wrong with this. it's getting stuck somewhere function urls_clickable($string) { for($n=0; $n < strlen($string); $n++) { if(strtolower($string[$n]) == 'h') { if(!strcmp("http://";, strtolower($string[$n]) . strtolower($string[$n+1]) . strtolower($string[$n+2]) . strtolower($string[$n+3]) . $string[$n+4] . $string[$n+5] . $string[$n+6])) { $startpos = $n; while($n < strlen($string) && eregi("[a-z0-9\.\:\?\/\~\-\_\&\=\%\+\'\"]", $string[$n])) $n++; if(!eregi("[a-z0-9]", $string[$n-1])) $n--; $link = substr($string, $startpos, ($n-$startpos)); $link = $link; $string_tmp = $string; $string = substr($string_tmp, 0, $startpos); $string .= "$link"; $string .= substr($string_tmp, $n, strlen($string_tmp)); $n = $n + 15; } } } return $string; } $text = "http://www.somewhere.org "; echo urls_clickable($text);
RE: [PHP] cURL in an exec() . more
[snip] As a matter of fact, when viewing the source (which should display properly if word wrap is off in Notepad) the line appears to be broken up. I have an idea...write the line to a file then open the file and get the line for exec()...blabbering now, must go... [/snip] I have fixed many things and had many great suggestions pointed my way, I appreciate all of it! So to state the problem in the light of this new day here is what I have; >From the command line this works perfectly; curl -d "name=myname&password=mypassword&btnsubmit=submit" -s -o cdrlist.html https://theserver.com/download/list.html Using exec() (or shell_exec(), or others in the family) like this; exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html https://theserver.com/download/list.html";); does not work. I have made sure that the output of the exec() is all on one line through many tests. I have placed the command line arguements in variables and re-done the exec() call as many ways as I can think of. Is anyone aware of any problems with exec() that may be causing this behavior? Any insight would be grandly appreciated. Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I split an alphabetical list (array) into A-Mand N-Z?
Try using a regular expression to go through each of the array elements, sending to one array if the first letter is [a-mA-M], to another if the first letter is [n-zN-Z]. If you're not searching by first letter in the array elements, and they are comma-delimited name sets, do it that way. HTH Martin >>> [EMAIL PROTECTED] 07/03/02 08:50AM >>> On Wednesday 03 July 2002 19:52, Daevid Vincent wrote: > Anyone have a function that will take an alphabetical list of names (in > an array already) and split it into two 'chunks' (arrays) A-M and N-Z? Psuedo-code: loop through array array_shift() if element is A-M add to the A-M array, else add to N-Z array -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I wish I was on a Cincinnati street corner holding a clean dog! */ -- 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] Compiling PHP with Java support on a virtual server
Hi all, I have compiled PHP with Java support using the option ./configure --with-prefix="path to lib directory" --with-java="jdk path" on a virtual server. There is no problem with compilation. During compilation it gives Checking for Java Support yes . I made modifications to the php.ini file also. but when I tried a test php script , I was not able to see anything related to java in the output file. As the previous option was not working , we tried setting JAVA_HOME to jdk_path and used the option ./configure --with-prefix="path to lib directory" --with-java(without the jdkpath) . Even not I was not able to get anything related to Java. phpinfo() gives me the configure option as ./configure --with-prefix="path to lib directory" --with-java="jdk path" and not ./configure --with-prefix="path to lib directory" --with-java . Am I doing anything wrong ? Then we removed all PHP related files for usr/local/bin and usr/local/lib and compiled PHP again. Even now we were not able to get that working ... what are the steps to be followed to install PHP with Java support on a virtual server??? previously we had installed the same version of PHP on our local m/c and everything was working fine. The only difference is I am not using --with-prefix option when compiling on my local m/c . we don't have access to /usr/local/lib of the virtual server m/c and so we cannot put our ini file in /usr/local/lib. Regds, Revathi.
Re: [PHP] Installation de PHP 4.2.1 with Apache and extension Frontpage 2002
If you have Apache installed as an RPM, make sure you have the "apache-devel" RPM installed as well. I remember I had this problem once in RedHat... apxs is included in the devel package if I recall correctly. -- Aaron Gould [EMAIL PROTECTED] Web Developer - Original Message - From: "Claudio Valgoi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 5:37 AM Subject: [PHP] Installation de PHP 4.2.1 with Apache and extension Frontpage 2002 > Hello, > > I've recently installed Mandrake v 8.1 on my computer and then successfully > compiled and installed PostgreSQL and Apache 1.3.24 and PHP 4.2.1... All > that works well... > > When I installed Frontpage 2002 extensions on the same computer, PhP didn't > work any more. > I then tried to compile again php with "make clean"; but same result PhP > isn't working > > I then tried to make a > "/configure --with-apxs=/usr/local/apache/bin/apxs > --with-pgsql=/usr/local/pgsql dans php" and the following error appeared : > > Sorry, I was not able to successfully run > APXS > > > > -- > 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] whats wrong with this function
Yes, your problem is it doesn't work. HTH, ---John Holmes... PS: Think that's a worthless answer? Well...same for your question... - Original Message - From: "Adrian Murphy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 8:47 AM Subject: [PHP] whats wrong with this function whats wrong with this. it's getting stuck somewhere function urls_clickable($string) { for($n=0; $n < strlen($string); $n++) { if(strtolower($string[$n]) == 'h') { if(!strcmp("http://";, strtolower($string[$n]) . strtolower($string[$n+1]) . strtolower($string[$n+2]) . strtolower($string[$n+3]) . $string[$n+4] . $string[$n+5] . $string[$n+6])) { $startpos = $n; while($n < strlen($string) && eregi("[a-z0-9\.\:\?\/\~\-\_\&\=\%\+\'\"]", $string[$n])) $n++; if(!eregi("[a-z0-9]", $string[$n-1])) $n--; $link = substr($string, $startpos, ($n-$startpos)); $link = $link; $string_tmp = $string; $string = substr($string_tmp, 0, $startpos); $string .= "$link"; $string .= substr($string_tmp, $n, strlen($string_tmp)); $n = $n + 15; } } } return $string; } $text = "http://www.somewhere.org "; echo urls_clickable($text); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whats wrong with this function
On Wednesday 03 July 2002 20:47, Adrian Murphy wrote: > whats wrong with this. > it's getting stuck somewhere Stick in some echo statements at strategic points in the loops to find out _where_ it is getting stuck. > function urls_clickable($string) { > for($n=0; $n < strlen($string); $n++) > { > if(strtolower($string[$n]) == 'h') { > if(!strcmp("http://";, strtolower($string[$n]) . strtolower($string[$n+1]) . > strtolower($string[$n+2]) . strtolower($string[$n+3]) . $string[$n+4] . > $string[$n+5] . $string[$n+6])) { $startpos = $n; > while($n < strlen($string) && eregi("[a-z0-9\.\:\?\/\~\-\_\&\=\%\+\'\"]", > $string[$n])) $n++; if(!eregi("[a-z0-9]", $string[$n-1])) $n--; > $link = substr($string, $startpos, ($n-$startpos)); > $link = $link; > $string_tmp = $string; > $string = substr($string_tmp, 0, $startpos); > $string .= "$link"; > $string .= substr($string_tmp, $n, strlen($string_tmp)); > $n = $n + 15; > } > } > } > return $string; > } > > $text = "http://www.somewhere.org "; > echo urls_clickable($text); -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* System going down at 1:45 this afternoon for disk crashing. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why can't I get imagepstext to work?
No matter what I try, it doesn't work I have GD installed and my phpinfo is on this link: Please, someone, help Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple Example of Passing on a file through a PHP script
Hi, Store all files in a 'secret' folder, preferably outside the www-root. Store filename, size, type, date, whatever in your dB. To link to a file, use something like this MyDoc.pdf Then in download.php you update your stats table with the relevant info and then send the file to the user. | download.php | This is not complete and I'm not really sure about the headers, but you can read more at http://www.php.net/manual/en/function.fpassthru.php /Joakim > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 03, 2002 2:05 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Simple Example of Passing on a file through a > PHP script > > > I want to show info when my docs are viewed though my stats > program. I have > decieded the best way would be to put the info into a DB > through php file > then output the PDF, Excel, Zip or Powerpoint file. > > Only trouble is I have no Idea how to do this > > > -- > 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[2]: [PHP] cURL in an exec() . more
Hello jay, Jay try just to execute php And see what is done. For example i have problems with execution read my e-mail in the list. Wednesday, July 3, 2002, 4:56:39 PM, you wrote: jbnc> [snip] jbnc> As a matter of fact, when viewing the source (which should display properly jbnc> if word wrap is off in Notepad) the line appears to be broken up. I have an jbnc> idea...write the line to a file then open the file and get the line for jbnc> exec()...blabbering now, must go... jbnc> [/snip] jbnc> I have fixed many things and had many great suggestions pointed my way, I jbnc> appreciate all of it! So to state the problem in the light of this new day jbnc> here is what I have; >>From the command line this works perfectly; jbnc> curl -d "name=myname&password=mypassword&btnsubmit=submit" -s -o jbnc> cdrlist.html https://theserver.com/download/list.html jbnc> Using exec() (or shell_exec(), or others in the family) like this; jbnc> exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o jbnc> cdrlist.html https://theserver.com/download/list.html";); jbnc> does not work. I have made sure that the output of the exec() is all on one jbnc> line through many tests. I have placed the command line arguements in jbnc> variables and re-done the exec() call as many ways as I can think of. Is jbnc> anyone aware of any problems with exec() that may be causing this behavior? jbnc> Any insight would be grandly appreciated. jbnc> Thanks! jbnc> Jay -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple Example of Passing on a file through a PHP script
> $fd = fopen($filename,'r'); > fpassthru($fd); or readfile($filename); Saves you an fopen call, same result... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] cURL in an exec() . more
[snip] Jay try just to execute php And see what is done. For example i have problems with execution read my e-mail in the list. [/snip] Still not working. I have the script check for the existence of the file and return an error if it is not downloaded. That is the only error I get Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: RegEx question
as a preg "/(...)$/" this gives you the last three chars.. -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ "David Busby" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > List, > How can I regex to compare the last three chars of a string to "php"? > > /B > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: RegEx question
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message... > > How can I regex to compare the last three chars of a string to "php"? > > if (substr($foo, -3) == 'php'){ > } > > Oh, wait, you wanted to use RegEx. Sorry, can't help you there. :-) > > Don't use a cannon to swat a fly. probably a good call.. :) -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] does a form submit from a http page to a https ensure secure data?
On Tuesday, July 2, 2002, at 09:48 PM, Richard Lynch wrote: > My old ISP had SSL on another server (or at least directory) and > personally > vetted every line of code that went on it. Royal PITA, but more secure. What does "vetted" mean? I didn't see it in the Jargon File so maybe it's OT but I'm curious. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whats wrong with this function
relax friend.i was just asking - Original Message - From: "1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Adrian Murphy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 2:08 PM Subject: Re: [PHP] whats wrong with this function > Yes, your problem is it doesn't work. > > HTH, > ---John Holmes... > > PS: Think that's a worthless answer? Well...same for your question... > > - Original Message - > From: "Adrian Murphy" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 03, 2002 8:47 AM > Subject: [PHP] whats wrong with this function > > > > whats wrong with this. > it's getting stuck somewhere > > > > function urls_clickable($string) { > for($n=0; $n < strlen($string); $n++) > { > if(strtolower($string[$n]) == 'h') { > if(!strcmp("http://";, strtolower($string[$n]) . strtolower($string[$n+1]) . > strtolower($string[$n+2]) . strtolower($string[$n+3]) . $string[$n+4] . > $string[$n+5] . $string[$n+6])) { > $startpos = $n; > while($n < strlen($string) && eregi("[a-z0-9\.\:\?\/\~\-\_\&\=\%\+\'\"]", > $string[$n])) $n++; > if(!eregi("[a-z0-9]", $string[$n-1])) $n--; > $link = substr($string, $startpos, ($n-$startpos)); > $link = $link; > $string_tmp = $string; > $string = substr($string_tmp, 0, $startpos); > $string .= "$link"; > $string .= substr($string_tmp, $n, strlen($string_tmp)); > $n = $n + 15; > } > } > } > return $string; > } > > $text = "http://www.somewhere.org "; > echo urls_clickable($text); > > > > -- > 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[4]: [PHP] cURL in an exec() . more
Hello Jay, Let's try it in the different way. create an executable command file. and try to execute it via php it must work. Wednesday, July 3, 2002, 5:20:49 PM, you wrote: JB> [snip] JB> Jay try just to execute php JB> And see what is done. For example i have problems with execution JB> read my e-mail in the list. JB> [/snip] JB> Still not working. I have the script check for the existence of the file and JB> return an error if it is not downloaded. That is the only error I get JB> Thanks! -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Where do I specify a DSN?
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message... > > I'm getting this error message...where does it come from? > > > >Warning: SQL error: [unixODBC][Driver Manager]Data source name not > >found, and no default driver specified, SQL state IM002 in SQLConnect in > >/var/www/html/index.php on line 4@ > > Microsoft. :-) > > Microsoft defines possible database connections as "DSN" in the ODBC Control > Panel. > > Open up the ODBC Control Panel, and make a DSN named "foo" and point it to > the database you want to access. it said unixODBC, not sure what he was trying to connect to though, may be best to use the native connection drivers? -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sample javascript popup+php - newbie
hi, I want to make an app with properties: -i have a file1.php with a textbox1 and button1; when i press button1, file2.php is popup-ed. - in file2.php i have textbox2 and button2; when button2 is pressed, file2 is closed, and value of textbox2 is submited to texbox1. There is somewere an sample app like this? tx in adv for any help adi
RE: Re[4]: [PHP] cURL in an exec() . more
Trying that now... -Original Message- From: Latex Master [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 8:26 AM To: Jay Blanchard Cc: [EMAIL PROTECTED] Subject: Re[4]: [PHP] cURL in an exec() . more Hello Jay, Let's try it in the different way. create an executable command file. and try to execute it via php it must work. Wednesday, July 3, 2002, 5:20:49 PM, you wrote: JB> [snip] JB> Jay try just to execute php JB> And see what is done. For example i have problems with execution JB> read my e-mail in the list. JB> [/snip] JB> Still not working. I have the script check for the existence of the file and JB> return an error if it is not downloaded. That is the only error I get JB> Thanks! -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: blank (OT)
No problem! Just saw the "www.the-spa.com" link so I thought it was an advertisement. It wasn't until after I submitted did I realize I was in error. FletchSOD "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Scott Fletcher wrote: > > >This is a PHP newsgroup, it is for PHP discussion. This is not a PHP > >discussion, so it is a spam mail. Please refrain from using it. > > > > > > Actually, I think it is pretty obvious that this guy is just trying to > subscribe. Your email (and consequently mine) are more easily > categorized as spam, and yous even adds a dash of bad attitude. > > >"Matthew" <[EMAIL PROTECTED]> wrote in message > >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > > >>subscribe [EMAIL PROTECTED] > >> > >>matthew de Jongh > >>president > >>the spa! internet > >>voice (413) 539-9818 > >>www.the-spa.com > >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dealing with XML charsets
Peter, What OS are you running this on...if you are on windows then uncomment the php_iconv.dll in your php.ini file and then you can see if you can run the iconv functions. If you are running under unix/linux then you need to compile php with the iconv functions. Example ./configure --with-iconv=/location/of/iconv Iconv is a gnu app that you use for the conversions. You can get more info GNU's website about iconv... B i g D o g - Original Message - From: "Peter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 12:46 AM Subject: Re: [PHP] Dealing with XML charsets > On Tue, 2 Jul 2002 15:23:38 -0600, [EMAIL PROTECTED] (Ray Hunter) wrote: > > Check here: > > http://www.chilkatsoft.com/ChilkatXml.asp > > Doesn't look as if it'll run under Unix? > > > Google search: > > http://www.google.com/search?sourceid=navclient&q=convert+xml+charset > > I've been googling ont he topic for the past couple of days, and had no luck :-( > > > > > -- > 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] whats wrong with this function
On Wednesday, July 3, 2002, 1:47:05 PM, "Adrian Murphy" wrote: > whats wrong with this. > it's getting stuck somewhere "Somewhere" isn't very helpful. When asking for help be sure to include as much information as possilble. Laying out your code so the structure can be seen... http://";, strtolower($string[$n]) . strtolower($string[$n+1]) . strtolower($string[$n+2]) . strtolower($string[$n+3]) . $string[$n+4] . $string[$n+5] . $string[$n+6])) { $startpos = $n; while($n < strlen($string) && eregi("[a-z0-9\.\:\?\/\~\-\_\&\=\%\+\'\"]", $string[$n])) $n++; if(!eregi("[a-z0-9]", $string[$n-1])) $n--; $link = substr($string, $startpos, ($n-$startpos)); $link = $link; $string_tmp = $string; $string = substr($string_tmp, 0, $startpos); $string .= "$link"; $string .= substr($string_tmp, $n, strlen($string_tmp)); $n = $n + 15; } } } return $string; } $text = "http://www.somewhere.org "; echo urls_clickable($text); ?> It's getting stuck because you're moving the goalposts. It's a very bad idea to base a loop on a variable that is changed within the loop. I suggest you loop through one string while building a second string as the return value. On the other hand, I seem to remember seeing a regex posted on this list recently that did exactly this. I suggest you search the archives for it because it would save you a lot of hassle. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting a cookie and redirecting
On Tuesday, July 2, 2002, at 11:10 PM, Justin French wrote: > on 03/07/02 11:54 AM, Richard Lynch ([EMAIL PROTECTED]) wrote: > >> Rule of Thumb: >> If you have to do header("Location: ...") you have a >> design/engineering/organizational problem in your code/pages/site. >> >> I'm sure a zillion people will disagree with this "rule" > > I agree, except there's one exception to this that I can't see a way > around. > > When dealing with form submissions the receiving file needs to validate > all > the code before anything is sent to the browser, update the database (or > whatever) and then redirect to itself with some sort of GET flag that > issues > a thankyou note or something. > > Otherwise people can hit "refresh" and post the data twice, or 10 > times :) Justin! That's a great idea. No one ever mentioned that to me before (and I've been on and off this list for months). Or actually, I think YOU mentioned it once but I didn't understand it. So let me ask: do you have one giant script that validates all data, depending on the variables sent to it? Or do you have a "formcheck" script for each individual form? This is a great way to stop someone from hitting refresh and resubmitting their POST data accidentally, since you've got that GET flag which basically says "do not process this form!" It's not -secure-, since anyone can remove this flag (even if you used POST), but it will work for Joe User to stop him from accidentally resubmitting. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_POST into a formatted string, help!
Hey, that is new to me! Thanks! FletchSOD "Kevin Stone" <[EMAIL PROTECTED]> wrote in message 01de01c22216$984c5740$6501a8c0@kevin">news:01de01c22216$984c5740$6501a8c0@kevin... > Oh man I hope you don't shoot yourself when you realize how easy this is.. > > foreach ($_POST as $key => $val) > { > $str .= "&$key=$val"; > } > > Then just crop the first char off and there you go. > > -Kevin > > - Original Message - > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 02, 2002 4:10 PM > Subject: [PHP] $_POST into a formatted string, help! > > > > Hello, > > > > I need to get _$POST into a string in this form: > > tree=green&sky=blue&sun=yellow , how can i accomplish this? > > > > THanks. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[6]: [PHP] cURL in an exec() . more
Hello Jay, Let us know if it worked Wednesday, July 3, 2002, 5:27:21 PM, you wrote: JB> Trying that now... JB> -Original Message- JB> From: Latex Master [mailto:[EMAIL PROTECTED]] JB> Sent: Wednesday, July 03, 2002 8:26 AM JB> To: Jay Blanchard JB> Cc: [EMAIL PROTECTED] JB> Subject: Re[4]: [PHP] cURL in an exec() . more JB> Hello Jay, JB> Let's try it in the different way. create an executable command JB> file. and try to execute it via php it must work. JB> Wednesday, July 3, 2002, 5:20:49 PM, you wrote: JB>> [snip] JB>> Jay try just to execute php JB>> And see what is done. For example i have problems with execution JB>> read my e-mail in the list. JB>> [/snip] JB>> Still not working. I have the script check for the existence of the file JB> and JB>> return an error if it is not downloaded. That is the only error I get JB>> Thanks! JB> -- JB> Best regards, JB> Latexmailto:[EMAIL PROTECTED] -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Security: PHP: how to "harden" PHP scripts?
I'm writing my first commercial site and of course I am thinking about security. I'm worried about someone using a flaw in my PHP script logic to access information they shouldn't. I've read the PHP books I have and Googled around but can't quite find specific answers to my questions about PHP and security. In general how does one go about hardening a PHP script. i.e. making it as "hacker-proof" as possible. General things like: - verifying user inputted data - not putting clear-text passwords in php scripts - use "safe-mode"? And specifically, what are some things one can do? Things like: - use addslashes with user data - use mysql_escape_string for data submitted to mysql Thanks, Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] addslahes and magic quote woes
I am trying to make my PHP safe against malicious data user inputs. Reading up on this most people suggest using addslashes(), magic_quotes on and other things like mysql_escape_string(); But I have been running into the problem that I mess up the user's input because I use more then one of these functions in succession on the data. Is there any way to prevent the "re-escaping"/"re-slashing" of data that has already been escaped or slashed? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php execution a server side program updated problem please help
Hello php-general, Hello php-general, Dear php list, I've got completely lost in program execution under php. I need to run a command grab it's output for the next processing, So I wrote a script: "; echo $output; echo ""; ?> And I get nothing :(. Script like below: "; echo $output; echo ""; ?> Work fine outputting me command line parameters. Also when i run this file via linux console i get the following mess: *** php 6.php X-Powered-By: PHP/4.0.6 Content-type: text/html Loaded from /bla/bla.txt: '' (cs99g021.idx): cs99g021.idx part 1 be gin end yEnc Found 'cs99g021.idx' State 16 yEnc Parts begin 1 end OK File successfully written to /bla/bla/cs99g021.idx 1 file decoded from 1 input file, 0 failed I think it must be in the other way, like this: Loaded from /bla/bla.txt: '' (cs99g021.idx): cs99g021.idx part 1 be gin end yEnc Found 'cs99g021.idx' State 16 yEnc Parts begin 1 end OK File successfully written to /bla/bla/cs99g021.idx 1 file decoded from 1 input file, 0 failed Please give me some clues where is my mistake, i'm getting little nuts. -- Best regards, Latex mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whats wrong with this function
thnks, i didn't write the function so i've now replaced it with something better. - Original Message - From: "Stuart Dallas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 2:30 PM Subject: Re: [PHP] whats wrong with this function > On Wednesday, July 3, 2002, 1:47:05 PM, "Adrian Murphy" wrote: > > whats wrong with this. > > it's getting stuck somewhere > > "Somewhere" isn't very helpful. When asking for help be sure to include as much > information as possilble. > > Laying out your code so the structure can be seen... > > function urls_clickable($string) > { > for($n=0; $n < strlen($string); $n++) > { > if(strtolower($string[$n]) == 'h') > { > if(!strcmp("http://";, strtolower($string[$n]) . strtolower($string[$n+1]) . strtolower($string[$n+2]) . strtolower($string[$n+3]) . $string[$n+4] . $string[$n+5] . $string[$n+6])) > { > $startpos = $n; > > while($n < strlen($string) && eregi("[a-z0-9\.\:\?\/\~\-\_\&\=\%\+\'\"]", $string[$n])) > $n++; > > if(!eregi("[a-z0-9]", $string[$n-1])) > $n--; > > $link = substr($string, $startpos, ($n-$startpos)); > $link = $link; > $string_tmp = $string; > $string = substr($string_tmp, 0, $startpos); > $string .= "$link"; > $string .= substr($string_tmp, $n, strlen($string_tmp)); > $n = $n + 15; > } > } > } > return $string; > } > > $text = "http://www.somewhere.org "; > echo urls_clickable($text); > ?> > > It's getting stuck because you're moving the goalposts. It's a very bad idea to > base a loop on a variable that is changed within the loop. I suggest you loop > through one string while building a second string as the return value. > > On the other hand, I seem to remember seeing a regex posted on this list > recently that did exactly this. I suggest you search the archives for it > because it would save you a lot of hassle. > > -- > Stuart > > > -- > 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] addslahes and magic quote woes
Try stripslashes() before addslashes(), to ensure that it doesn't already contain slashes. HTH Martin >>> Jean-Christian Imbeault <[EMAIL PROTECTED]> 07/03/02 09:40AM >>> I am trying to make my PHP safe against malicious data user inputs. Reading up on this most people suggest using addslashes(), magic_quotes on and other things like mysql_escape_string(); But I have been running into the problem that I mess up the user's input because I use more then one of these functions in succession on the data. Is there any way to prevent the "re-escaping"/"re-slashing" of data that has already been escaped or slashed? Jc -- 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] Re: synchronizing php functions
On Wednesday, July 3, 2002, at 04:08 AM, Philip MacIver wrote: > The problem is that sessions are local to the clients machine Huh? > so if I tried to put this information in the session then the only > information that I would get back is the people that > are > logged in on my machine, not the server (Please tell me if I wrong in > what I say here). Therefore I need to be able to > but this > information in the session and have it available to all sessions (sort > of like the way static variables in Java belong > to the class and > not the individual objects that are created from that class). So if you > undersatnd what I'm trying to do here and know > of a way > to do it I would love to here it. This has been discussed on the list before, and even I think just last week (so check the archives, using "server variables asp" as your search criteria). Some theories suggest that it would entail a lot of overhead, unless you only have a few users to keep track of simultaneously. Possible suggestions are 1) if the data doesn't change, put it into an includefile 2) if the data is dynamic, be clever and implement this yourself with database-managed persistence (but beware the overhead). Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
Martin Clifford wrote: > Try stripslashes() before addslashes(), to ensure that it doesn't already contain slashes. > > HTH > > Martin But what if the original data contained a slash? I want to keep that slash in the data ... Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $this in an XML data handler ... in a class
"Clay Loveless" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here's a brain-bender ... At least it is for me at the moment. : ) > > When I use an XML parser inside a class, the xml_*_handler functions aren't > recognizing "$this->" variables. I can kind of see why ... But would like it > to work anyway. : ) > > Here's an example: > > class Blah > { > var $xmlparser; > var $current_element; > > // ... > > function _parseXML($data) > { > $this->xmlparser = xml_parser_create(); > xml_set_element_handler( > $this->xmlparser, > array($this,"_xml_start_element"), > array($this,"_xml_end_element")); > xml_set_character_data_handler( > $this->xmlparser, > array($this,"_xml_character_data")); > xml_parse($this->xmlparser, $data); > xml_parser_free($this->xmlparser); > } > > function _xml_start_element($p, $e_name, $e_attributes) > { > $this->current_element = $e_name; > } > > function _xml_end_element($p, $e_name) > { > // ... > } > > function _xml_character_data($p, $data) > { > echo "element is: ".$this->current_element."\n"; > echo "data is: $data\n"; > } > > } // end of class Blah > > > > When this XML parser gets called from within the Blah class, the "element > is:" portion of _xml_character_data comes out blank! > > This sort of makes sense, because the callback functions are "children" of > the xml_parser_create "parent" ... But should that make the children > ignorant of the "grandparent" variables referred to by $this->varname? > > I hope this makes sense ... Has anyone else encountered this sort of > problem? I'm an old hat at PHP, but am relatively new to both XML parsing > and writing my own classes. > > Thanks, > Clay > Have a look at: http://www.php.net/manual/en/function.xml-set-object.php xml_set_object($this->parser, &$this); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP in South Africa
I am looking for PHP programmers in South Africa, specifically in the Gauteng area. Please mail me. Tx Bk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[6]: [PHP] cURL in an exec() . more
Awww Nut! I post a reply a while ago and probably accidenly delete it instead of sending it. Dang! I hate this MS-Outlook software! Anyway! I"m not going to start over, so I'll be brief! 1) Check the file path, like "/usr/local/bin/curl" instead of "curl" as an example. Sometime environment variable couldn't be access that way. 2) I had that problem with different script, so I use "putenv("PATH=/usr/bin:");" so I can get the modem to work. Hope that help! FletchSOD "Latex Master" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello Jay, > Let us know if it worked > Wednesday, July 3, 2002, 5:27:21 PM, you wrote: > > JB> Trying that now... > > JB> -Original Message- > JB> From: Latex Master [mailto:[EMAIL PROTECTED]] > JB> Sent: Wednesday, July 03, 2002 8:26 AM > JB> To: Jay Blanchard > JB> Cc: [EMAIL PROTECTED] > JB> Subject: Re[4]: [PHP] cURL in an exec() . more > > > JB> Hello Jay, > JB> Let's try it in the different way. create an executable command > JB> file. and try to execute it via php it must work. > > JB> Wednesday, July 3, 2002, 5:20:49 PM, you wrote: > > JB>> [snip] > JB>> Jay try just to execute php > > JB>> And see what is done. For example i have problems with execution > JB>> read my e-mail in the list. > JB>> [/snip] > > JB>> Still not working. I have the script check for the existence of the file > JB> and > JB>> return an error if it is not downloaded. That is the only error I get > > JB>> Thanks! > > > > > JB> -- > JB> Best regards, > JB> Latexmailto:[EMAIL PROTECTED] > > > > > > > -- > Best regards, > Latexmailto:[EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_POST into a formatted string, help!
> Oh man I hope you don't shoot yourself when you realize how easy this > is.. > > foreach ($_POST as $key => $val) > { > $str .= "&$key=$val"; > } > > Then just crop the first char off and there you go. Even easier, though maybe requiring a tiny bit extra memory to deal with the array: $arr = array(); foreach ($_POST as $key => $val) { $arr[] = $key . '=' . $val; } $str = implode('&', $arr); Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
On Wednesday, July 3, 2002, at 09:40 AM, Jean-Christian Imbeault wrote: > I am trying to make my PHP safe against malicious data user inputs. > Reading up on this most people suggest using addslashes(), magic_quotes > on and other things like mysql_escape_string(); > > But I have been running into the problem that I mess up the user's > input because I use more then one of these functions in succession on > the data. > > Is there any way to prevent the "re-escaping"/"re-slashing" of data > that has already been escaped or slashed? Turn off magic_quotes and do addslashes() explicitly every time you do a database insert. Then make sure you always stripslash() data returned from a database query. magic_quotes is convenient for newbies, but after a while you'll find it only trips you up, as you've discovered. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
Erik Price wrote: > > Turn off magic_quotes and do addslashes() explicitly every time you do a > database insert. Then make sure you always stripslash() data returned > from a database query. > > magic_quotes is convenient for newbies, but after a while you'll find it > only trips you up, as you've discovered. I totally agree. Security question: Is turning off magic_quotes and using strip/addslashes() a 100% effective solution against malicious user input? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
Just pick one, and use only one. If you have magic_quotes ON, then you don't need addslashes, etc. ---John Holmes... - Original Message - From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 9:40 AM Subject: [PHP] addslahes and magic quote woes > I am trying to make my PHP safe against malicious data user inputs. > Reading up on this most people suggest using addslashes(), magic_quotes > on and other things like mysql_escape_string(); > > But I have been running into the problem that I mess up the user's input > because I use more then one of these functions in succession on the data. > > Is there any way to prevent the "re-escaping"/"re-slashing" of data that > has already been escaped or slashed? > > Jc > > > -- > 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[2]: [PHP] addslahes and magic quote woes
Hello Jean-Christian, The answer is NO NO NO. At the beginning you have talked about security. You have to realize that there is no 100% protection against hackers. Using strip/addslashes will help you to filter some user input not all. :) So try to pick one way and go that way. if magic quotes are turned on you want need addslashes if they are off you will need them. Wednesday, July 3, 2002, 6:21:37 PM, you wrote: JCI> Erik Price wrote: >> >> Turn off magic_quotes and do addslashes() explicitly every time you do a >> database insert. Then make sure you always stripslash() data returned >> from a database query. >> >> magic_quotes is convenient for newbies, but after a while you'll find it >> only trips you up, as you've discovered. JCI> I totally agree. JCI> Security question: Is turning off magic_quotes and using JCI> strip/addslashes() a 100% effective solution against malicious user input? JCI> Jc -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]> > Erik Price wrote: > > > > > > Turn off magic_quotes and do addslashes() explicitly every time you do a > > database insert. Then make sure you always stripslash() data returned > > from a database query. You don't need to strip slashes from data coming out of a database. The only reason you add the slashes in the first place is to get the data into the database, the actual slashes don't go into the database. > > > > magic_quotes is convenient for newbies, but after a while you'll find it > > only trips you up, as you've discovered. I haven't discovered this > I totally agree. > > Security question: Is turning off magic_quotes and using > strip/addslashes() a 100% effective solution against malicious user input? Nothing's 100%, of course. It will make sure that your strings are treated properly, but slashes don't do anything for integers. If you have a query like: UPDATE admin SET something = 'this' where user_id = $user_id Then using addslashes doesn't help you at all because $user_id doesn't have quotes around it. Since it's supposed to be an integer, it shouldn't have quotes, but you need to validate that $user_id is indeed an integer without any other data in it, otherwise you're open to SQL attacks. Bottom line, validate everything from the user. POST, GET, COOKIE, etc... If it's supposed to be a number, make it a number with (int). If it's supposed to be a string, make sure it's had addslashes() applies to it, either through magic_quotes or manually...etc, etc, etc... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_POST into a formatted string, help!
- Original Message - From: "Erik Price" <[EMAIL PROTECTED]> > > foreach ($_POST as $key => $val) > > { > > $str .= "&$key=$val"; > > } Make sure you define $str = ""; before it enters the loop, othewise you'll throw some warnings if your error reporting level is set high. It's because $str is undefined on the first loop, yet your adding something to it. > Even easier, though maybe requiring a tiny bit extra memory to deal with > the array: > > $arr = array(); > foreach ($_POST as $key => $val) { > $arr[] = $key . '=' . $val; > } > $str = implode('&', $arr); Hmmm...doesn't look easier, but whatever works! :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] V basic newbie problem
I'm not sure if this is the right place for this but I'm just starting out with php and MySQL I have succesfully got a database up and I have managed to populate the first row of the html table with the first row of dynamic content without too much problem. I have used the visual enviroment of DW Mx for this and it was staightforward enough My problem arises when I want to fill in the subsequent rows of the table with the subesquent rows from the database. How do I create the recordset that will pull the info from the relevant subsequent rows for my columns? The code for the first row and first column entry is: but in the row below in the html table I want to refer to the second row DB entry for DailyBB but I cant see how to go about this:( The Repeat server behaviour in DW Mx simply puts all the values in one html cell which is not what I wish to achieve. Basically I want the html table to match the database but have only succeeded in getting the first row to display so far:( I'm sure this is simple but its my first time at all this and any help would be appreciated:) TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] V basic newbie problem
Put it in a WHILE loop and RTFM -Original Message- From: Duncan Ellwood [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] V basic newbie problem I'm not sure if this is the right place for this but I'm just starting out with php and MySQL I have succesfully got a database up and I have managed to populate the first row of the html table with the first row of dynamic content without too much problem. I have used the visual enviroment of DW Mx for this and it was staightforward enough My problem arises when I want to fill in the subsequent rows of the table with the subesquent rows from the database. How do I create the recordset that will pull the info from the relevant subsequent rows for my columns? The code for the first row and first column entry is: but in the row below in the html table I want to refer to the second row DB entry for DailyBB but I cant see how to go about this:( The Repeat server behaviour in DW Mx simply puts all the values in one html cell which is not what I wish to achieve. Basically I want the html table to match the database but have only succeeded in getting the first row to display so far:( I'm sure this is simple but its my first time at all this and any help would be appreciated:) TIA -- 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] cURL in an exec() . more
OK, here is where I am (between handling other pre-holiday/long weekend processese here); I have the PHP script create a shell script containing the needed code for the cURL process. Of course the shell script will execute from the command line with me as 'root'. But the exec() that calls the shell script will not execute the script because of improper permissions. (Has to do with the permissions on the topmost directory for where the file lives, changing that could be dangerous from a security standpoint). So I have tried to change those (I am on a Linux box) via the PHP, no luck. It will let me chmod the shell script via the PHP script. So I tried to move the script to /usr/local/bin; rename("getlist.sh", "/usr/local/bin/getlist.sh"); Permission denied exec("mv getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied exec("cp getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied I am looking into posix_setuid() to change the permissions for the time needed, but I've a feeling, after a couple of tests, that this is not going to be the way to do this either. I wish permissions in Linux were more straigtforward. Anyone have an idea how to do this with opening the server wide? Thanks for all your help. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V basic newbie problem
Sorry to crash in! One quick question! Does the VB script work on NON-IE browsers? FletchSOD "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message 002601c222a0$8d8e7330$8102a8c0@niigziuo4ohhdt">news:002601c222a0$8d8e7330$8102a8c0@niigziuo4ohhdt... > Put it in a WHILE loop and RTFM > > -Original Message- > From: Duncan Ellwood [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 03, 2002 9:44 AM > To: [EMAIL PROTECTED] > Subject: [PHP] V basic newbie problem > > > I'm not sure if this is the right place for this but I'm just starting out > with php and MySQL > > I have succesfully got a database up and I have managed to populate the > first row of the html table with the first row of dynamic content without > too > much problem. I have used the visual enviroment of DW Mx for this and it was > staightforward enough > > My problem arises when I want to fill in the subsequent rows of the table > with the subesquent rows from the database. How do I create the recordset > that will pull the info from the relevant subsequent rows for my columns? > > The code for the first row and first column entry is: > > > > but in the row below in the html table I want to refer to the second row DB > entry for DailyBB but I cant see how to go about this:( The Repeat server > behaviour in DW Mx simply puts all the values in one html cell which is not > what I wish to achieve. Basically I want the html table to match the > database but have only succeeded in getting the first row to display so > far:( > > I'm sure this is simple but its my first time at all this and any help would > be appreciated:) > > TIA > > > > > -- > 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] sample javascript popup+php - newbie
Submitted or filled in? i.e. do you want textbox1 to contain whatever is in textbox2 or do you want the form in file2.php to be submitted to file1.php? The difference is that in the first case no PHP gets to run when button2 is pressed, whereas in the second case file1.php gets to run with the data in the form in file2.php. Bogdan adi wrote: >hi, >I want to make an app with properties: >-i have a file1.php with a textbox1 and button1; when i press button1, file2.php is >popup-ed. >- in file2.php i have textbox2 and button2; when button2 is pressed, file2 is closed, >and value of textbox2 is submited to texbox1. >There is somewere an sample app like this? > >tx in adv for any help >adi > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V basic newbie problem
try something like this echo ''; while( $result = mysql_fetch_array( $q ) ) { output here... } echo ''; S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: "Duncan Ellwood" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 8:43 AM Subject: [PHP] V basic newbie problem > I'm not sure if this is the right place for this but I'm just starting out > with php and MySQL > > I have succesfully got a database up and I have managed to populate the > first row of the html table with the first row of dynamic content without > too > much problem. I have used the visual enviroment of DW Mx for this and it was > staightforward enough > > My problem arises when I want to fill in the subsequent rows of the table > with the subesquent rows from the database. How do I create the recordset > that will pull the info from the relevant subsequent rows for my columns? > > The code for the first row and first column entry is: > > > > but in the row below in the html table I want to refer to the second row DB > entry for DailyBB but I cant see how to go about this:( The Repeat server > behaviour in DW Mx simply puts all the values in one html cell which is not > what I wish to achieve. Basically I want the html table to match the > database but have only succeeded in getting the first row to display so > far:( > > I'm sure this is simple but its my first time at all this and any help would > be appreciated:) > > TIA > > > > > -- > 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] V basic newbie problem
[snip] Sorry to crash in! One quick question! Does the VB script work on NON-IE browsers? FletchSOD [/snip] VBscript works on ASP (Active Server Pages) servers...IIS most noteably, but you can get ChiliSOFT ASP for Linux and other *nix boxes. ASP can use VBscript, JSP, PerlScript, and other scripting languages. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V basic newbie problem
DE> I'm not sure if this is the right place for this but I'm just starting out DE> My problem arises when I want to fill in the subsequent rows of the table DE> with the subesquent rows from the database. How do I create the recordset DE> that will pull the info from the relevant subsequent rows for my columns? Depending on your SQL query, and assuming that you have checked for more than one row before coding accordingly, then the answer is to loop through your results using a combination of while and the mysql_fetch_array function. (or another mysql result function of your choice). That being said, without having seen your PHP code, we can't really tell you what exactly to do. This is a problem when using editors that "help" you to code. The basic concepts for accessing MySQL and retrieving records are all in the mysql area of the manual, or in tutorials abound. (including here: http://www.thickbook.com/extra/php_mysql.phtml) - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION (turned off, destory??)
Say that the end-user closed the browser(s) without logging off. The $_SESSION can not be destroyed because the broswer(s) is closed. So, if hte end-user did log off and close the browser(s). How can I destroy the $_SESSION since the session_register() & session_destroy() can not be used with the register global turned off. Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
On Wednesday, July 3, 2002, at 10:21 AM, Jean-Christian Imbeault wrote: > Security question: Is turning off magic_quotes and using > strip/addslashes() a 100% effective solution against malicious user > input? No. Think about what {add|strip}slashes() does. It simply adds slashes to strings, and strips them from strings, depending on certain rules (like the location of apostrophes or other special characters in those strings). There are far more ways for malicious users to insert their own input than I even know of, let alone know how to handle. Consider using add/strip a requirement, not a security precaution. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V basic newbie problem
while($row = mysql_fetch_array($result_set)) { $field1 = $row['field1']; $field2 = $row['field2']; echo "\n"; echo "$field1\n"; echo "\n"; echo "$field2\n"; echo "\n"; } This will cycle through the rows, adding the values of field1 and field2 to the respective variables, then outputting table rows accordingly. HTH Martin >>> "Duncan Ellwood" <[EMAIL PROTECTED]> 07/03/02 10:43AM >>> I'm not sure if this is the right place for this but I'm just starting out with php and MySQL I have succesfully got a database up and I have managed to populate the first row of the html table with the first row of dynamic content without too much problem. I have used the visual enviroment of DW Mx for this and it was staightforward enough My problem arises when I want to fill in the subsequent rows of the table with the subesquent rows from the database. How do I create the recordset that will pull the info from the relevant subsequent rows for my columns? The code for the first row and first column entry is: but in the row below in the html table I want to refer to the second row DB entry for DailyBB but I cant see how to go about this:( The Repeat server behaviour in DW Mx simply puts all the values in one html cell which is not what I wish to achieve. Basically I want the html table to match the database but have only succeeded in getting the first row to display so far:( I'm sure this is simple but its my first time at all this and any help would be appreciated:) TIA -- 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] cURL in an exec() . more
Check out setuid and sticky bits for the file permissions. Remember that if you are running php under apache and you try the exec with a command php is running with apaches permissions. So apache needs to be able to run what ever you are trying to run with the exec command. B i g D o g - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 8:49 AM Subject: RE: [PHP] cURL in an exec() . more > OK, here is where I am (between handling other pre-holiday/long weekend > processese here); > > I have the PHP script create a shell script containing the needed code for > the cURL process. Of course the shell script will execute from the command > line with me as 'root'. But the exec() that calls the shell script will not > execute the script because of improper permissions. (Has to do with the > permissions on the topmost directory for where the file lives, changing that > could be dangerous from a security standpoint). > > So I have tried to change those (I am on a Linux box) via the PHP, no luck. > It will let me chmod the shell script via the PHP script. So I tried to move > the script to /usr/local/bin; > > rename("getlist.sh", "/usr/local/bin/getlist.sh"); Permission denied > exec("mv getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied > exec("cp getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied > > I am looking into posix_setuid() to change the permissions for the time > needed, but I've a feeling, after a couple of tests, that this is not going > to be the way to do this either. > > I wish permissions in Linux were more straigtforward. Anyone have an idea > how to do this with opening the server wide? Thanks for all your help. > > Jay > > > > -- > 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] using xsl:value-of select within form
I am able to do this: But would like to do something like this: "/> I know the latter does not work, so how do I correct it? Thank you, -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] cURL in an exec() . more
Hello Jay, That wasn't what i recommended you LOL :). Ok from the beginning PHP executes and writes files with permissions (like userid and groupid) Webserver is running. So what i think will be the best way for you to do. Is to create an executable with the same owner. and then execute it. As for /usr/local/bin directory it allows to write in it only to root or superuser. I recommend you to create a user like foo then in his home directory create a subdirectory like web and chmod it to 777. and use it as an output for the script. Got an idea? Also you always can use /tmp directory :) Wednesday, July 3, 2002, 6:49:08 PM, you wrote: JB> OK, here is where I am (between handling other pre-holiday/long weekend JB> processese here); JB> I have the PHP script create a shell script containing the needed code for JB> the cURL process. Of course the shell script will execute from the command JB> line with me as 'root'. But the exec() that calls the shell script will not JB> execute the script because of improper permissions. (Has to do with the JB> permissions on the topmost directory for where the file lives, changing that JB> could be dangerous from a security standpoint). JB> So I have tried to change those (I am on a Linux box) via the PHP, no luck. JB> It will let me chmod the shell script via the PHP script. So I tried to move JB> the script to /usr/local/bin; JB> rename("getlist.sh", "/usr/local/bin/getlist.sh"); Permission denied JB> exec("mv getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied JB> exec("cp getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied JB> I am looking into posix_setuid() to change the permissions for the time JB> needed, but I've a feeling, after a couple of tests, that this is not going JB> to be the way to do this either. JB> I wish permissions in Linux were more straigtforward. Anyone have an idea JB> how to do this with opening the server wide? Thanks for all your help. JB> Jay -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V basic newbie problem
On Wednesday, July 3, 2002, at 10:43 AM, Duncan Ellwood wrote: > My problem arises when I want to fill in the subsequent rows of the > table > with the subesquent rows from the database. How do I create the > recordset > that will pull the info from the relevant subsequent rows for my > columns? > > The code for the first row and first column entry is: > > > > but in the row below in the html table I want to refer to the second > row DB > entry for DailyBB but I cant see how to go about this:( The Repeat > server > behaviour in DW Mx simply puts all the values in one html cell which is > not > what I wish to achieve. Basically I want the html table to match the > database but have only succeeded in getting the first row to display so > far:( I haven't used DW Mx myself, I don't really like WYSIWYGs. But the way to do it is use a while loop. // $db = your connection parameters // $sql = your query if (!$result = mysql_query($sql, $db)) { die('The query failed for some reason'); } // this part goes through all the data in $result // and does something with that data on each iteration while ($row = mysql_fetch_assoc($result)) { echo $row_RsSingStanDailybb['DailyBB']; } Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cURL in an exec() . more
Ah! I know what you're feeling about Linux. I had that problem using PHP and text editing software (for programming) with Caldera, like ftp timeout, security, file path, etc. It become too much for me, so I junked it and went back to AIX. I haven't tried it on Red Hat but I can easily turned off hte ftp timeout, etc. from there. Haven't tried PHP stuffs on Red Hat. FletchSOD "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message 002701c222a0$c958ffc0$8102a8c0@niigziuo4ohhdt">news:002701c222a0$c958ffc0$8102a8c0@niigziuo4ohhdt... > OK, here is where I am (between handling other pre-holiday/long weekend > processese here); > > I have the PHP script create a shell script containing the needed code for > the cURL process. Of course the shell script will execute from the command > line with me as 'root'. But the exec() that calls the shell script will not > execute the script because of improper permissions. (Has to do with the > permissions on the topmost directory for where the file lives, changing that > could be dangerous from a security standpoint). > > So I have tried to change those (I am on a Linux box) via the PHP, no luck. > It will let me chmod the shell script via the PHP script. So I tried to move > the script to /usr/local/bin; > > rename("getlist.sh", "/usr/local/bin/getlist.sh"); Permission denied > exec("mv getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied > exec("cp getlist.sh /usr/local/bin/getlist.sh"); Permissiion denied > > I am looking into posix_setuid() to change the permissions for the time > needed, but I've a feeling, after a couple of tests, that this is not going > to be the way to do this either. > > I wish permissions in Linux were more straigtforward. Anyone have an idea > how to do this with opening the server wide? Thanks for all your help. > > Jay > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cURL in an exec() . more
On Wednesday 03 July 2002 22:49, Jay Blanchard wrote: > I have the PHP script create a shell script containing the needed code for > the cURL process. Of course the shell script will execute from the command > line with me as 'root'. But the exec() that calls the shell script will not > execute the script because of improper permissions. (Has to do with the > permissions on the topmost directory for where the file lives, changing > that could be dangerous from a security standpoint). I'm not sure I understand you. You have a php script which creates a shell-script. Then you have a php script which exec('shell-script')? Assuming that the php script is run by the same user throughout then I don't see why it cannot exec your shell-script. Perhaps you can elaborate. > So I have tried to change those (I am on a Linux box) via the PHP, no luck. > It will let me chmod the shell script via the PHP script. OK ... > So I tried to > move the script to /usr/local/bin; so why do you need to move it? Why can't you exec() it where it is? Try hand writing a script then exec() it from php. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Alcohol, hashish, prussic acid, strychnine are weak dilutions. The surest poison is time. -- Emerson, "Society and Solitude" */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] cURL in an exec() . more
[snip] Ok from the beginning PHP executes and writes files with permissions (like userid and groupid) Webserver is running. So what i think will be the best way for you to do. Is to create an executable with the same owner. and then execute it. As for /usr/local/bin directory it allows to write in it only to root or superuser. I recommend you to create a user like foo then in his home directory create a subdirectory like web and chmod it to 777. and use it as an output for the script. Got an idea? Also you always can use /tmp directory :) [/snip] Apache runs as 'nobody' and 'nogroup', so therefore PHP runs as the same. (Security, don't you know.) :) I cannot change file owner or group through PHP. The executable (getlist.sh) is created with the same owner/group. I do change the file permissions to '755' to allow the file to be an executable. {snip] Try hand writing a script then exec() it from php. [/snip] Tried that, no go. crud, I knew this was gonna' happen because of the very tight deadline I am on. I had a feeling that this is why the original exec(curl) didn't work. Thanks, Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and apache path...
Analysis & Solutions wrote: > On Tue, Jul 02, 2002 at 10:34:32PM +0200, Nightshade wrote: >> Analysis & Solutions wrote: >> >> Document root doensn't solve my problem... >> ... snip ... >> Any solution? > > Read and heed what I already said: > >> > Whenever you have a question like this, run phpinfo() and see what's >> > there which produces the variable you're looking for. > > If that doesn't have what you're looking for, you need to craft your own > solution. > > --Dan > Yea,I understood. But my question is: is right that my Document_root (shown in phpinfo) is /var/www/html/ and not /var/www/html/mysite? And if isn't right where I can change this? tnx again -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stock Prices
On Fri, Mar 29, 2002 at 03:00:29AM +0200, David Russell wrote: > > How would I get recent stock prices in a page? I obviously need to get > this from some source. > > I am looking for local (South African) and international share prices > for a portal-type system. This may or may not be of some assistance: http://www.analysisandsolutions.com/code/phpxml.htm I don't know if it'll obtain South African stocks. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do I split an alphabetical list (array) into A-M and N-Z?
Try looking up in the manual about array_slice (http://us2.php.net/manual/en/function.array-slice.php). -- Joshua E Minnie/CIO [EMAIL PROTECTED] Phone: 616.276.9690 Fax: 616.342.8750 Nextel: 616.862.2847 "Don't work for recognition, but always do work worthy of recognition." "Daevid Vincent" <[EMAIL PROTECTED]> wrote: > Anyone have a function that will take an alphabetical list of names (in > an array already) and split it into two 'chunks' (arrays) A-M and N-Z? > > So, let's say I have: > > Abby Road > BobbyCraft > Darren's doodads > Farenheit 456 > generic name > MyCom.com > Ninety Nine > NoCo > O U 1 > O'reilly Publishing > Oracle > PSI > Test Company > > I want to end up with one array/chunk that has (A-M): > > Abby Road > BobbyCraft > Darren's doodads > Farenheit 456 > generic name > MyCom.com > > And the other that contains (N-Z): > > Ninety Nine > NoCo > O U 1 > O'reilly Publishing > Oracle > PSI > Test Company -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and apache path...
On Wednesday, July 3, 2002, at 11:08 AM, Nightshade wrote: > Yea,I understood. But my question is: is right that my Document_root > (shown > in phpinfo) is /var/www/html/ and not /var/www/html/mysite? And if isn't > right where I can change this? I'm not sure -- is that the directory that you want to be your document root? I doubt it from what you're saying but nobody else has any way of knowing. If you want your document root to be /var/www/html/mysite and it is currently something else, you need to set your httpd.conf file differently. Or perhaps a .htaccess file can be used. (This is assuming you are using Apache.) Go to www.apache.org and read the httpd documentation there for more information about setting up the document root in httpd.conf. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with submit-event script from php.net
Hi there, this is my first time posting. I've set up the event calendar script that http://www.php.net uses on their front page. The only problem I'm having is getting the information from the mysql database to the backend.csv file that it uses. Everything is working properly included the submitting of the events, and the data is being imported correctly. Has anyone used this script before, or maybe has some ideas on what I need to check? Thanks in advance. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stupid PDF...
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Okay, here's a stumper for the gurus: > > Why does PDF just "stop" on some strings and not print them? > [...snip...] > You can even use "View Source" on the HTML to verify that there are no funky > newline characters in the data, as I have. The HTML source looks perfect. This might sound like a stupid question but is there any way that you can look at the source (data) that is being passed to PDF? Maybe something is being screwed up in the array that you are building... The error is definitely consistant which seems to indicate that it's not simply a PDF quirk.. > I know I sound cranky and frustrated -- Sorry. But, well, I am. :-) :)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] cURL in an exec() . more
Bingo! That will work! This is what I do with the modem script. Since there's no PHP function or script for the modem, so I used the C programming that is already written by someone and just use PHP to execute the file. "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message 002901c222a3$8c2a6f00$8102a8c0@niigziuo4ohhdt">news:002901c222a3$8c2a6f00$8102a8c0@niigziuo4ohhdt... > [snip] > Ok from the beginning PHP executes and writes files with > permissions (like userid and groupid) Webserver is running. > So what i think will be the best way for you to do. Is to create an > executable with the same owner. and then execute it. As for > /usr/local/bin directory it allows to write in it only to root or > superuser. I recommend you to create a user like foo > then in his home directory create a subdirectory like web and chmod it > to 777. and use it as an output for the script. Got an idea? > Also you always can use /tmp directory :) > [/snip] > > Apache runs as 'nobody' and 'nogroup', so therefore PHP runs as the same. > (Security, don't you know.) :) I cannot change file owner or group through > PHP. The executable (getlist.sh) is created with the same owner/group. I do > change the file permissions to '755' to allow the file to be an executable. > > {snip] > Try hand writing a script then exec() it from php. > [/snip] > > Tried that, no go. > > crud, I knew this was gonna' happen because of the very tight deadline I am > on. I had a feeling that this is why the original exec(curl) didn't work. > > Thanks, > > Jay > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security: PHP: how to "harden" PHP scripts?
on 03/07/02 11:36 PM, Jean-Christian Imbeault ([EMAIL PROTECTED]) wrote: > In general how does one go about hardening a PHP script. i.e. making it > as "hacker-proof" as possible. General things like: I think the general answer is "you can't", but you can make it more secure. > - verifying user inputted data "verify user inputted data" means nothing... you should take a specific example, like "make sure a text box is less than 500 words, contains only & tags, and starts with a capital letter", and then let us help you solve it. Obviously verifying a date is different to a password, verifying that a certain select box was selected is different from making sure that their phone number contains only numbers, etc etc. The string functions will do most of this for you with very little effort. empty(), isset(), strlen(), is_int(), is_str(), strip_tags(), ereg() & eregi() and many others will all help, but you need to approach them one at a time. You should also be concerned about character sets. If you wanna get anal about it, you should be using register_globals OFF in your php.ini file, and should be treating any $_GET var as unsafe, and same with all other such variables (cookies, sessions, post, etc) > - not putting clear-text passwords in php scripts A thread started in here about two weeks back with the subject "Keeping "Secrets" in PHP Files"... you should read that end-to-end... HEAPS of infomation. > - use "safe-mode"? I have no idea about safe mode. This list really does work best (ie best results for you) if you come to us with a specific problem, rather than something general. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: .htpasswd
"man htpassswd" shows it can be MD5, crypt or SHA. Chris Richard Lynch wrote: >>Does anyone know what encryption is used on passwords in a .htpasswd file? >> > >I *THINK*: > >OS-dependent... > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sample javascript popup+php - newbie
filled in - Original Message - From: "Bogdan Stancescu" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 5:50 PM Subject: Re: [PHP] sample javascript popup+php - newbie > Submitted or filled in? i.e. do you want textbox1 to contain whatever is > in textbox2 or do you want the form in file2.php to be submitted to > file1.php? The difference is that in the first case no PHP gets to run > when button2 is pressed, whereas in the second case file1.php gets to > run with the data in the form in file2.php. > > Bogdan > > adi wrote: > > >hi, > >I want to make an app with properties: > >-i have a file1.php with a textbox1 and button1; when i press button1, file2.php is popup-ed. > >- in file2.php i have textbox2 and button2; when button2 is pressed, file2 is closed, and value of textbox2 is submited to texbox1. > >There is somewere an sample app like this? > > > >tx in adv for any help > >adi > > > > > > > > > > > -- > 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] 15 pieces Puzzle
As I started working on this contest and did not finish it, I will put here the code for this, as this code may help somebody http://www.php9.com/index.php/section/articles -- -- Calin Uioreanu PHP Programmer ciao.com AG www.ciao-ag.com Consumer Access Europewide Phone : +49-89-25 55 1707 Fax : +49-89-25 55 1700 mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another Regex Question (General)
This may sound like a stupid question, but... within a regular expression, are the values in brackets evaluated consecutively, or no? For example: Does [a-zA-Z0-9] (yes, I know [:alnum:] is the same) mean that there can be a number, but it has to follow a letter? Or would you just do [a-zA-Z][0-9] to do that? Elementry, my dear newbie. Hehe. Thanks all! Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] V basic newbie problem
DMX is a little shy on descriptions, but you want to use the "Dynamic Table" under the Application Section. I make these 5 times a day. -Original Message- From: Ray Hunter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 8:52 AM To: PHP GEN; Duncan Ellwood Subject: Re: [PHP] V basic newbie problem try something like this echo ''; while( $result = mysql_fetch_array( $q ) ) { output here... } echo ''; S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: "Duncan Ellwood" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 8:43 AM Subject: [PHP] V basic newbie problem > I'm not sure if this is the right place for this but I'm just starting out > with php and MySQL > > I have succesfully got a database up and I have managed to populate the > first row of the html table with the first row of dynamic content without > too > much problem. I have used the visual enviroment of DW Mx for this and it was > staightforward enough > > My problem arises when I want to fill in the subsequent rows of the table > with the subesquent rows from the database. How do I create the recordset > that will pull the info from the relevant subsequent rows for my columns? > > The code for the first row and first column entry is: > > > > but in the row below in the html table I want to refer to the second row DB > entry for DailyBB but I cant see how to go about this:( The Repeat server > behaviour in DW Mx simply puts all the values in one html cell which is not > what I wish to achieve. Basically I want the html table to match the > database but have only succeeded in getting the first row to display so > far:( > > I'm sure this is simple but its my first time at all this and any help would > be appreciated:) > > TIA > > > > > -- > 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] Stock Prices
On Wednesday, July 3, 2002, 4:12:02 PM, Analysis & Solutions wrote: > On Fri, Mar 29, 2002 at 03:00:29AM +0200, David Russell wrote: >> >> How would I get recent stock prices in a page? I obviously need to get >> this from some source. >> >> I am looking for local (South African) and international share prices >> for a portal-type system. > > This may or may not be of some assistance: > >http://www.analysisandsolutions.com/code/phpxml.htm > > I don't know if it'll obtain South African stocks. Before you go republishing data from Nasdaq.com (or any other site) please be sure that you understand the legal implications of doing so. For 99% of sites (probably 100% of sites providing live market quotes considering the cost of obtaining said data) you need explicit written permission to do it. For example, the following paragraph was taken from the copyright message returned in the XML obtained by the code given by the above link: http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=";> Unless you have a Nasdaq Logo License or other written agreement in effect with The Nasdaq Stock Market, Inc. which states otherwise, you may only provide a hypertext link to the Nasdaq Site on another website, provided that (a) the link must be a text-only link clearly marked "Nasdaq Home Page" or "nasdaq.com", (b) the link must "point" to the URL "http://www.nasdaq.com"; and not to other pages within the Nasdaq Site, (c) the appearance, position and other aspects of the link may not be such as to damage or dilute the goodwill associated with Nasdaq's name and trademarks, (d) the appearance, position and other aspects of the link may not create the false appearance that an entity is associated with or sponsored by Nasdaq, (e) the link, when activated by a user, must display the Nasdaq Site full-screen and not within a "frame" on the linked website, and (f) The Nasdaq Stock Market, Inc. reserves the right to revoke its consent to the link at any time in its sole discretion. Or diluted down to the basic message: You may not republish this information without written permission! -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another Regex Question (General)
On Wednesday, July 3, 2002, at 12:00 PM, Martin Clifford wrote: > Does [a-zA-Z0-9] (yes, I know [:alnum:] is the same) mean that there > can be a number, but it has to follow a letter? Or would you just do > [a-zA-Z][0-9] to do that? That bracketed construction is called a character class. It represents any *one* of the contained characters. But not more than one. So there is no following at all, since for all intents and purposes the character class matches a single character (unless you use a qualifier like +, ?, or *). Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re [PHP] cURL in an exec() . more. SOLVED
It's always the smallest things that will get you, I should be slapped (preferably by a good looking woman) :) exec was not broken the permissions don't have to be mucked with ownership and group can be left alone this should be stamped on the forehead of each and every PHP developer USE FULL PATHS! $bash = "#!/bin/sh"; $curl = "/usr/local/bin/curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html https://theserver.com/download/list.html";; $sh = fopen("/var/www/htdocs/rcr/getlist.sh", "w+"); fputs($sh, $bash."\n\n"); fputs($sh, $curl); fclose($sh); chmod("/var/www/htdocs/rcr/getlist.sh", 0755); exec("/var/www/htdocs/rcr/getlist.sh"); This solved all of the problems. I did the full paths thing during the process of elimination, to remove all doubt about the code. This will make sure that the script can be found and executed. On another note; Had I done this with exec and the cURL statement earlier it would have worked as well. But I think that i am going to keep it this way as it will hopefully make the code clearer. I will have to write more cURL statements later in the script and I can then assemble shell scripts as needed. Thanks for all of your help... Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] cURL in an exec() . more
On Wednesday 03 July 2002 23:08, Jay Blanchard wrote: > {snip] > Try hand writing a script then exec() it from php. > [/snip] > > Tried that, no go. Can we go back to basics? Does: echo shell_exec('ls'); work? If not, are you running in safe-mode? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* QOTD: "It's sort of a threat, you see. I've never been very good at them myself, but I'm told they can be very effective." */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need Help with $_SESSION.
Have not been successful in making this work for 2 days now. I'm focusing on making the $_SESSION to work on each webpages. The 1st page is the login. The 2nd page represent the rest of the webpages on a secure side after logging in. I could use some help in making this work. The $_SESSION does not work on the 2nd page. Since I can't use the register_global(), so I don't see how someone claim that it can work without it. I will appreciate it. --clip-- (Page 1) odbc_fetch_into($result,$_SESSION,1); $salt = strtoupper(md5(uniqid(rand(; session_id($salt); session_start(); header("Location: https://test.whatever/index.php?".SID); --clip-- (Page 2) print_r($_COOKIE); print_r($_SESSION); --clip-- Thanks! FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Re [PHP] cURL in an exec() . more. SOLVED
Ha ha! Just what I mentioned from above. FULL PATH! :-) FletchSOD "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message 003201c222ac$9760ad90$8102a8c0@niigziuo4ohhdt">news:003201c222ac$9760ad90$8102a8c0@niigziuo4ohhdt... > It's always the smallest things that will get you, I should be slapped > (preferably by a good looking woman) :) > > exec was not broken > the permissions don't have to be mucked with > ownership and group can be left alone > this should be stamped on the forehead of each and every PHP developer > > USE FULL PATHS! > > $bash = "#!/bin/sh"; > $curl = "/usr/local/bin/curl -d > \"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html > https://theserver.com/download/list.html";; > $sh = fopen("/var/www/htdocs/rcr/getlist.sh", "w+"); >fputs($sh, $bash."\n\n"); >fputs($sh, $curl); > fclose($sh); > chmod("/var/www/htdocs/rcr/getlist.sh", 0755); > exec("/var/www/htdocs/rcr/getlist.sh"); > > This solved all of the problems. I did the full paths thing during the > process of elimination, to remove all doubt about the code. This will make > sure that the script can be found and executed. > > On another note; > > Had I done this with exec and the cURL statement earlier it would have > worked as well. But I think that i am going to keep it this way as it will > hopefully make the code clearer. I will have to write more cURL statements > later in the script and I can then assemble shell scripts as needed. > > Thanks for all of your help... > > Jay > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php