RE: [PHP] back and forward through a result query
Hi Petre Why not use LIMIT in your query? Like this: ?php //open database connection //make query If(!isSet($_GET['entry']) { $_GET['entry']=0; } $sql_query=SELECT id,row1,row2,row3 FROM table WHERE something='$whatever' ORDER BY id ASC LIMIT $_GET['entry'], 10; $sql_id = mysql_query($sql_query,$link) or die(error in query); $prev = $_GET['entry']-10; $next = $_GET['entry']+10; for ($i=0;$imysql_num_rows($sql_id);$i++) { //Get all entries from database $sql = mysql_fetch_assoc($sql_id); //do whatever here echo td.$sql['id']./td; } //navigation Echo .($prev=0?a href=\$PHP_SELF?entry=$prev\ class=\nav\Previous page/a:). .($total_count=$next+1?a href=\$PHP_SELF?entry=$next\ class=\nav\Next page/a:).; ? I hope this helps you. Best regards, Davy Obdam The Netherlands mailto:info;davyobdam.com -Oorspronkelijk bericht- Van: Petre Agenbag [mailto:internet;vsa.co.za] Verzonden: dinsdag 29 oktober 2002 13:07 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] back and forward through a result query Hi I need to do the following, and have a slight idea of how to do it, but I'm not sure... I want to do a select id from table where something = whatever , then I will display all the hits from that query as links to a display page, sending along the id's of the row. On that next page, I will use that id to retrieve the relevant data to display for that specific record, but, I want to have a previous|next function, that will display the relevant data of the previous or next record as was displayed on the original page that showed the list of hits. So I *think* I should create an array containing all the id's of that query, and send it along with the clickthrough to the display page and then from there use the array functions next and prev to get the id's directly adjacent to the one I currently have, but I'm not sure if this is the best way to do it, for one, I don't know how to put those id's into an array from the original query, and two, don't know how to tell it to get prev of current id from array or get next of current id from array. And I think it might be a bit of an unnecessary overhead to send that entire array via GET to the display page if you are only ever going to use 2 values from it, so It would make much more sense to me to pass the current id, the next id and the previous id for each hit along to the display page. Any ideas on how I could do that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Deze e-mail is door E-mail VirusScanner van Planet Internet gecontroleerd op virussen. Op http://www.planet.nl/evs staat een verwijzing naar de actuele lijst waar op wordt gecontroleerd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload several files
http://www.php.net/manual/en/features.file-upload.multiple.php -Kevin - Original Message - From: Andres, Cyrille [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 12:19 PM Subject: [PHP] upload several files Hello everybody, I created a form allowing user to upload some files on my server. It works very fine. But now I would like him -the user- to be able to choose several files and upload them at the same time by submitting the form. Actually I don't really know how to do that, if somebody would have an example or a link to an example where I can check the code, it would be great. 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
[PHP] Re: Cleaning pasted Word text
You might look at the htmlentities() function... On Tue, 29 Oct 2002, a.h.s. boy wrote: I'm working on a PHP-based CMS that allows users to post lengthy article texts by submitting through a form. The short version of my quandary is this: How can I create a conversion routine that reliably substitutes HTML-acceptable output for high-ASCII characters pasted into the form (from a variety of operating systems)? The longer version is this: In order to prevent scripting vulnerabilities and a variety of other undesirable content, I run the body of the text through a cleantext() function. This function first strips out illegal HTML tags and JavaScript. So far so good. Then it attempts to perform some character conversions to clean up 8-bit ASCII characters in the text, so smart quotes, en- and em-dashes, ellipses, etc. are converted to suitable alternative, or to HTML entities. I'm using: // Reference: // chr(133) = ellipsis // chr(145) = left curly single quote // chr(146) = right curly single quote (apostrophe) // chr(147) = left curly double quote // chr(148) = right curly double quote // chr(149) = bullet // chr(150) = en dash // chr(151) = em dash // chr(153) = trademark // chr(160) = non-breaking space // chr(161) = inverted exclamation mark // chr(169) = copyright symbol // chr(171) = left guillemet // chr(173) = soft hyphen // chr(174) = registered trademark // chr(187) = right guillemet // chr(188) = 1/4 fraction // chr(189) = 1/2 fraction // chr(190) = 3/4 fraction // chr(191) = inverted question mark $changearr = array( = , \r=\n, \r\n=\n, \n\n\n = \n\n, chr(133)=..., chr(145)=', chr(146)=', chr(147)=\, chr(148)=\, chr(149)=*, chr(150)=-, chr(151)=--, chr(153)=(TM), chr(160)=nbsp;, chr(161)=iexcl;, chr(169)=copy;, chr(171)=laquo;, chr(173)=-, chr(174)=(R), chr(187)=raquo;, chr(188)=1/4, chr(189)=1/2, chr(190)=3/4, chr(191)=iquest;); $returnstr = strtr($returnstr,$changearr); The server's on a Linux box (RedHat 7.2, standard US installation); users can obviously post from any sort of operating system. This routine seems to work well on Word text pasted in from my Mac (OS X 10.2.1), but I see a number of articles appearing on the site with text like: Wouldnâ(TM)t you say? (That's Wouldn[a circumflex][Euro symbol](TM)t instead of Wouldn't. ...which was almost definitely pasted in from a Windows-based Microsoft Word, and the conversion routines are failing. (And inserting even weirder characters...why would the single quote be replace by _3_ character substitutions?) I understand that Windows may well use a different character set for high-ASCII, but I frankly don't understand how to work that knowledge into this situation. And the combination of original text, Linux , chr(), and ord() stuff just doesn't make sense to me. For example, if I post text (from my Mac) containing only: (that's [open-double-quote][close-double-quote][open-single-quote][close- single-quote][ellipsis]) and have PHP run this: for ($x = 0; $x strlen($str); $x++) { $mailstr .= $str[$x].' is '.ord($str[$x]).\n; } mail('me','Characters',$mailstr); I get mail that says (in parentheses is a description of the character): ì is 147 (accent-grave-i) î is 148 (circumflex-i) ë is 145 (umlaut-e) í is 146 (accent-acute-i) Ö is 133 (umlaut capital o) ...which means that recognizes the correct ASCII value (147) of a double-quote, though my Linux box seems to think that the character is a lowercase i with a grave accent on it. With this kind of strange sub-conversion going on, I'm not all that surprised that things are getting mucked up. Is there some way of getting pasted Word text from Windows clean in this manner, as well as accommodating the already-working-right Mac Word text? Cheers, spud. - a.h.s. boy [EMAIL PROTECTED] dadaIMC support http://www.dadaimc.org/ - -- 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] Cleaning pasted Word text
I think you have posted before and probably didn't get an answer. I'm not going to give you an answer (because I don't have one), but perhaps I can point you in the right direction. Look at http://www.w3.org/TR/REC-html40/charset.html and see if that helps you. Below is a paragraph I pulled from it. The document character set, however, does not suffice to allow user agents to correctly interpret HTML documents as they are typically exchanged -- encoded as a sequence of bytes in a file or during a network transmission. User agents must also know the specific character encoding that was used to transform the document character stream into a byte stream. On Tuesday, October 29, 2002, at 02:20 PM, a.h.s. boy wrote: I'm working on a PHP-based CMS that allows users to post lengthy article texts by submitting through a form. The short version of my quandary is this: How can I create a conversion routine that reliably substitutes HTML-acceptable output for high-ASCII characters pasted into the form (from a variety of operating systems)? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remove/uninstall php3 on linux
tir, 2002-10-29 kl. 19:28 skrev MIke Pogue: Do you have any ideas how could I remove/uninstall an old php3 version on linux? Should I delete the files manually? linux is a many splendored thing. On mine, I go about it exactly the same way as I did on SCO OpenServer, UnixWare and Solaris when I used to compile and install my own Open source software on them. Or I just install over the top of what I had. But that's the easy way. Perhaps you use rpms or apt-gets or suchlike, who can tell?. Best, Tony -- Tony Earnshaw Could have been Henrik Ibsen's, Ole Bull's, Henrik Wergelands's, Camilla Collet's and more's last words, but weren't: «Fanden helder, helder det at have sadset, end det at ikke have sadset i det hele taget.» e-post: [EMAIL PROTECTED] www:http://www.billy.demon.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upgraded php - now some things are different
i do not use the full version php, only the libphp4.so for apache. i was previously using v4.1.2 and recently upgraded a development system to v4.2.3. now, on the devlopement system the following things no longer work as they do on the 4.1.2 systems the PHP_SELF and SERVER_NAME variables are empty and cookies do not work. anyone know what might be happening? thanks, shon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking for a string.
Thanks, figured that out shortly after I posted. Ed On Tue, 29 Oct 2002, John Nichel wrote: http://www.php.net/manual/en/function.preg-match.php Wrong syntax, and more code than needed. Your code would always resolve true (if ($matches[0] = http)). Doing that sets the value of $matches[0] to http. Equality is ==. RTFM. If all you want to know is if the URL contains a http, then... if ( preg_match ( /http/i, $path ) ) { $action = this action; } else { $action = that action; } If you want to know if the URL starts with a http, then... if ( preg_match ( /^http/i, $path ) ) { $action = this action; } else { $action = that action; } [EMAIL PROTECTED] wrote: Seems to work but I'm getting a Warning Message: Delimiter must not be alphanumeric or backslash Here's the code: $path = http://somehost.somedomain.com;; preg_match (http, $path, $matches); if ($matches[0] = http) { $action = this action; } else { $action = that action; } Thanks much, Ed On Tue, 29 Oct 2002, John Nichel wrote: preg_match() [EMAIL PROTECTED] wrote: I'm currently writting a redirect script for my site which will transfer someone to either a external link or a directory on my server. In order to do this I need to use a directive that either contains the directory path or a URL. How do I check the contents of a string to see if it contains http? Thanks, Ed -- 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] upgraded php - now some things are different
[snip] i do not use the full version php, only the libphp4.so for apache. i was previously using v4.1.2 and recently upgraded a development system to v4.2.3. now, on the devlopement system the following things no longer work as they do on the 4.1.2 systems the PHP_SELF and SERVER_NAME variables are empty and cookies do not work. anyone know what might be happening? [/snip] And how long have you been on this list? 1,089,756,004 check register_globals in your php.ini, it is set to off. Previously it was set to on. This was determined to be a security issue. You can a. Turn it back on (restart your web server after you do) or 2. Recode variables. read all about it at http://www.php.net HTH! JB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] upgraded php - now some things are different
eureka! i just actually read that. i have only joined this list today. this is my first ever problem with php, and it turned out to be an easy one. thanks, shon -Original Message- From: Jay Blanchard [mailto:jay.blanchard;niicommunications.com] Sent: Tuesday, October 29, 2002 3:20 PM To: 'Shon Stephens'; [EMAIL PROTECTED] Subject: RE: [PHP] upgraded php - now some things are different [snip] i do not use the full version php, only the libphp4.so for apache. i was previously using v4.1.2 and recently upgraded a development system to v4.2.3. now, on the devlopement system the following things no longer work as they do on the 4.1.2 systems the PHP_SELF and SERVER_NAME variables are empty and cookies do not work. anyone know what might be happening? [/snip] And how long have you been on this list? 1,089,756,004 check register_globals in your php.ini, it is set to off. Previously it was set to on. This was determined to be a security issue. You can a. Turn it back on (restart your web server after you do) or 2. Recode variables. read all about it at http://www.php.net HTH! JB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload several files
I was going to post a similar response to this.. but I do recall that Hotmail uses a form where you select the filename and pop it over to a listbox.. then when you submit, it throws all the files into the email.. one page, one form, any number of files (up to 1 or 2 megs, however hotmail's limiting you these days)... Anyone happen to know how that one works? --Jason Kevin Stone wrote: http://www.php.net/manual/en/features.file-upload.multiple.php -Kevin - Original Message - From: Andres, Cyrille To: Sent: Tuesday, October 29, 2002 12:19 PM Subject: [PHP] upload several files Hello everybody, I created a form allowing user to upload some files on my server. It works very fine. But now I would like him -the user- to be able to choose several files and upload them at the same time by submitting the form. Actually I don't really know how to do that, if somebody would have an example or a link to an example where I can check the code, it would be great. 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
[PHP] headers and cookies
I have one more than one occasion run into the problem of headers already sent when I was using the header function in combination with cookies. What is the right way of doing it? ?php header ( your thinggies here); setcookie(blabal); or the other way round? can I do php routines between these consecutive calls for header and cookie? I know that all headers must be sent before other output but what is the catch here? -- Rolf Vreijdenberger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] headers and cookies
[snip] I have one more than one occasion run into the problem of headers already sent when I was using the header function in combination with cookies. What is the right way of doing it? ?php header ( your thinggies here); setcookie(blabal); or the other way round? can I do php routines between these consecutive calls for header and cookie? I know that all headers must be sent before other output but what is the catch here? [/snip] Well, if you send headers first you cannot send cookies, if you send cookies first you cannot send headers. But you can use the ob functions to fix it. Start here http://www.php.net/manual/en/function.ob-start.php HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and cookies
thanks, I already thought so I'll check it out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST-ing or GET-ing an array
Hi, I disagree that serialize/unserialize is the way to go, unless you're absolutely completely sure that there will only be a relatively small number of things in the array. As somebody mentioned briefly, the get request is limited to a certain number of bytes, and the string representing your serialized array could easily get too large to send on a get request. imho the best option is to use the session, which somebody already mentioned but didn't really elaborate... $_SESSION['my_array'] = $my_array; and on next_page (or any other page), you'd just use $_SESSION['my_array'] where you need. Another option would be to send the request as a post, and serialize the array into a hidden variable in your form; that way you won't have to worry (as much) about size constraints. (a post request is also limited in size, but it's so large that you probably would never approach the limit.) /nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] screen resolution
I am making some pictures for my website in photoshop. Is there anyway I can use php or html to get the screen resolution so that I can load different images accordingly. I know I can just make them all less than 640 pixels wide but then they look to small on most computers. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: headers and cookies
but are you really sure that you cannot use setcookie() and header() at the same time?? I cannot find it anywhere, either in the manuals or in tutorials or in the output control functions! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] screen resolution
PHP runs on the server. It knows nothing about the client. Use Javascript to get information about the client and pass it to your PHP script. -Kevin - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 2:18 PM Subject: [PHP] screen resolution I am making some pictures for my website in photoshop. Is there anyway I can use php or html to get the screen resolution so that I can load different images accordingly. I know I can just make them all less than 640 pixels wide but then they look to small on most computers. Thanks, Eddie -- 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
Fw: [PHP] Re: headers and cookies
http://www.php.net/manual/en/function.setcookie.php And I quote, setcookie() defines a cookie to be sent along with the rest of the header information. Cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP).; If you absolutely must set cookies after you set other headers then use Output Buffering. http://www.php.net/manual/en/function.ob-start.php -Kevin - Original Message - From: rolf vreijdenberger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 1:59 PM Subject: [PHP] Re: headers and cookies but are you really sure that you cannot use setcookie() and header() at the same time?? I cannot find it anywhere, either in the manuals or in tutorials or in the output control functions! -- 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: POST-ing or GET-ing an array
Hi, I disagree that serialize/unserialize is the way to go, unless you're absolutely completely sure that there will only be a relatively small number of things in the array. As somebody mentioned briefly, the get request is limited to a certain number of bytes, and the string representing your serialized array could easily get too large to send on a get request. imho the best option is to use the session, which somebody already mentioned but didn't really elaborate... $_SESSION['my_array'] = $my_array; Exactly. But just to mention it at this point: if you have script-output (echo, print, print_r etc.) before any operation on $_SESSION, you should call start_session() at the start of the script. (I don't know if recent versions of PHP still _need_ this) and on next_page (or any other page), you'd just use $_SESSION['my_array'] where you need. I would suggest, unsetting the array in the next_page (or whatever) after you don't need it anymore: unset($_SESSION['my_array']); Another option would be to send the request as a post, and serialize the array into a hidden variable in your form; that way you won't have to worry (as much) about size constraints. (a post request is also limited in size, but it's so large that you probably would never approach the limit.) /nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: POST-ing or GET-ing an array
You need to call start_session before accessing $_SESSION variables UNLESS you have PHP configured to automatically start_session (which is off by default). You need to start_sesion so that scripts that don't need $_SESSION don't go through the overhead of starting session. Jason -Original Message- From: Sascha Cunz [mailto:Sascha;GaNoAn.org] Sent: Tuesday, October 29, 2002 2:15 PM To: Nick Eby; [EMAIL PROTECTED] Subject: Re: [PHP] Re: POST-ing or GET-ing an array Hi, I disagree that serialize/unserialize is the way to go, unless you're absolutely completely sure that there will only be a relatively small number of things in the array. As somebody mentioned briefly, the get request is limited to a certain number of bytes, and the string representing your serialized array could easily get too large to send on a get request. imho the best option is to use the session, which somebody already mentioned but didn't really elaborate... $_SESSION['my_array'] = $my_array; Exactly. But just to mention it at this point: if you have script-output (echo, print, print_r etc.) before any operation on $_SESSION, you should call start_session() at the start of the script. (I don't know if recent versions of PHP still _need_ this) and on next_page (or any other page), you'd just use $_SESSION['my_array'] where you need. I would suggest, unsetting the array in the next_page (or whatever) after you don't need it anymore: unset($_SESSION['my_array']); Another option would be to send the request as a post, and serialize the array into a hidden variable in your form; that way you won't have to worry (as much) about size constraints. (a post request is also limited in size, but it's so large that you probably would never approach the limit.) /nick -- 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] Secure Connection
This really has little to do with php. Use SSL for the connection (search on your favorite search engine). If you're asking about storage methods of the sensative information, www.php.net/crypt will answer that question. -js Pushpinder Singh Garcha wrote: Hi, I am making a secure page where users will be able to send credit card information. What kind of support does php offer? Thanks Pushpinder Singh Garcha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure Connection
Jonathan Sharp wrote: This really has little to do with php. Use SSL for the connection (search on your favorite search engine). If you're asking about storage methods of the sensative information, www.php.net/crypt will answer that question. Correction: try www.php.net/mcrypt -js -js Pushpinder Singh Garcha wrote: Hi, I am making a secure page where users will be able to send credit card information. What kind of support does php offer? Thanks Pushpinder Singh Garcha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form arrays not populating $_POST
I'm having a problem where $_POST is being populated with the values of a set of checkboxes after moving the script to a new server. The checkbox values appear in the raw post data, the proper number of indexes are created, but the data does't make it into the superglobal. The form similar to the following: form action=?php echo $_SERVER['PHP_SELF']; ? method=post input type=hidden name=test value=Hello input type=checkbox name=some_var[] value=1 1 input type=checkbox name=some_var[] value=2 2 input type=checkbox name=some_var[] value=3 3 input type=submit name=submit value=submit /form The php to check it: ?php if(isset($_POST['some_var'])){ echo pre; echo $GLOBALS['HTTP_RAW_POST_DATA'].\n\n; print_r($_POST); echo /pre; } ? Checking checkbox 1 and 2 and submitting results in the following: test=Hellosome_var%5B%5D=1some_var%5B%5D=2submit=submit Array ( [test] = Hello [some_var] = Array ( [0] = [1] = ) [submit] = submit ) This is running under php 4.2.3 on apache 1.3.20. The script was working fine on the previous server (same php and apache version). The only oddity is that the script utilizes phplib (some_var is registered as a phplib session var), but I'm performing the print_r before any phplib files are included. Has anyone ever encountered this problem? Thanks, mh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] system() function
E... try COM maybe... -js Don Hicks wrote: Hello, I'm running php on a Win2000 server. I also have an MS Access 97 database on the server. I want to tell the database to execute a macro on an as needed basis by running a php system() function, but I'm having difficulty making the action happen. I suspect it's my coding. I'm currently putting the following into my php: system(C:\Program Files\Microsoft Office\Office\MSACCESS.EXE C:\Inetpub\wwwroot\DATABASENAME.mdb /x MACRONAME) The server shows that MS Access is running a process, but it never finishes (seems to hang up). Does anyone have advice for me? Don Hicks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] screen resolution
Try a JavaScript mailing list. - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 2:18 PM Subject: [PHP] screen resolution I am making some pictures for my website in photoshop. Is there anyway I can use php or html to get the screen resolution so that I can load different images accordingly. I know I can just make them all less than 640 pixels wide but then they look to small on most computers. Thanks, Eddie -- 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] Cleaning pasted Word text
Brent -- Thanks for the pointer, but it doesn't really address the problem. I am specifying the character set for the page (ISO-8859-1), and I'm inserting an ACCEPT-CHARSET parameter into the FORM element, but it specifies acceptable charsets as UTF-8, ISO-8859-1, and Windows 1252. The problem isn't accepting or displaying the characters correctly, the problem is figuring out what characters PHP thinks it's looking at! After further investigation, I find that ISO-8859-1 doesn't even use ASCII codes 128-159, so when a user types in a smart quote, it can't _really_ be using Latin 1 (but could be Windows Latin 1). Oddly enough, I've set the page charset to ISO-8859-1 (which doesn't have a smart quote), and my browser is set to Use character set specified by server, and it displays a smart quote just fine with chr(147). If I manually change my browser to use Latin 1, it displays a ? (unknown character symbol). So between browsers, character sets, meta tags, and operating systems, I'm beginning to think that interpreting high-ASCII input is an art rather than a science... spud. On Tuesday, October 29, 2002, at 02:51 PM, Brent Baisley wrote: I think you have posted before and probably didn't get an answer. I'm not going to give you an answer (because I don't have one), but perhaps I can point you in the right direction. Look at http://www.w3.org/TR/REC-html40/charset.html and see if that helps you. Below is a paragraph I pulled from it. --- a.h.s. boy spud(at)nothingness.orgas yes is to if,love is to yes http://www.nothingness.org/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ODBC connectivity
I have developed a PHP application that accesses a Microsoft Access database through ODBC. The application works well using PHP version 4.1. I have recently installed the newest version of PHP (4.2.3) on another machine running NT4, and IIS 4. Again, I am using an ODBC connection, and have given this connection the same name, login, and password as is present in my PHP files. While the PHP module is running fine, I cannot retrieve records from the database, probably indicating a problem with my connectivity to the ODBC. Again, I have made the same settings in the new ODBC entry as is present on the development machine. Could there be a version problem with the PHP module? Any other suggestions would be greatly appreciated. Thanks, Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form arrays not populating $_POST
I Copy and Pasted your code directly from this email and tested it. $GLOBALS['HTTP_RAW_POST_DATA'] never gets set, but the rest of it worked fine. Curious. -Kevin - Original Message - From: Mark Heintz PHP Mailing Lists [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 2:20 PM Subject: [PHP] form arrays not populating $_POST I'm having a problem where $_POST is being populated with the values of a set of checkboxes after moving the script to a new server. The checkbox values appear in the raw post data, the proper number of indexes are created, but the data does't make it into the superglobal. The form similar to the following: form action=?php echo $_SERVER['PHP_SELF']; ? method=post input type=hidden name=test value=Hello input type=checkbox name=some_var[] value=1 1 input type=checkbox name=some_var[] value=2 2 input type=checkbox name=some_var[] value=3 3 input type=submit name=submit value=submit /form The php to check it: ?php if(isset($_POST['some_var'])){ echo pre; echo $GLOBALS['HTTP_RAW_POST_DATA'].\n\n; print_r($_POST); echo /pre; } ? Checking checkbox 1 and 2 and submitting results in the following: test=Hellosome_var%5B%5D=1some_var%5B%5D=2submit=submit Array ( [test] = Hello [some_var] = Array ( [0] = [1] = ) [submit] = submit ) This is running under php 4.2.3 on apache 1.3.20. The script was working fine on the previous server (same php and apache version). The only oddity is that the script utilizes phplib (some_var is registered as a phplib session var), but I'm performing the print_r before any phplib files are included. Has anyone ever encountered this problem? Thanks, mh. -- 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] form arrays not populating $_POST
Like I said, it works fine on any other server. I was wondering if it could be a configuration issue. I believe $GLOBALS['HTTP_RAW_POST_DATA'] is not populated by default by a setting in php.ini. I turned it on to verify that the browser was actually transmitting the data which was missing from the array. Mark. On Tue, 29 Oct 2002, Kevin Stone wrote: I Copy and Pasted your code directly from this email and tested it. $GLOBALS['HTTP_RAW_POST_DATA'] never gets set, but the rest of it worked fine. Curious. -Kevin - Original Message - From: Mark Heintz PHP Mailing Lists [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 2:20 PM Subject: [PHP] form arrays not populating $_POST I'm having a problem where $_POST is being populated with the values of a set of checkboxes after moving the script to a new server. The checkbox values appear in the raw post data, the proper number of indexes are created, but the data does't make it into the superglobal. The form similar to the following: form action=?php echo $_SERVER['PHP_SELF']; ? method=post input type=hidden name=test value=Hello input type=checkbox name=some_var[] value=1 1 input type=checkbox name=some_var[] value=2 2 input type=checkbox name=some_var[] value=3 3 input type=submit name=submit value=submit /form The php to check it: ?php if(isset($_POST['some_var'])){ echo pre; echo $GLOBALS['HTTP_RAW_POST_DATA'].\n\n; print_r($_POST); echo /pre; } ? Checking checkbox 1 and 2 and submitting results in the following: test=Hellosome_var%5B%5D=1some_var%5B%5D=2submit=submit Array ( [test] = Hello [some_var] = Array ( [0] = [1] = ) [submit] = submit ) This is running under php 4.2.3 on apache 1.3.20. The script was working fine on the previous server (same php and apache version). The only oddity is that the script utilizes phplib (some_var is registered as a phplib session var), but I'm performing the print_r before any phplib files are included. Has anyone ever encountered this problem? Thanks, mh. -- 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] File Upload Problem
Hi All I'll start by saying that I've checked the online manual (and comments) as well as having done a Google search on this with no success. My problem is that files uploaded through a form are increasing in size. For example, I upload an image that is 7658 bytes and the uploaded version is 7685 bytes, or upload 11106 bytes and it's 11133 bytes when uploaded. Images uploaded through my form are broken in the process and no longer display. This is only happening on my production server (RH Linux-based). My development environment is Win XP with Apache and PHP and the exact same code works perfectly. I've checked through /etc/php.ini for anything related without success. I use move_uploaded_file() to handle the uploaded file once it's on the server. Can anyone suggest where else I should be looking to resolve this? Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML Post
How do you do a HTML post in php? Thanks -- Wei Weng Network Software Engineer KenCast Inc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload files to MySQL database.
Hi! I am trying to upload files into a MySQL database. The problem is that I cannot upload anything over 1M. It comes up with an error message. Do I need to manually set the values for post_max_size and upload_max_filesize or are these set to the defaults of 8M and 2M, respectively? Thanks in advance. Renato -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cutting off first 4 characters using array input names??
Hi Group, I have a problem where when I use array html input names like value[client_name] PHP cuts off the first 4 characters? example code: input type=text name=value[client_name] value=12345678 / input type=text name=value[student_name] value=12345678 / On the next page there should be a variable called $value with those values inside it. This is how it comes out when I do a print_r straight after on the page its getting posted to. [value] = Array ( [client_name] = 5678 [student_name] = 5678 ) This used to work and return the entire string on our old server (PHP 4.2.2) but we just moved to a new dedicated server (PHP 4.2.3) and now it screwed. Any thoughts? Regards Jarrad Kabral -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Yahoo Moving to PHP (seen on slashdot)
Figured this was important enough to share... Yahoo Moving to PHP http://developers.slashdot.org/article.pl?sid=02/10/29/2052239mode=threadtid=169 Erek Dyskant writes Yahoo has decided to switch from a proprietary system written in C/C++ to PHP for their backend scripting. Here's the notes from a presentation by a Yahoo engineer at PHP Con 2002. http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Post
Open a socket connection, formulate your data, post it to the host. Or do a searchfor the PostToHost() function. Good luck. -Kevin - Original Message - From: Wei Weng [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 3:44 PM Subject: [PHP] HTML Post How do you do a HTML post in php? Thanks -- Wei Weng Network Software Engineer KenCast Inc. -- 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] Need help...
Hi everyone... I've got a little problem : I've got an html template, with javasript functions and stylesheets in many places... This html template is made via a big big template handler i've done... All seems to work... But, now, I would like to clean this html page to procude a 'readable' page If got a page like this : html head /head body xyxyxyxyxyx script function nb1() {} /script y yy style .outter {} /style /body /html And.. I would like to produce a page like this : html head style .outter {} /style script function nb1() {} /script /head body xyxyxyxyxyx y yy /body html Anyone have and idea ? I've tried with some preg_match_all() but... The only that work for me is '/head[^]*(.*)\/head[^]*/si' witch returns the head content... (where I'll add style script contents).. I've tried to change 'head' with 'script' or 'style' but.. It doesn't work... Like I'm not a regex guru ...I'm looking for help.. Regards, P.E. Baroiller -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cleaning pasted Word text
Paste into notepad, the copy the text from notepad. Notepad should remove the high ASCII text. --- Brent Baisley [EMAIL PROTECTED] wrote: I think you have posted before and probably didn't get an answer. I'm not going to give you an answer (because I don't have one), but perhaps I can point you in the right direction. Look at http://www.w3.org/TR/REC-html40/charset.html and see if that helps you. Below is a paragraph I pulled from it. The document character set, however, does not suffice to allow user agents to correctly interpret HTML documents as they are typically exchanged -- encoded as a sequence of bytes in a file or during a network transmission. User agents must also know the specific character encoding that was used to transform the document character stream into a byte stream. On Tuesday, October 29, 2002, at 02:20 PM, a.h.s. boy wrote: I'm working on a PHP-based CMS that allows users to post lengthy article texts by submitting through a form. The short version of my quandary is this: How can I create a conversion routine that reliably substitutes HTML-acceptable output for high-ASCII characters pasted into the form (from a variety of operating systems)? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cleaning pasted Word text
for file maker pro (windows/mac) -- word (windows/mac) function make_safe($text) { $text = preg_replace(/(\cM)/, , $text); $text = preg_replace(/(\c])/, , $text); $text = str_replace(\r\n, , $text); $text = str_replace(\x0B, , $text); $text = str_replace('', , $text); $text = explode(\n, $text); $text = implode( , $text); $text = addslashes(trim($text)); return($text); } function make_safe2($text) { $text = str_replace(\r\n, \n, $text); $text = preg_replace(/(\cM)/, \n, $text); $text = preg_replace(/(\c])/, \n, $text); $text = str_replace(\x0B, \n, $text); $text = addslashes($text); return($text); } cannot remember I why put in two functions ... but anyhow have fun you will probably not the the implode / explode either On Tue, 2002-10-29 at 16:39, Daniel Guerrier wrote: Paste into notepad, the copy the text from notepad. Notepad should remove the high ASCII text. --- Brent Baisley [EMAIL PROTECTED] wrote: I think you have posted before and probably didn't get an answer. I'm not going to give you an answer (because I don't have one), but perhaps I can point you in the right direction. Look at http://www.w3.org/TR/REC-html40/charset.html and see if that helps you. Below is a paragraph I pulled from it. The document character set, however, does not suffice to allow user agents to correctly interpret HTML documents as they are typically exchanged -- encoded as a sequence of bytes in a file or during a network transmission. User agents must also know the specific character encoding that was used to transform the document character stream into a byte stream. On Tuesday, October 29, 2002, at 02:20 PM, a.h.s. boy wrote: I'm working on a PHP-based CMS that allows users to post lengthy article texts by submitting through a form. The short version of my quandary is this: How can I create a conversion routine that reliably substitutes HTML-acceptable output for high-ASCII characters pasted into the form (from a variety of operating systems)? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Post
? // Sends GET or POST, with data, to URL // $form_url:full URI, http://www.isp.com/directory/directory // $form_method: GET or POST // $form_data: associative array of data for GET or POST // $ShowRequest: if set, return the request sent to server // Request text enclosed by request/request // Returns: string with data received from server function GetPost( $form_url, $form_method, $form_data, $ShowRequest=NULL ) { // Build the request data string $request_data = ; if( isset($form_data) ) foreach ($form_data as $name = $value) $request_data .= $name.'='.urlencode($value).; $request_data = substr($request_data,0,-1); // Build the request $url = parse_url($form_url); $form_method = strtoupper($form_method); $request = $form_method. ; switch ($form_method) { case 'GET': $request .= $url['path'].?.$request_data. HTTP/1.0\r\n. Host: .$url['host'].\r\n\r\n; break; case 'POST': $request .= $url['path']. HTTP/1.0\r\n. Host: .$url['host'].\r\n. Content-type: application/x-www-form-urlencoded\r\n. Content-length: .strlen($request_data).\r\n\r\n. $request_data; break; default: die(Invalid method: .$form_method); } // Open the connection $fp = fsockopen($url['host'], 80, $err_num, $err_msg, 30); if ($fp) { if( isset($ShowRequest) ) $response = request$request/request\n; // Submit form fputs($fp, $request); // Get the response while (!feof($fp)) $response .= fgets($fp, 1024); fclose($fp); return $response; } else { echo 'Could not connect to: '.htmlentities($url['host']).'br /'; echo 'Error #'.$err_num.': '.$err_msg; exit; } } //EXAMPLE $mydata['q'] = 'php'; $mydata['start'] = '10'; $qq = GetPost(http://www.google.com/search,GET,$mydata); print $qq; ? - Original Message - From: Wei Weng [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 4:44 PM Subject: [PHP] HTML Post How do you do a HTML post in php? Thanks -- Wei Weng Network Software Engineer KenCast Inc. -- 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] Cutting off first 4 characters using array input names??
Pretty sure this is a known bug; it's been discussed on here a few times. Do a search for it. ---John Holmes... -Original Message- From: Jarrad Kabral [mailto:JarradK;cordell.com.au] Sent: Tuesday, October 29, 2002 6:23 PM To: [EMAIL PROTECTED] Subject: [PHP] Cutting off first 4 characters using array input names?? Hi Group, I have a problem where when I use array html input names like value[client_name] PHP cuts off the first 4 characters? example code: input type=text name=value[client_name] value=12345678 / input type=text name=value[student_name] value=12345678 / On the next page there should be a variable called $value with those values inside it. This is how it comes out when I do a print_r straight after on the page its getting posted to. [value] = Array ( [client_name] = 5678 [student_name] = 5678 ) This used to work and return the entire string on our old server (PHP 4.2.2) but we just moved to a new dedicated server (PHP 4.2.3) and now it screwed. Any thoughts? Regards Jarrad Kabral -- 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] About the code display on php.net
Could someone please fix the function pages on http://www.php.net, so that when people submit code all nice and formatted, it retains that formatting in the contributed notes section? There are some really intricate examples, and it just makes it that much easier to read. Not to mention, the left aligned code detracts from the professional look of an otherwise excellent resource/site. I should think this fix is as simple as using PRE /PRE tags (rather than, or in addition to the code tags you have now). While you're at it, please expand the textarea on this page: http://www.php.net/manual/add-note.php To facilitate someone entering in their code without being squished into these itty bitty 40 column by 6 row spot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sample Meeting Management System
Hi people, Do you know where I can look at a free meeting management system? Nothing too fancy, just something that does the job. Thanks. Regards, Faisal __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple Q!
Hello all, I'm plan to use latest verison of Apache(httpd-2.0.43.tar.gz), PHP(php-4.2.3.tar.gz) and MySql(mysql-3.23.53.tar.gz) combinations. Just i want to conform is there any Vulnerability issues in any of these sources? Advance thanks. Regards, -Shadha
[PHP] MySQL and images
Assuming that I have to for some unknown reason, are there any articles on storing images in the database and retrieving them? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL and images
In order to speed-up queries, it is suggested that you DO NOT store images in the database. Rather, store the images in files and store file names in the database. - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 9:32 PM Subject: [PHP] MySQL and images Assuming that I have to for some unknown reason, are there any articles on storing images in the database and retrieving them? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL and images
Know that, believe that, been preaching that, but I just want to know just in case. Actually found the article. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Tuesday, October 29, 2002 8:46 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] MySQL and images In order to speed-up queries, it is suggested that you DO NOT store images in the database. Rather, store the images in files and store file names in the database. - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 9:32 PM Subject: [PHP] MySQL and images Assuming that I have to for some unknown reason, are there any articles on storing images in the database and retrieving them? -- 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] simple Q!
I'd suggest sticking with Apache 1.3.x for the time being. -Rasmus On Wed, 30 Oct 2002, Rahul wrote: Hello all, I'm plan to use latest verison of Apache(httpd-2.0.43.tar.gz), PHP(php-4.2.3.tar.gz) and MySql(mysql-3.23.53.tar.gz) combinations. Just i want to conform is there any Vulnerability issues in any of these sources? Advance thanks. Regards, -Shadha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL and images
There are times, especially in highly dynamic situations, where backing up and restoring of images and metadata from a database or for security reasons, where storing the images within a database makes real sense. Separating the physical storage areas for the two types of data (metadata images) and keeping the image data from being buffered into the database server's memory space can make storage within the database almost as efficient as file storage. Mark C. Mark C. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] In order to speed-up queries, it is suggested that you DO NOT store images in the database. Rather, store the images in files and store file names in the database. - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 9:32 PM Subject: [PHP] MySQL and images Assuming that I have to for some unknown reason, are there any articles on storing images in the database and retrieving them? -- 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] Cleaning pasted Word text
Errr...I'm not sure how this is applicable to my situation. I'm concerned, above all, with converting curly double quotes curly single quotes em and en dashes inverted exclamation points inverted question marks ellipses non-breaking spaces registered trademark symbols bullets left and right guillemets Many of these characters do not exist in the ISO Latin 1 character set, but can nonetheless be inserted by a browser which defaults to MacRoman or Windows Latin 1 (1252) character sets. The big questions, I suppose, are: 1) What character/ASCII code does PHP interpret (left curly quote) as, when pasted into a form? 2) Does it interpret it the same way pasted in on a Mac as on a Windows box? 3) What influence does the page charset meta tag have on such a submission? 4) What influence does the form ACCEPT-CHARSET parameter have? 5) What influence does the browser encoding setting have on such submissions? and finally, 6) If all of these factors can influence the final interpretation of a character, what's the best way to approach handling all possible combinations? All of this would be s much easier if I'd just get my hands on a Windows box for testing. Guess I'll have to do that. I'm just a bit surprised that no one seems to have tackled this problem already...it can't be that uncommon. Then again, I've seen any number of CMS-driven web sites that obviously haven't this sort of conversion, including large news corporation sites. And given the paucity of Mac-friendly programming on the web, it's not too surprising that so few sites attempt to accommodate Mac users. (Testing for Mac compatibility tends to be on par with testing for Netscape 3.0 compatibility...not usually a very high priority, despite IE 5 for the Mac supposedly being more standards-compliant than the Windows version.) spud. On Tuesday, October 29, 2002, at 08:49 PM, Jimmy Brake wrote: for file maker pro (windows/mac) -- word (windows/mac) function make_safe($text) { $text = preg_replace(/(\cM)/, , $text); $text = preg_replace(/(\c])/, , $text); $text = str_replace(\r\n, , $text); $text = str_replace(\x0B, , $text); $text = str_replace('', , $text); $text = explode(\n, $text); $text = implode( , $text); $text = addslashes(trim($text)); return($text); } function make_safe2($text) { $text = str_replace(\r\n, \n, $text); $text = preg_replace(/(\cM)/, \n, $text); $text = preg_replace(/(\c])/, \n, $text); $text = str_replace(\x0B, \n, $text); $text = addslashes($text); return($text); } cannot remember I why put in two functions ... but anyhow have fun you will probably not the the implode / explode either On Tue, 2002-10-29 at 16:39, Daniel Guerrier wrote: Paste into notepad, the copy the text from notepad. Notepad should remove the high ASCII text. --- Brent Baisley [EMAIL PROTECTED] wrote: I think you have posted before and probably didn't get an answer. I'm not going to give you an answer (because I don't have one), but perhaps I can point you in the right direction. Look at http://www.w3.org/TR/REC-html40/charset.html and see if that helps you. Below is a paragraph I pulled from it. The document character set, however, does not suffice to allow user agents to correctly interpret HTML documents as they are typically exchanged -- encoded as a sequence of bytes in a file or during a network transmission. User agents must also know the specific character encoding that was used to transform the document character stream into a byte stream. On Tuesday, October 29, 2002, at 02:20 PM, a.h.s. boy wrote: I'm working on a PHP-based CMS that allows users to post lengthy article texts by submitting through a form. The short version of my quandary is this: How can I create a conversion routine that reliably substitutes HTML-acceptable output for high-ASCII characters pasted into the form (from a variety of operating systems)? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.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 --- a.h.s. boy spud(at)nothingness.orgas yes is to if,love is to yes http://www.nothingness.org/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and cookies
This is not correct. Both the setcookie() and header() functions manipulate the HTTP headers in the response. You cannot have output prior to any function that manipulates headers - that's the limitation. These two functions work fine together in any order; it's prior output that will cause an error. Chris Jay Blanchard wrote: Well, if you send headers first you cannot send cookies, if you send cookies first you cannot send headers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Decimal Places
Hay guys, I have two variables ( integers ) that are being minused one from the other and i am printing the result to the screen but i am getting unwanted decimals. print ($eall - $sall) / 1000; My question is what is the easiest way to strip decimals off the above result. The only way i know around it is if i piped the above statement into another varible and set that variable to an integer then printed that. I dont really want to do this as i will end up with 50 extra variables. Thanks in advance for your comments. Andrew Wilson Technical Support Netway Networks 8920-8877 Netway Networks Pty Ltd (T) 8920 8877 (F) 8920 8866 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Decimal Places
have a look at number_format() -Original Message- From: Andrew Wilson [mailto:will;netwaynetworks.com.au] Sent: Wednesday, October 30, 2002 3:34 PM To: [EMAIL PROTECTED] Subject: [PHP] Decimal Places Hay guys, I have two variables ( integers ) that are being minused one from the other and i am printing the result to the screen but i am getting unwanted decimals. print ($eall - $sall) / 1000; My question is what is the easiest way to strip decimals off the above result. The only way i know around it is if i piped the above statement into another varible and set that variable to an integer then printed that. I dont really want to do this as i will end up with 50 extra variables. Thanks in advance for your comments. Andrew Wilson Technical Support Netway Networks 8920-8877 Netway Networks Pty Ltd (T) 8920 8877 (F) 8920 8866 -- 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] Upload images to server other than web server?
This topic may have been covered before, but I couldn't find any info on it. We have a Cobalt RaQ4 that serves up all our intranet sites, a couple of which will have forms for uploading files that are related to records stored in a DB. I'm not planning on storing the files in the DB, don't worry. :) However, the files themselves will not be stored on the RaQ, but a different file server on the network which has substantial space for files. What is the best way to go about this? Have the file uploaded to a temp. location on the RaQ and FTP it to its final destination? Or is there a way to automatically redirect the file? I've considered NFS for this, but I'm unsure if the RaQ has tools for mounting NFS shares. Ideas/comments welcome. Thanks. - Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fw: [PHP] Re: headers and cookies
There is no such restriction of cookies. I think what the manual meant to say was that cookies must be sent prior to any output, which is the same restriction any other header has that you wish to set with the header() function, for example. I have forwarded this along to the documentation team. Thanks for pointing it out. Chris Kevin Stone wrote: http://www.php.net/manual/en/function.setcookie.php And I quote, setcookie() defines a cookie to be sent along with the rest of the header information. Cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP).; If you absolutely must set cookies after you set other headers then use Output Buffering. http://www.php.net/manual/en/function.ob-start.php -Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form variables vs Sessions
I am having a problem with a form system that I am developing. It is a multi page form with over a hundred different possible variables. The problem that I'm having is that when a user enters invalid data on one page and then submits to the next page I want that page to go back to the previous page with the form fields already filled in. Currently I have the form going to the previous page with a custom error message, but am having a problem with getting the fields filled in. I pass the variables from page to page by using PHP to convert them to hidden form fields. I have considered using sessions but am concerned with the high overhead due to the number of variables. Any help with this problem would be greatly appreciated.Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] Form variables vs Sessions
Follow your instincts and do some research into sessions. I've put enormous amounts of data into sessions before on high-traffic sites without much trouble. You need to have the memory for it, of course, but it takes a lot of form data to equate to any significant amount. Chances are you'll be just fine. Also, consider that the more data you have in the session, the less data you're passing along in every single request and every single response. You might notice some significant performance improvements. Chris John W wrote: I am having a problem with a form system that I am developing. It is a multi page form with over a hundred different possible variables. The problem that I'm having is that when a user enters invalid data on one page and then submits to the next page I want that page to go back to the previous page with the form fields already filled in. Currently I have the form going to the previous page with a custom error message, but am having a problem with getting the fields filled in. I pass the variables from page to page by using PHP to convert them to hidden form fields. I have considered using sessions but am concerned with the high overhead due to the number of variables. Any help with this problem would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing the variables ...
On 29 Oct 2002 at 9:41, Mukta Telang wrote: I have written followong code in hello.html: FORM ACTION=hello.php METHOD=POST INPUT TYPE=TEXTAREA NAME=textbox ?php printf(BRhello %s!,$textbox); ? This script works fine with php in redhat 7.2 system but does not work in solaris 7 ! I have done the php installation... What are the chances that the problem is with the php-installation? ( I had to copy code from apache2filter directory of pre 4.3 version of php to remove errors during make ) I tried using echo($_GET['$textbox']) instead of printf statement in hello.php.. I tried to snip the above to keep only the necessary. I think you might try using some existing scripts that you know work and then understand why they work. Keep the orginals, make some changes and if something breaks you have the original and you can probably see what you did to break it. This is what I usually do with a new language and only later, sometimes, do I begin to understand the why. I'm learning assembly now and the author tells me I cannot do this with assembly :), I'll see. Couple of things: Perhaps it's a case of globals being off so $textbox doesn't (thank goodness) spring into existence. See the php site: http://www.php.net/manual/en/security.registerglobals.php A VERY helpful site. Check your php.ini file. Run phpinfo() in a script and you'll see the location of your ini file and whether globals are turned on or off. You Use POST in the form but then use $_GET, that should seem odd to you. You also use $_GET['$textbox'] when it should have used $_POST['textbox'], I think, I never use this method, check the php.net site, you can download the documentation.. I personally have a simple function where I put all my user input an array and it matters not whether post or get is used. Here is another example of your hello.html and hello.php. I also highly, highly recommend you look at using Smarty as a templating system. As far as PHP uses OO I suggest you use it (I personally find OO type apps much easier to debug than stream of consciousness types, even my own); hell.html (I apologize for not improving the html) HTML HEAD /HEAD BODY FORM ACTION=hello.php METHOD=POST Benter your name:/B INPUT TYPE=TEXTAREA NAME=textbox INPUT TYPE=SUBMIT /FORM /BODY /HTML hello.php ? $input = ProcessFormData($GLOBALS); function ProcessFormData($GLOBAL_INPUT) { $FormVariables = array(); $input = $GLOBAL_INPUT['HTTP_GET_VARS'] ? $GLOBAL_INPUT['HTTP_GET_VARS'] : $GLOBAL_INPUT['HTTP_POST_VARS']; foreach($input as $Key=$Value) { if(is_array($Value)) { foreach($Value as $SubKey=$SubValue) { $FormVariables[$Key][$SubKey] = $SubValue; } }else { $FormVariables[$Key] = $Value; } } # End of foreach return $FormVariables; } # End ProcessFormData ? HTML HEADtitleHello ? echo $input['textbox']; ?/title/HEAD BODY ?php printf(BRhello %s!,$textbox); print pre; print_r($input); print /pre; ? /BODY /HTML __end Of course I'd put the ProcessFormData in some included file, not in a php file as such. Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Form variables vs Sessions
Apologies if I'm being too simplistic here, but make sure that your first page's form elements have something similar to: input type=text name=username value=? echo $username; ? And of course.. that your POST data is being grabbed accordingly by the first page to be able to set those variables. Maybe this helped? -Jason John W wrote: I am having a problem with a form system that I am developing. It is a multi page form with over a hundred different possible variables. The problem that I'm having is that when a user enters invalid data on one page and then submits to the next page I want that page to go back to the previous page with the form fields already filled in. Currently I have the form going to the previous page with a custom error message, but am having a problem with getting the fields filled in. I pass the variables from page to page by using PHP to convert them to hidden form fields. I have considered using sessions but am concerned with the high overhead due to the number of variables. Any help with this problem would be greatly appreciated.Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Upload images to server other than web server?
Does it have direct access to this filesystem? Or maybe FTP access? I've seen a lot of talk about automatic FTP transfers on the list, maybe you can filter the topics and grab something from there? Just a few cents to throw in :) -Jason Greg Macek wrote: This topic may have been covered before, but I couldn't find any info on it. We have a Cobalt RaQ4 that serves up all our intranet sites, a couple of which will have forms for uploading files that are related to records stored in a DB. I'm not planning on storing the files in the DB, don't worry. :) However, the files themselves will not be stored on the RaQ, but a different file server on the network which has substantial space for files. What is the best way to go about this? Have the file uploaded to a temp. location on the RaQ and FTP it to its final destination? Or is there a way to automatically redirect the file? I've considered NFS for this, but I'm unsure if the RaQ has tools for mounting NFS shares. Ideas/comments welcome. Thanks. - Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple Q!
Hello, Thanks for all reply. Shall i take as there is no vulnerability in php and mysql? I plan to use apache-1.3 series with same (as i speciifed in previous mail) php and mysql? can i use those(apache,php and mysql) in production use? agian thanks... Regards, -sahda I'd suggest sticking with Apache 1.3.x for the time being. -Rasmus On Wed, 30 Oct 2002, Rahul wrote: Hello all, I'm plan to use latest verison of Apache(httpd-2.0.43.tar.gz), PHP(php-4.2.3.tar.gz) and MySql(mysql-3.23.53.tar.gz) combinations. Just i want to conform is there any Vulnerability issues in any of these sources? Advance thanks. Regards, -Shadha -- 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: Upload images to server other than web server?
I will give the search a try tomorrow morning. But I can give direct access to the filesystem for one folder on the RaQ if needed as a temporary holding place. In my head it seems to be the best option I have. I'll see what my search results come up with tomorrow. On Tue, 2002-10-29 at 23:38, Jason Young wrote: Does it have direct access to this filesystem? Or maybe FTP access? I've seen a lot of talk about automatic FTP transfers on the list, maybe you can filter the topics and grab something from there? Just a few cents to throw in :) -Jason Greg Macek wrote: This topic may have been covered before, but I couldn't find any info on it. We have a Cobalt RaQ4 that serves up all our intranet sites, a couple of which will have forms for uploading files that are related to records stored in a DB. I'm not planning on storing the files in the DB, don't worry. :) However, the files themselves will not be stored on the RaQ, but a different file server on the network which has substantial space for files. What is the best way to go about this? Have the file uploaded to a temp. location on the RaQ and FTP it to its final destination? Or is there a way to automatically redirect the file? I've considered NFS for this, but I'm unsure if the RaQ has tools for mounting NFS shares. Ideas/comments welcome. Thanks. - Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Greg Macek | Senior IT Manager Marketing Resources, Inc. 630.530.0100 [EMAIL PROTECTED] | http://www.mrichi.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple Q!
Of course there is no known vulnerabilities or we would have fixed them. On Wed, 30 Oct 2002, Rahul wrote: Hello, Thanks for all reply. Shall i take as there is no vulnerability in php and mysql? I plan to use apache-1.3 series with same (as i speciifed in previous mail) php and mysql? can i use those(apache,php and mysql) in production use? agian thanks... Regards, -sahda I'd suggest sticking with Apache 1.3.x for the time being. -Rasmus On Wed, 30 Oct 2002, Rahul wrote: Hello all, I'm plan to use latest verison of Apache(httpd-2.0.43.tar.gz), PHP(php-4.2.3.tar.gz) and MySql(mysql-3.23.53.tar.gz) combinations. Just i want to conform is there any Vulnerability issues in any of these sources? Advance thanks. Regards, -Shadha -- 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] simple Q!
If you download the most recent *stable* version of MySQL and PHP, and hook them up to the latest, *stable* release of apache 1.3.x, then you the most reliable production set-up available. Justin on 30/10/02 3:47 PM, Rahul ([EMAIL PROTECTED]) wrote: Hello, Thanks for all reply. Shall i take as there is no vulnerability in php and mysql? I plan to use apache-1.3 series with same (as i speciifed in previous mail) php and mysql? can i use those(apache,php and mysql) in production use? agian thanks... Regards, -sahda I'd suggest sticking with Apache 1.3.x for the time being. -Rasmus On Wed, 30 Oct 2002, Rahul wrote: Hello all, I'm plan to use latest verison of Apache(httpd-2.0.43.tar.gz), PHP(php-4.2.3.tar.gz) and MySql(mysql-3.23.53.tar.gz) combinations. Just i want to conform is there any Vulnerability issues in any of these sources? Advance thanks. Regards, -Shadha -- 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] Agata Report: new version
Univates, October, 22, 2002 I've just published the version 3 of Agata Report = http://agata.codigolivre.org.br ::: Agata Report is a Report Generator writen in PHP-GTK using Pear:DB. ::: further information at the end of message. * Currently, Agata has support to English, Portuguese, Italian, French, German and Swedish; * Agata connects to PostgreSQL, MySQL, Oracle, SyBase, MsSql, FrontBase, Informix and InterBase. But Agata was enough tested only with PostgreSQL, Informix, MsSql, InterBase, MySQL and DB2; These new features have been developed since version 3 beta 001. - theme support (skins) of gtk.themes.org; - DBF import into SQL DataBase; - Project manager; - User's manual in english and portuguese; - New SQL Statements; - Prepared for DB2; - Easy installation for Windows; A new version 4.0 has been prepared with a lot of visual changes. FURTHER INFORMATION === Agata Report is a Report Generator, written in PHP-GTK. Allows you to edit and get SQL results from several Databases as Text or PostScript Files. It connects to database, lists its tables, fields and allows linking among tables, make constraints, orders, to apply functions and make queries. It generates results to PostScript or Text file. Agata Report has some usefull tools: * Agata EIS is a graph generator tool. Allows user to define a couple of SQL instructions to get information from DataBase. These informations (numeric columns) will be drawed as lines, column or pizza graph. User can also export the data as CSV format, in order to use them in some spread sheet like gnumeric or kspread. * Merge tool allows you to write any document (f.i. letter) and insert any variable from a SQL query into it. You may define SubQueries within the document, too. There are several symbols, lines and fonts you can use. Merge tool generates a PostScript file; * Label tool is a (mini Merge Tool) that is usefull to generate address labels. You can define any format of label, inserting the fields wherever you like. The labels will be generated in a 2 columns A4 paper (PostScript File); * Dia tool is a Diagram generator tool. Through this option you can generate a Diagram (DIA Format) with all the tables you are working on. Dia tool doesn't establish the lines among the tables in the Diagram yet. Pablo Dall'Oglio Univates IT team. -- +--+ | _Pablo Dall'Oglio ([EMAIL PROTECTED]) | | °v° Univates - IT Department +55 51 3714-7040 | | /(_)\ Life is a jorney, not a destination...| | ^ ^ Linux User n.223253, Lajeado, RS - Brasil | +--+ : Programmer, pilot, wine taster and a half musician -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sample Meeting Management System
Try these http://www.hotscripts.com/PHP/Scripts_and_Programs/Groupware_Tools/ http://www.hotscripts.com/search/?query=meetingcategory=php olinux --- Faisal Abdullah [EMAIL PROTECTED] wrote: Hi people, Do you know where I can look at a free meeting management system? Nothing too fancy, just something that does the job. Thanks. Regards, Faisal __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Yet another question
Yes if you include the file include (file); then you can refer to any of the variables the file contains Trasca Ion-Catalin wrote: It's posible to call a variable from another file? -- Trasca Ion-Catalin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php