Re: [PHP] Apache per directory setting
Dear Umesh, I already restart Apache, but it didn't work. OT question: Do Apache's Directory Directive, use relative path or absolute path for matching? Beside, I am using PHP Version 4.2.3 Regards, Chris Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cross Server, Cross Database connection W/ JOINs
On 6 Jan 2004 at 14:10, Jay Blanchard wrote: Does anyone know how, if possible, to connect to two databases on two different network servers so that join queries can be performed (without using temporary tables)? I am using MySQL so mysql_pconnect() or mysql_connect() will insert a default server ('localhost:3306', per the docs) if I do not specify one. Specifying two servers (with the same granted user/pw combo) throws a syntax error. I have tested and searched, but turned up nothing so far. This is an experiment, but I can see where the value would be far ranging for those operating database server farms within their network (data modularization). If you have attempted this sort of (or would like to) thing I'd like to hear your thought, caveats, etc. TIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Jay We are currently developing an application that will have a set of rules dbs sitting on a single server while client data is stored in dbs on different servers (for performance reasons). We are also faced with the issue of only wanting to keep one copy of the rules dbs (to ensure consistency and ease of updating) and using these rules in queries involving client data - i.e. queries using databases on separate hosts. I raised this question (either in this list, or PHP-DB, or MySQL..my memory fails me) and the responses that I got suggested that the only viable option is keeping local copies of the rules db on each client and keeping these updated via replication. Currently we are developing on a single server (client and rules) but we are building the code so we have yet to sort out the replication but that looms ahead of us. If there is a way to do what you suggest, I would be glad to hear about it, and if I could I would happily assist to the best of my meagre abilities as it would definitely make my life simpler. Regards Rory McKinley Nebula Solutions +27 82 857 2391 [EMAIL PROTECTED] There are 10 kinds of people in this world, those who understand binary and those who don't (Unknown) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verifying a url
Kelly Hallman wrote: $is_secure = ($_SERVER['SERVER_PORT']==443) ? true : false ; which can be written more simply $is_secure = $_SERVER['SERVER_PORT']==443; Christophe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suexec/SafeMode Hybrid [repost]
So it's, at the time of this writing, 4:12 AM. My apologies for misposting this into a previous thread, previously. I was looking at my webserver configuration. I am in love with Suexec. It's a gift from god for web hosts. Not only does it secure your directories, but as a bonus it forces your users to keep their stuff secure (i.e. by not running scripts in 777 directories, et al). Wonderful stuff. So then I looked at suexec with php, which pretty much breaks embedded php scripts, and requires that most freely available scripts be modified in a now-unfamiliar and non-standard way, i.e. sticking a php shebang in the scripts. As a bonus, it's slower. So then I found suPHP, and while it looked interesting at first, as it comes with an apache module, and a suid program, I thought it was exactly what I needed. Nope, it still runs in CGI mode. I think there's a couple benefits, but I still think that if PHP had always been a CGI, it would have NEVER gained the popularity it has. So then I had a thought. What about a stub program, similar to suexec, that instead of running all the php scripts and the php CGI binary, merely handles all the file operations that php would. Ideally it would speak to the httpd via pipes or something. This would be similar to the way safe mode presently operates (as in, it would do the same permissions checks on file reads for UID and GID, except that it would, at least for file writes (and optionally, for reads), fork a quick process that handled the file operations. Also, it could possibly do more than UID/GID checks, and actually check permissions, ala suexec. Am I making no sense here? Or is this actually doable? I tend to think if it WAS feasible some other company would have done it and would be selling it now, but in simple terms, I'd love to know why it CAN'T be done. I've thought about the fact that you're still slowed down by the forking of a separate process, but I'd much rather fork only on file writes, while things like SQL-based message boards getting thousands of hits a day still run at full-speed. This would also solve the biggest bane of my existence, the fact that I can't find a half-decent way of making it so that users can't read each others' MySQL login info, usually sitting in the config.php of some script. This would solve that too. (Safe mode would solve it, but safe mode is known for breaking too much else.) Am I insane? If so, please tell me why. How much would I have to donate to the apache foundation to get this feature written if it is feasible? :) -Dan Mahoney -- Goodbye my peoples. I'll miss each one of you. Sniff-Sniff I now know the true meaning of love. Thank you Sniff-Sniff. You are all in my heart. -Chris D. Dan Mahoney Techie, Sysadmin, WebGeek Gushi on efnet/undernet IRC ICQ: 13735144 AIM: LarpGM Site: http://www.gushi.org --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Error/ Warning messages in log files (OS 121) and (OS 64)
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... (Relisted as no response from over Xmas period) Hi, I am having a real problem with error messages posted in the error.log file in the Apache directory. I have been doing lots of searches to find a solution and it seems obvious that many people are see this issue but I can find no resolution or explanation for the entries (see below). PHP Bug #25570 seemed to be a solution but the version of php I am using is 4.3.2 which is claimed to not exhibit the bug described in 25570. The system is running on a Win2K box, and we are using php, sql and Apache. Anyone out there have an idea of how to fix this issue? Thanks Trevor Some system info: System Windows NT UKRBCSR01 5.0 build 2195 Build Date May 28 2003 15:06:05 Server API Apache 2.0 Handler Apache/2.0.47 (Win32) PHP/4.3.2 This is the more worring of the issues: 21:18:49 2003 [notice] Parent: child process exited with status 4294967295 -- Restarting. But I am assuming that some or all of these are related. 21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. : winnt_accept: Asynchronous AcceptEx failed. 00:50:58 2003 [warn] (OS 64)The specified network name is no longer available. : winnt_accept: Asynchronous AcceptEx failed. One or more of the results from http://www.google.com/search?q=Asynchronous+AcceptEx+failed may provide some insight into the problem? Cheers -- Quod subigo farinam A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] picturing webpage
Hello All, I wanted to know if it is possible to picture a webpage via PHP. By picturing I mean that the program can generate a picture, a view, out of the page URL given. (Like sometimes you have in search engines, that you see the site URL and besides is the picture of the first page of the site). What technologies I use for that? Is it possible with PHP? -thanks, Eli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache per directory setting
On Wednesday 07 January 2004 14:18, Chris Lee wrote: You need to use: php_value register_globals 1 I tried, but still fail, phpinfo still show register_globals Off Off Well, it works for me. What versions of apache/php are you using? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I didn't order any WOO-WOO ... Maybe a YUBBA ... But no WOO-WOO! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] INSERT into mysql from dynamic drop down
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 12:07 PM Subject: [PHP] INSERT into mysql from dynamic drop down Hi all, Right now i would like to INSERT the values from a dynamic drop down menu into mysql database but encountered some problem here. Values in the drop down menu are retrieved from DB as follows: SNIP SELECT NAME=tutor_name CLASS=textarea ? $sql = mysql_query(SELECT DISTINCT tutor_name FROM tutor); while ($row = mysql_fetch_array($sql)) { print OPTION VALUE=\$tutor_name\ .$row[tutor_name]. /option; change it to: print OPTION VALUE=.$row['tutor_name']. .$row[tutor_name]. /option; hope that helps } $result = $db-query($sql); ? /SELECT /SNIP -- - echo $_POST[tutor_name]; INSERT statement: $sql = INSERT INTO class (class_code, tutor_name, edu_level, timetable_day, timetable_time) VALUES ('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time' ); -- - I am trying to POST the values and then INSERT into DB but was not able to do so(all other values eg. class_code, edu_level etc...was able to be INSERTED into DB but not tutor_name. So, how do i insert values into DB from a dynamic drop down and where have i gone wrong???Hope to get some help real soon.=) All help are greatly appreciated. Thanks in advance. Regards, Irin. -- 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] hacking sf
I have just downloaded the sourceforge source from sf.net and I am trying to hack it witohut much luck. The login mechanism just doesn't seem to work. It uses manually set cookies instead of inbuild session stuff and I never got it to work like that. I don't know exatcly why but the cookie just never gets set even tho the function is called and there are no complaints. I have put a tarball of the code on my site: http://dev.genestate.com/projects/sf.tar.gz Relevant code is in: include/session.php account/login.php include/user.php The login file calls session_login_valid() which calls various functions including the set_cookie. Please can someone give me a hint? cheers pgp0.pgp Description: PGP signature
[PHP] localhost mail
Using php/apache/mysql on win 98 I am testing an mail script. The script has a .html form which receives the text input and then a .php script to execute the variables in a mail() function. When I publish both files - the .html and .php - to my ISP's server and enter the data and hit submit I receive an e-mail. In my php.ini file I have configured the SMTP to the name of the ISP's email server. However, when testing the same script out locally on Apache Server: I get the form box, enter the data but I do not receive an email. I only use one ISP. Is it possble they have two name servers and that is why I am not receiving an e-mail when testing on Apache Server? Thank you for any help. Best... Tony Ritter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] i need help help with include
Hi I created a directory and files 3 directory's down root/dir1/dir2/dir3/files now i need to include my function file out of the root root/dir/funtionfile How do i do this? I cannot create a htacess file on this server nor set my include path. Can anyone help please Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verifying a url
There is a official variable - $_SERVER['HTTPS'] - that is defined only if https protocol is used. Ivo Pletikosic wrote: It did not work for me but since I have only one http port and one https port on my server i use instead if( $_SERVER['SERVER_PORT'] == 80 ) echo 'http'; C. -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 6:56 PM To: Thomas Andersen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Verifying a url Hello Thomas, Wednesday, January 7, 2004, 2:49:48 AM, you wrote: TA My web site has two different ways to be accessed. One is through a SSL TA connection and the other not. TA Does anyone know how to check either the URL that is being used (https would TA give away the SSL) or if you can check if SSL is being used? I'm pretty sure the following would work: if ($_SERVER['SERVER_PROTOCOL'] == HTTP/1.1) { echo Normal site; } -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] i need help help with include
Hello, Wednesday, January 7, 2004, 2:13:03 PM, you wrote: P now i need to include my function file out of the root P root/dir/funtionfile P How do i do this? P I cannot create a htacess file on this server nor set my include path. Err.. include(/root/dir/functionfile.php); :) You could store the root directory in a variable or something to make life a bit easier for yourself: unset($basedir); $basedir = /root/dir; include($basedir/file1.php); include($basedir/deeper_directory/file2.php); etc Or you could use a constant to do the same thing, but unsetting the variable at the start protects it from over-writing via passthru data. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] i need help help with include
include('../../../functionfile'); or something similar PHP wrote: Hi I created a directory and files 3 directory's down root/dir1/dir2/dir3/files now i need to include my function file out of the root root/dir/funtionfile How do i do this? I cannot create a htacess file on this server nor set my include path. Can anyone help please Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: i need help help with include
hi, is this useful? ?php echo $_SERVER['DOCUMENT_ROOT']; ? hth SVEN Php schrieb: Hi I created a directory and files 3 directory's down root/dir1/dir2/dir3/files now i need to include my function file out of the root root/dir/funtionfile How do i do this? I cannot create a htacess file on this server nor set my include path. Can anyone help please Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] localhost mail
Hello Anthony, Wednesday, January 7, 2004, 1:53:51 PM, you wrote: AR In my php.ini file I have configured the SMTP to the name of the ISP's email AR server. AR However, when testing the same script out locally on Apache Server: I get AR the form box, enter the data but I do not receive an email. AR I only use one ISP. Is it possble they have two name servers and that is AR why I am not receiving an e-mail when testing on Apache Server? It's possible your ISP doesn't allow relaying of mail via their SMTP server from your host, or they have a different SMTP server for this purpose? -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: hacking sf
Hello, On 01/07/2004 11:08 AM, Mat Harris wrote: I have just downloaded the sourceforge source from sf.net and I am trying to hack it witohut much luck. The login mechanism just doesn't seem to work. It uses manually set cookies instead of inbuild session stuff and I never got it to work like that. I don't know exatcly why but the cookie just never gets set even tho the function is called and there are no complaints. I have put a tarball of the code on my site: http://dev.genestate.com/projects/sf.tar.gz Relevant code is in: include/session.php account/login.php include/user.php The login file calls session_login_valid() which calls various functions including the set_cookie. Please can someone give me a hint? Sourceforge has always been an headache to install. You may want to try GForge instead, which is the continuation of the project as Open Source carried by Tim Purdue, one of the lead developers that left VA when they decided to close the source of further Sourceforge development. http://gforge.org/ -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: hacking sf
i noticed 'tpurdue' on the rcs tags above some very nice php code. if he's still something to do with it, i'll give it a go. everyone says sourceforge is hard to install, makes you wonder why such a slick organisation would release such an unpolished source. suppose that they've got to release it somehow. i'll have a look at gforge now. cheers On Wed, Jan 07, 2004 at 12:25:18 -0200, Manuel Lemos wrote: Hello, On 01/07/2004 11:08 AM, Mat Harris wrote: I have just downloaded the sourceforge source from sf.net and I am trying to hack it witohut much luck. The login mechanism just doesn't seem to work. It uses manually set cookies instead of inbuild session stuff and I never got it to work like that. I don't know exatcly why but the cookie just never gets set even tho the function is called and there are no complaints. I have put a tarball of the code on my site: http://dev.genestate.com/projects/sf.tar.gz Relevant code is in: include/session.php account/login.php include/user.php The login file calls session_login_valid() which calls various functions including the set_cookie. Please can someone give me a hint? Sourceforge has always been an headache to install. You may want to try GForge instead, which is the continuation of the project as Open Source carried by Tim Purdue, one of the lead developers that left VA when they decided to close the source of further Sourceforge development. http://gforge.org/ -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php pgp0.pgp Description: PGP signature
Re: [PHP] Re: hacking sf
i have just had a look and although it looks very nice, it is restricted to PgSQL which I do not use (MySQL only). thanks for the suggestion tho Manuel, I am sure I will find a use for that peticular project some other time :) cheers mat On Wed, Jan 07, 2004 at 02:39:56 +, Mat Harris wrote: i noticed 'tpurdue' on the rcs tags above some very nice php code. if he's still something to do with it, i'll give it a go. everyone says sourceforge is hard to install, makes you wonder why such a slick organisation would release such an unpolished source. suppose that they've got to release it somehow. i'll have a look at gforge now. cheers On Wed, Jan 07, 2004 at 12:25:18 -0200, Manuel Lemos wrote: Hello, On 01/07/2004 11:08 AM, Mat Harris wrote: I have just downloaded the sourceforge source from sf.net and I am trying to hack it witohut much luck. The login mechanism just doesn't seem to work. It uses manually set cookies instead of inbuild session stuff and I never got it to work like that. I don't know exatcly why but the cookie just never gets set even tho the function is called and there are no complaints. I have put a tarball of the code on my site: http://dev.genestate.com/projects/sf.tar.gz Relevant code is in: include/session.php account/login.php include/user.php The login file calls session_login_valid() which calls various functions including the set_cookie. Please can someone give me a hint? Sourceforge has always been an headache to install. You may want to try GForge instead, which is the continuation of the project as Open Source carried by Tim Purdue, one of the lead developers that left VA when they decided to close the source of further Sourceforge development. http://gforge.org/ -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php pgp0.pgp Description: PGP signature
[PHP] Max GET size?
I've seen the post_max_size in the php.ini. Is there a corresponding get_max_size? I couldn't find anything about this anywhere in the php.ini or apache.conf. I want to send a lot of information via header(Location: http//server.com/program.php?val[]=1) Is there any limit on size of GET method? James Hicks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Max GET size?
[snip] I've seen the post_max_size in the php.ini. Is there a corresponding get_max_size? I couldn't find anything about this anywhere in the php.ini or apache.conf. I want to send a lot of information via header(Location: http//server.com/program.php?val[]=1) Is there any limit on size of GET method? [/snip] Not on the method itself, but the length of the URL. 255 characters IIRC, but that could have changed by now... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Max GET size?
I believe there is a limit on the length of URLs and since GET actually sends the info through the URL that limit may apply. Hope it helps, Thomas James E Hicks III [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've seen the post_max_size in the php.ini. Is there a corresponding get_max_size? I couldn't find anything about this anywhere in the php.ini or apache.conf. I want to send a lot of information via header(Location: http//server.com/program.php?val[]=1) Is there any limit on size of GET method? James Hicks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] picturing webpage
Hi. Tough one for php since php is a server side scripting langauge as you would have no doubt seen in the list newbie guide. HTML rendering is typically a client side thing. Try java, c++ or if you are on on windows maybe even vb. Eli Hen wrote: Hello All, I wanted to know if it is possible to picture a webpage via PHP. By picturing I mean that the program can generate a picture, a view, out of the page URL given. (Like sometimes you have in search engines, that you see the site URL and besides is the picture of the first page of the site). What technologies I use for that? Is it possible with PHP? -thanks, Eli -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Very confusing problem!
Hey guys, Having a problem with a script I have used before in another project. First off. this is the error I am getting: Fatal error: Call to a member function on a non-object in /services/webpages/a/t/somedomain.com/secure/Store/index.php on line 140 The line of code is this: $paging-query(SELECT * FROM ProductTable); At the top of the page I have this: require(../paging_class.php); I can post the paging_class.php file if anyone needs but it hasn't changed from when I used it on another site. The only thing that has changed is server type (current: Linux previously: BSD). Both are running PHP 4.3.2. ANY help is desparately appreciated! Thanks so much. Aaron
RE: [PHP] Very confusing problem!
you need to instantiate the object before you can use it. -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED] Sent: 07 January 2004 15:32 To: [EMAIL PROTECTED] Subject: [PHP] Very confusing problem! Hey guys, Having a problem with a script I have used before in another project. First off. this is the error I am getting: Fatal error: Call to a member function on a non-object in /services/webpages/a/t/somedomain.com/secure/Store/index.php on line 140 The line of code is this: $paging-query(SELECT * FROM ProductTable); At the top of the page I have this: require(../paging_class.php); I can post the paging_class.php file if anyone needs but it hasn't changed from when I used it on another site. The only thing that has changed is server type (current: Linux previously: BSD). Both are running PHP 4.3.2. ANY help is desparately appreciated! Thanks so much. Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Very confusing problem!
Ahhh! You rock my man! I left out one single line when I copied! What a dolt. Thanks so much!!! Aaron -Original Message- From: Jonathan Wilkes [mailto:[EMAIL PROTECTED] Sent: January 7, 2004 10:36 AM To: Aaron Wolski Subject: RE: [PHP] Very confusing problem! you need to instantiate the object before you can use it -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED] Sent: 07 January 2004 15:32 To: [EMAIL PROTECTED] Subject: [PHP] Very confusing problem! Hey guys, Having a problem with a script I have used before in another project. First off. this is the error I am getting: Fatal error: Call to a member function on a non-object in /services/webpages/a/t/somedomain.com/secure/Store/index.php on line 140 The line of code is this: $paging-query(SELECT * FROM ProductTable); At the top of the page I have this: require(../paging_class.php); I can post the paging_class.php file if anyone needs but it hasn't changed from when I used it on another site. The only thing that has changed is server type (current: Linux previously: BSD). Both are running PHP 4.3.2. ANY help is desparately appreciated! Thanks so much. Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Very confusing problem!
no problem :-) it's an easy one to make Jonathan -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED] Sent: 07 January 2004 15:36 To: Jonathan Wilkes Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Very confusing problem! Ahhh! You rock my man! I left out one single line when I copied! What a dolt. Thanks so much!!! Aaron -Original Message- From: Jonathan Wilkes [mailto:[EMAIL PROTECTED] Sent: January 7, 2004 10:36 AM To: Aaron Wolski Subject: RE: [PHP] Very confusing problem! you need to instantiate the object before you can use it -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED] Sent: 07 January 2004 15:32 To: [EMAIL PROTECTED] Subject: [PHP] Very confusing problem! Hey guys, Having a problem with a script I have used before in another project. First off. this is the error I am getting: Fatal error: Call to a member function on a non-object in /services/webpages/a/t/somedomain.com/secure/Store/index.php on line 140 The line of code is this: $paging-query(SELECT * FROM ProductTable); At the top of the page I have this: require(../paging_class.php); I can post the paging_class.php file if anyone needs but it hasn't changed from when I used it on another site. The only thing that has changed is server type (current: Linux previously: BSD). Both are running PHP 4.3.2. ANY help is desparately appreciated! Thanks so much. Aaron -- 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] POST_QUERY STRING without letting php to parse it.
Greeting ; I want to get the POSTED data as it is without letting php to parse it. for example: if i posted the following from a form : abc=stringabc=string2ayz=string3 I want to get the both abc values ... I tried extract function and all global arrays and $_POST . PLEASE NOTE that I don't want to use GET method. Please Advice Nabil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Very confusing problem!
From: Aaron Wolski [EMAIL PROTECTED] Fatal error: Call to a member function on a non-object in /services/webpages/a/t/somedomain.com/secure/Store/index.php on line 140 The line of code is this: $paging-query(SELECT * FROM ProductTable); At the top of the page I have this: require(../paging_class.php); I can post the paging_class.php file if anyone needs but it hasn't changed from when I used it on another site. The only thing that has changed is server type (current: Linux previously: BSD). Both are running PHP 4.3.2. Do you have $paging = new paging_class(); anywhere to make $paging an actual object? According to the error, you don't, or it's type has been changed. Maybe there was an error in the required file that you're not seeing? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST_QUERY STRING without letting php to parse it.
I want to get the POSTED data as it is without letting php to parse it. You may be thinking of $HTTP_RAW_POST_DATA. You should set the always_populate_raw_post_data config option someplace if you want to use it reliably, though. See configuration directives in the manual. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] (OT?) form question
Hi All, This may be more of an HTML question - can't find anything in the php manual, but I may not know where to look. Is it possible to put the cursor into a form element when a page loads without using javascript? Thanks, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] (OT?) form question
[snip] This may be more of an HTML question - can't find anything in the php manual, but I may not know where to look. Is it possible to put the cursor into a form element when a page loads without using javascript? [/snip] Your (not what you wanted to hear) answer is http://www.w3.org/TR/html4/interact/forms.html#h-17.11 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multibyte/multilingual support
We have a CMS which is written is based on php mysql. Recently we received a request to support multiple languages so that sites in that particular laguage can be created. I did some search on the google and it seems I have to build in multibyte support for php and mysql. Mbstring (http://us3.php.net/mbstring) claims to support multiple languages with a caution saying it might not work properly. After further research it seems unicode might be the way to go, since unicode can represents all characters (in all languages) with integers, which in turn can be handled in php as it has excellent integer support. But again since all the data is store in mysql we need unicode support for mysql too and it has 2 formats (http://www.mysql.com/doc/en/Charset-Unicode.html) usc-2 (for storing data) and utf-8 (for encoding). Finally, we decide to stick with utf-8 as it could support more languages than usc-2 and also since php has utf-8 support. Our application evolved over time and it was not very long ago that we introduced a new DB layer. Even though efforts were made to change code to use this new DB layer, I am afraid there still might be instances where we use the php mysql functions to access db. We use egexes heavily and do a lot of text manipulation, so that rules out any chance of being closer to utf-8. So I am wondering if there are any good approaches to this issue i.e. modify the existing application code minimally to handle utf-8 (that doesn't sound right!) and make it all transparent to the presentation layer. Any suggestions or comments are welcome. Turi http://aijalon.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
Hi! I wanted to know is is there a way to configure PHP to make it not be affected when the web user tamper with the values in the post string after a webpage is submitted or something. (Further explanation below) I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. Fine, no problem. But I noticed one problem, I can changed the value in the URL toolbar of the web-browser and get different result on the webpage. I know it is where $_REQUEST[], $_GET, etc. come into play. So, is there a way to keep that $_REQUEST[], $_GET[] data unchanged? Does this require the php.ini configuration or what? Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Timezone and time() and date()
Hi all: How does the timezone of the server affects the behavior of the functions time and date. Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 7 Jan 2004 17:51:12 -0000 Issue 2517
php-general Digest 7 Jan 2004 17:51:12 - Issue 2517 Topics (messages 173950 through 173988): mail() 173950 by: Anthony Ritter Re: Apache per directory setting 173951 by: Chris Lee 173953 by: umesh 173954 by: Chris Lee 173961 by: Jason Wong INSERT into mysql from dynamic drop down 173952 by: irinchiang.justeducation.com 173956 by: Nitin Mehta Re: Cross Server, Cross Database connection W/ JOINs 173955 by: Rory McKinley Re: Verifying a url 173957 by: Christophe Chisogne 173965 by: Marek Kilimajer Suexec/SafeMode Hybrid [repost] 173958 by: Dan Mahoney Re: Error/ Warning messages in log files (OS 121) and (OS 64) 173959 by: David Robley picturing webpage 173960 by: Eli Hen 173976 by: Raditha Dissanayake hacking sf 173962 by: Mat Harris 173970 by: Manuel Lemos 173971 by: Mat Harris 173972 by: Mat Harris localhost mail 173963 by: Anthony Ritter 173969 by: Richard Davey i need help help with include 173964 by: PHP 173966 by: Richard Davey 173967 by: Marek Kilimajer 173968 by: Sven Max GET size? 173973 by: James E Hicks III 173974 by: Jay Blanchard 173975 by: Thomas Andersen Very confusing problem! 173977 by: Aaron Wolski 173978 by: Jonathan Wilkes 173979 by: Aaron Wolski 173980 by: Jonathan Wilkes 173982 by: CPT John W. Holmes POST_QUERY STRING without letting php to parse it. 173981 by: nabil 173983 by: Mike Migurski (OT?) form question 173984 by: craig 173985 by: Jay Blanchard multibyte/multilingual support 173986 by: Aditya Ivaturi Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox??? 173987 by: Scott Fletcher Timezone and time() and date() 173988 by: Manuel Vázquez Acosta Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Using php/apache/mysql I am testing an mail script. The script has a .html form which receives the text input and then a .php script to execute the variables in a mail() function. When I publish both files - the .html and .php - to my ISP's server and enter the data and hit submit I receive an e-mail. In my php.ini file I have configured the SMTP to the name of the ISP's email server. However, when testing the same script out locally on Apache Server: I get the form box, enter the data but I do not receive an email. I only use one ISP. Is it possble they have two name servers and that is why I am not receiving an e-mail when testing on Apache Server? Thank you for any help. Best... Tony Ritter ---End Message--- ---BeginMessage--- You need to use: php_value register_globals 1 I tried, but still fail, phpinfo still show register_globals OffOff Regards, Chris Lee ---End Message--- ---BeginMessage--- The change of values will take place after you restart the Apache. Try it once. -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:49 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Apache per directory setting You need to use: php_value register_globals 1 I tried, but still fail, phpinfo still show register_globals OffOff Regards, Chris Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Dear Umesh, I already restart Apache, but it didn't work. OT question: Do Apache's Directory Directive, use relative path or absolute path for matching? Beside, I am using PHP Version 4.2.3 Regards, Chris Lee ---End Message--- ---BeginMessage--- On Wednesday 07 January 2004 14:18, Chris Lee wrote: You need to use: php_value register_globals 1 I tried, but still fail, phpinfo still show register_globals Off Off Well, it works for me. What versions of apache/php are you using? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I didn't order any WOO-WOO ... Maybe a YUBBA ... But no WOO-WOO! */ ---End Message--- ---BeginMessage--- Hi all, Right now i would like to INSERT the values from a dynamic drop down menu into mysql database but encountered some problem here. Values in the drop down menu are retrieved from DB as follows: SNIP SELECT NAME=tutor_name CLASS=textarea ? $sql = mysql_query(SELECT DISTINCT
Re: [PHP] Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox
[snip] I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. [/snip] I think if you just change the request method to post, the data will not show up in the url. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
Hello Scott, Wednesday, January 7, 2004, 5:43:31 PM, you wrote: SFI noticed when I use the hidden html input tag with hidden data in it SF then when I click the submit button to submit the webpage, the hidden data SF then show up in the URL address. Fine, no problem. But I noticed one Only if you use the GET method. This won't happen if you use POST. You still need to validate the data at the other end, but it would stop casual URL hacking. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
At 18:43 7-1-04, you wrote: Hi! I wanted to know is is there a way to configure PHP to make it not be affected when the web user tamper with the values in the post string after a webpage is submitted or something. (Further explanation below) I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. Fine, no problem. But I noticed one problem, I can changed the value in the URL toolbar of the web-browser and get different result on the webpage. I know it is where $_REQUEST[], $_GET, etc. come into play. So, is there a way to keep that $_REQUEST[], $_GET[] data unchanged? Does this require the php.ini configuration or what? I think when you change the FORM tag by adding method=POST to it is so the form data are send as POST instead of GET. IN the next page you will then find the form element values in the $_POST array. It takes a lot more of users to tamper with POST data than with GET data. However you can never trust anything coming over the net and there are ways to fake POST data. In the post-form page check whether the referer is from your own site, that will also make it a lot harder. And try to use methods where it does not help the hacker to try to fool you, check their identity on every page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timezone and time() and date()
Hello Manuel, Wednesday, January 7, 2004, 5:48:27 PM, you wrote: MVA How does the timezone of the server affects the behavior of the functions MVA time and date. Quite simply, if you don't provide date() with a timestamp then it will use the local servers timestamp instead. This will be whatever the operating system is configured to be. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] basic ?id=x question
Hello, I'm trying to pull from a database... I can pull an array, but I want to just be able to pull one item instead of all of them... I know somehow you can do this with page.php?id=x... but can't figure it out... any help greatly appreciated, thanks, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: basic ?id=x question
figured it out i had the sort before the where clause and that messed it up. Matt Hedges [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I'm trying to pull from a database... I can pull an array, but I want to just be able to pull one item instead of all of them... I know somehow you can do this with page.php?id=x... but can't figure it out... any help greatly appreciated, thanks, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
Will check into whether did I use the post method correctly. Speaking of session, I don't see how can it be done to put the data into the session after the user click the submit button before going over to the next webpage. FletchSOD Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! I wanted to know is is there a way to configure PHP to make it not be affected when the web user tamper with the values in the post string after a webpage is submitted or something. (Further explanation below) I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. Fine, no problem. But I noticed one problem, I can changed the value in the URL toolbar of the web-browser and get different result on the webpage. I know it is where $_REQUEST[], $_GET, etc. come into play. So, is there a way to keep that $_REQUEST[], $_GET[] data unchanged? Does this require the php.ini configuration or what? Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic ?id=x question
On Wed, 2004-01-07 at 13:44, Matt Hedges wrote: Hello, I'm trying to pull from a database... I can pull an array, but I want to just be able to pull one item instead of all of them... I know somehow you can do this with page.php?id=x... but can't figure it out... That would depend on the contents of page.php Assuming the sql query is something like SELECT * FROM table_name WHERE id=$id; How about posting page.php ? -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org signature.asc Description: This is a digitally signed message part
[PHP] Sorting data into columns vertically
[ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Max GET size?
--- James E Hicks III [EMAIL PROTECTED] wrote: I've seen the post_max_size in the php.ini. Is there a corresponding get_max_size? I couldn't find anything about this anywhere in the php.ini or apache.conf. I want to send a lot of information via header(Location: http//server.com/program.php?val[]=1) Is there any limit on size of GET method? I assume you mean to ask whether there is a limit on the size of the URL, and the answer is yes. However, this depends entirely on the Web server and Web browser involved in a particular transaction. It is not something that is defined in the specification. For example, if your Web server can handle URLs up to 2048 characters in length, and a user's Web browser can only handle URLs up to 256 characters in length, that particular user will have trouble when you use URLs over 256 characters, while other users may be fine. As far as recommendations, I can't recall where I read this (I believe it was on the W3C Web site somewhere), but you can follow these rough guidelines: 256 is very reliably handled by practically every Web agent = 1024 is reliably handled by most modern Web agents 1024 is not generally recommended Of course, the total length of the URL is greater than the query string alone, so you'll have to keep that in mind if you're splitting hairs. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
--- Scott Fletcher [EMAIL PROTECTED] wrote: I wanted to know is is there a way to configure PHP to make it not be affected when the web user tamper with the values in the post string after a webpage is submitted or something. If by after a page is submitted you mean after a page is requested, then you can already be assured that the user cannot tamper with data. Now, don't be mislead by this, but all it means is that if you have code such as: ? $foo = 'bar'; echo $foo; ? Then, regardless of whether register_globals is enabled or what the user may do, you can feel comfortable that this script will output bar. Once your script begins execution, the user's request has been received, and the user cannot take any further action that will manipulate data. Of course, the user can try again on the next request. I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. This happens when you specify a method of GET, do not specify a method, or specify an invalid method (neither POST nor GET). I noticed one problem, I can changed the value in the URL toolbar of the web-browser and get different result on the webpage. Yes, but both GET and POST are sent by the user. Surely you wouldn't trust POST data any more than you would GET. So, is there a way to keep that $_REQUEST[], $_GET[] data unchanged? Does this require the php.ini configuration or what? Absolutely not. This requires that you validate all data from the client. This means GET data, POST data (which may include file uploads), and cookies are potentially dangerous. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upload picture
Hello... could anyone please tell me how to upload a picture using php? I have this input type=file name=picture1 size=20 but don't know how to specify how to store the pictures on the server... thanks! thanks Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload picture
Hello Matt, Wednesday, January 7, 2004, 7:26:31 PM, you wrote: MH input type=file name=picture1 size=20 Well, it's a start :) The size attribute isn't any use though. MH but don't know how to specify how to store the pictures on the server... MH thanks! See: Chapter 18. Handling file uploads of the PHP Manual for source code examples, details and pretty much all you need to know. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload picture
This works for me My Form ?php ? form enctype=multipart/form-data action=savefile.php method=POST input type=hidden name=MAX_FILE_SIZE value=10 Send this file: input name=filename type=file input type=submit value=Send File /form savefile.php ?php // In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of // $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_file() // instead of move_uploaded_file $uploaddir = '/fullDirectoryPath'; $uploadfile = $uploaddir. $_FILES['filename']['name']; print pre; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { print File is valid, and was successfully uploaded. ; print Here's some more debugging info:\n; print_r($_FILES); } else { print Possible file upload attack! Here's some debugging info:\n; print_r($_FILES); } print /pre; ? Matt Hedges wrote: Hello... could anyone please tell me how to upload a picture using php? I have this input type=file name=picture1 size=20 but don't know how to specify how to store the pictures on the server... thanks! thanks Matt -- +-+-++ | Blake Schroeder | Owner/Developer |lhwd.net| +--(http://www.lhwd.net)+--/3174026352\--+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload picture
--- Matt Hedges [EMAIL PROTECTED] wrote: Hello... could anyone please tell me how to upload a picture using php? I have this input type=file name=picture1 size=20 but don't know how to specify how to store the pictures on the server. You should look here: http://www.php.net/manual/en/ref.filesystem.php All you want to do is open a file, write to it, and close it. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload picture
Matt This form is for rtf files you will need to make some changes for it. -Blake Matt Hedges wrote: Hello... could anyone please tell me how to upload a picture using php? I have this input type=file name=picture1 size=20 but don't know how to specify how to store the pictures on the server... thanks! thanks Matt -- +-+-++ | Blake Schroeder | Owner/Developer |lhwd.net| +--(http://www.lhwd.net)+--/3174026352\--+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Identifiying multiple records for databse submission
Sure glad I figured it out myself. :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload picture
--- Chris Shiflett [EMAIL PROTECTED] wrote: All you want to do is open a file, write to it, and close it. I should have read all of your question. :-) I believe you will find that the uploaded file is already on the filesystem, and you can look in $_FILES to find the location. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Magazine Download version
Hi all, Has anyone managed to download the Electronic (PDF) free first issue of the PHP Magazine? (https://www.entwickler.com/ssl/phppdf/) I have registered fine but in the email they sent me, the URL to download just doesn't work. It takes ages (30+ seconds) to connect which I think is the generation of the PDF file, then it tries to save it and I always end up with a file of 0 bytes in size. Maybe it's just too busy/overloaded? -- Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting data into columns vertically
Try this: // Populate an array of random length for ($i = 0; $i rand(300, 600); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / 3); $l_iHigh = ceil($l_iLength / 3); $l_iMod = $l_iLength % 3; $l_iFirst = $l_iHigh; $l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Magazine Download version
--- Richard Davey [EMAIL PROTECTED] wrote: Has anyone managed to download the Electronic (PDF) free first issue of the PHP Magazine? (https://www.entwickler.com/ssl/phppdf/) Quite coincidentally, I downloaded this within the last five minutes to show to a colleague of mine (he was asking questions about session security). I have registered fine but in the email they sent me, the URL to download just doesn't work. It takes ages (30+ seconds) to connect which I think is the generation of the PDF file, then it tries to save it and I always end up with a file of 0 bytes in size. It works fine for me, even using the URL given to me back in early December. I can send you a copy, if you like, since I don't think they would mind. It's a free issue anyway. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting data into columns vertically
$l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); This should actually be: $l_iSecond = ($l_iMod == 1 ? $l_iHigh - $l_iMod : $l_iHigh); but it works both ways. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Matt Grimm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try this: // Populate an array of random length for ($i = 0; $i rand(300, 600); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / 3); $l_iHigh = ceil($l_iLength / 3); $l_iMod = $l_iLength % 3; $l_iFirst = $l_iHigh; $l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting data into columns vertically
I get: Your columns are: 102, 101, 101 ??? The other problem with this solution is that it's for a static number of columns, however I'm looking for a solution with dynamic variables. For example, I might want 4 columns with 100 items, or six columns with 15. Thanks for trying though. adam From: Matt Grimm [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Sorting data into columns vertically Date: Wed, 07 Jan 2004 11:39:48 -0900 Try this: // Populate an array of random length for ($i = 0; $i rand(300, 600); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / 3); $l_iHigh = ceil($l_iLength / 3); $l_iMod = $l_iLength % 3; $l_iFirst = $l_iHigh; $l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: (OT?) form question
Hello Craig, On 7 Jan 2004 at 9:50, craig wrote: This may be more of an HTML question - can't find anything in the php manual, but I may not know where to look. Is it possible to put the cursor into a form element when a page loads without using javascript? PHP does everything it has to do (and can do) on the server, which means it has no control whatsoever over your, or any other user's, browser. It cannot place cursors anywhere. PHP can send to the browser JavaScript code capable of doing what you want, but it's the JavaScript code that would be performing cursor tricks in the browser, not PHP. Take care, Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: web-based and command line mcrypting and back again
Hi, Wednesday, January 7, 2004, 8:54:16 AM, you wrote: GCN Tom, GCN I appreciate the suggestion, but even after setting the iv to zero GCN within the php code and including the --noiv option within the command GCN line; it still does not produce the same base64 encoded string under GCN both methods. GCN I noticed that the command line was keying off of 2 passphrases and the GCN php code off of only 1, so I forced the command line to key off of only GCN 1 passphrase--to no avail. GCN I am obviously missing something. Someone out there has had to have GCN done this at least once before. GCN Any other suggestions would be appreciated. GCN Respectfully, GCN Gary The only way I could get it to work was using an encryption class of mine and a php command line script. The mycrpt command line just didn't get it right. Here is what I did ?php $key = 'test'; $data[] = 'abcdefghijklmnopqrstuvwxyz'; $m = 0; class encrypt_class{ var $secret; function encrypt_class(){ $this-secret = 'test'; } Function encode($id){ $eid = $iv = 0; $len = strlen($id); $id = $len.'-'.$id; $td = mcrypt_module_open(MCRYPT_TripleDES, , MCRYPT_MODE_ECB, ); $key = substr($this-secret, 0, mcrypt_enc_get_key_size ($td)); $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); mcrypt_generic_init ($td, $key, $iv); $eid = base64_encode(mcrypt_generic ($td, $id)); mcrypt_generic_deinit($td); return $eid; } Function decode($eid){ $id = $iv = 0; $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, ); $key = substr($this-secret, 0, mcrypt_enc_get_key_size ($td)); $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); mcrypt_generic_init ($td, $key, $iv); $id = mdecrypt_generic ($td, base64_decode($eid)); $len = strtok($id,'-'); $id = substr($id,(strlen($len)+1),$len); mcrypt_generic_deinit($td); return $id; } } $code = new encrypt_class(); foreach ($data as $dt) { $CRYPT[$m] = $code-encode($dt); $DECRYPT[$m] = $code-decode($CRYPT[$m]); echo crypt_.$CRYPT[$m]._br /\n; echo decrypt_.$DECRYPT[$m]._br /\n; $m++; } ? shell script decode.php 'encrypted string' #!/usr/bin/php ? Function decode($eid){ $secret = 'test'; $id = $iv = 0; $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, ); $key = substr($secret, 0, mcrypt_enc_get_key_size ($td)); $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); mcrypt_generic_init ($td, $key, $iv); $id = mdecrypt_generic ($td, base64_decode($eid)); $len = strtok($id,'-'); $id = substr($id,(strlen($len)+1),$len); mcrypt_generic_deinit($td); return $id; } echo decode($argv[1]) ? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting data into columns vertically
Well you didn't say you wanted a dynamic number of columns... What's the problem with the solution 102, 101, 101? That's the count of the elements in each column -- you said in a 7 member array, you wanted 3 items in the first column, and two in the other two columns. That's 3, 2, 2, which the code will give you. If you want, echo the other variables and it will make more sense. -- Matt Grimm Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I get: Your columns are: 102, 101, 101 ??? The other problem with this solution is that it's for a static number of columns, however I'm looking for a solution with dynamic variables. For example, I might want 4 columns with 100 items, or six columns with 15. Thanks for trying though. adam From: Matt Grimm [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Sorting data into columns vertically Date: Wed, 07 Jan 2004 11:39:48 -0900 Try this: // Populate an array of random length for ($i = 0; $i rand(300, 600); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / 3); $l_iHigh = ceil($l_iLength / 3); $l_iMod = $l_iLength % 3; $l_iFirst = $l_iHigh; $l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirecting and get length problems
In this application I am working on, if there is a problem with the data, I use a redirect to go back to the form and send the data with an error message in a get. That way the user doesn't need to retype everything. Most errors can be caught with java script before they post the form but not all. 3 of the fields in this form are to store various URL's so if they are long URL's it is easy to see how I could go over the limit of the max url length. So my question is what is the best alternative? Is there a way to redirect and use a post instead of a get to send the data? The only other Idea I have is to put the information in a temporary table and just send a get with the key for the record in the table. Chris W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mysql Insert/Update Problem
here is what i am trying to achieve,i have 2 servers. Win2k and linux. mysql is running on my linux server.now i have quite a lot of that i need to update on linux server from win2k machine. here is what i am trying to do.i have a PHP CLI script that will open a dbx file extract records from the dbf file one by one check is the record is already on the linux server (mysql database). if the record is already on the linux server then it will update the mysql database on the linux server. but if the record is not in the mysq database running on linux then it will insert the record. the script is running on win2k server. there are 6 dbf file that i need to extract. comcat.dbf contains 581 records comgrp.dbf contains 79 records comsub.dbf contains 1896 records manuf.dbf contains 793 records prodaux.dbf conatins 17+ records products.dbf conatins 17+ records the script it taking to much time while inserting. it almost 24 hours now and still it isnt finished.what can i do to update the db faster. thanx for any help in advance Haseeb Iqbal.
Re: [PHP] Mysql Insert/Update Problem
Haseeb - I would look at the indexes that it requires for the select statments, if the db isn't indexed properly, it could be just filesorting on each select(when you query to see if the record is in the database on the mysql server). You can find out by putting explain in front of your select query and running it at command line, or whatever you use as a mysql database front end.. This tutorial shows how to use it a little more in depth : http://www.phpexamples.net/tutorial-2-1.html Hope it helps, Rolf Brusletto www.phpexamples.net www.emailfeeds.com Haseeb Iqbal wrote: here is what i am trying to achieve,i have 2 servers. Win2k and linux. mysql is running on my linux server.now i have quite a lot of that i need to update on linux server from win2k machine. here is what i am trying to do.i have a PHP CLI script that will open a dbx file extract records from the dbf file one by one check is the record is already on the linux server (mysql database). if the record is already on the linux server then it will update the mysql database on the linux server. but if the record is not in the mysq database running on linux then it will insert the record. the script is running on win2k server. there are 6 dbf file that i need to extract. comcat.dbf contains 581 records comgrp.dbf contains 79 records comsub.dbf contains 1896 records manuf.dbf contains 793 records prodaux.dbf conatins 17+ records products.dbf conatins 17+ records the script it taking to much time while inserting. it almost 24 hours now and still it isnt finished.what can i do to update the db faster. thanx for any help in advance Haseeb Iqbal. -- Rolf Brusletto rolf[at]emailfeeds[dot]com http://www.emailfeeds.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting and get length problems
--- Chris W [EMAIL PROTECTED] wrote: 3 of the fields in this form are to store various URL's so if they are long URL's it is easy to see how I could go over the limit of the max url length. So my question is what is the best alternative? Is there a way to redirect and use a post instead of a get to send the data? No, thankfully. :-) Imagine how bad it would be if by visiting a Web site, you could be tricked into posting data to some other Web site. The only other Idea I have is to put the information in a temporary table and just send a get with the key for the record in the table. Yes, this is what sessions are, and it sounds like a potentially good option for you. You can read here for more information: www.php.net/session Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
When the page is submitted, set your session vars, then redirect to the next page. Or you can set the session vars before you do any other processing. Scott Fletcher wrote: Will check into whether did I use the post method correctly. Speaking of session, I don't see how can it be done to put the data into the session after the user click the submit button before going over to the next webpage. FletchSOD Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! I wanted to know is is there a way to configure PHP to make it not be affected when the web user tamper with the values in the post string after a webpage is submitted or something. (Further explanation below) I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. Fine, no problem. But I noticed one problem, I can changed the value in the URL toolbar of the web-browser and get different result on the webpage. I know it is where $_REQUEST[], $_GET, etc. come into play. So, is there a way to keep that $_REQUEST[], $_GET[] data unchanged? Does this require the php.ini configuration or what? Thanks, FletchSOD -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql Insert/Update Problem
i have index the db properly. what next?? Haseeb - Original Message - From: Rolf Brusletto [EMAIL PROTECTED] To: Haseeb Iqbal [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 08, 2004 4:04 AM Subject: Re: [PHP] Mysql Insert/Update Problem Haseeb - I would look at the indexes that it requires for the select statments, if the db isn't indexed properly, it could be just filesorting on each select(when you query to see if the record is in the database on the mysql server). You can find out by putting explain in front of your select query and running it at command line, or whatever you use as a mysql database front end.. This tutorial shows how to use it a little more in depth : http://www.phpexamples.net/tutorial-2-1.html Hope it helps, Rolf Brusletto www.phpexamples.net www.emailfeeds.com Haseeb Iqbal wrote: here is what i am trying to achieve,i have 2 servers. Win2k and linux. mysql is running on my linux server.now i have quite a lot of that i need to update on linux server from win2k machine. here is what i am trying to do.i have a PHP CLI script that will open a dbx file extract records from the dbf file one by one check is the record is already on the linux server (mysql database). if the record is already on the linux server then it will update the mysql database on the linux server. but if the record is not in the mysq database running on linux then it will insert the record. the script is running on win2k server. there are 6 dbf file that i need to extract. comcat.dbf contains 581 records comgrp.dbf contains 79 records comsub.dbf contains 1896 records manuf.dbf contains 793 records prodaux.dbf conatins 17+ records products.dbf conatins 17+ records the script it taking to much time while inserting. it almost 24 hours now and still it isnt finished.what can i do to update the db faster. thanx for any help in advance Haseeb Iqbal. -- Rolf Brusletto rolf[at]emailfeeds[dot]com http://www.emailfeeds.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Generating PDF
Thanks, it was a permission issue. Yann On Wed, 2003-12-31 at 11:13, Evan Nemerson wrote: On Wednesday 31 December 2003 09:29 am, Yann Larrivee wrote: Hi i am trying to generate a PDF with PHP5 (latest cvs) and PDFLib 5.0.2 I have this very basic example that i took from php.net and saw the same code on http://www.sitepoint.com/article/1225/1 ?php $pdf = pdf_new(); pdf_open_file($pdf, philosophy.pdf); pdf_begin_page($pdf, 595, 842); $arial = pdf_findfont($pdf, Arial, host, 1); pdf_setfont($pdf, $arial, 10); pdf_show_xy($pdf, There are more things in heaven and earth, Horatio,, 50, 750); pdf_end_page($pdf); pdf_close($pdf); ? But the function pdf_begin_page always return this error messsage. Fatal error: PDFlib error [2100] PDF_begin_page: Function must not be called in 'object' scope in /home/yann/public_html/test/pdf/OrderPdf.class on line 4 Do you have permissions to write to/create philosophy.pdf? Does pdf_begin_page return TRUE or FALSE? What happens when you use for filename (ie create the file in memory)? To me this example seems right, and the function calls seems alright according to the docummentation. Anybody else have seen this probleme befor ? Thanks Yann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Very confusing problem!
Like John said, make sure you have $paging=new paging_class(); or $paging=new paging_class(); Is it exactly the same script (each php page) or is it just the class that is the same? Cause if the latter one, maybe you create an instance of the object in the main file, and not in the included one... If that fails, make sure you turn notices on, make sure the register_globals setting is the same on both servers.. Not sure how, but register_globals seems to be able to break almost anything... -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com Aaron Wolski [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hey guys, Having a problem with a script I have used before in another project. First off. this is the error I am getting: Fatal error: Call to a member function on a non-object in /services/webpages/a/t/somedomain.com/secure/Store/index.php on line 140 The line of code is this: $paging-query(SELECT * FROM ProductTable); At the top of the page I have this: require(../paging_class.php); I can post the paging_class.php file if anyone needs but it hasn't changed from when I used it on another site. The only thing that has changed is server type (current: Linux previously: BSD). Both are running PHP 4.3.2. ANY help is desparately appreciated! Thanks so much. Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting data into columns vertically
Ok, I think this is more what you're looking for. Dynamic columns *and* rows. This work for ya? // How many columns do you want? $l_iColumnWidth = 6; // Populate an array of random length with random values for ($i = 0; $i rand(15, 300); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / $l_iColumnWidth); $l_iHigh = ceil($l_iLength / $l_iColumnWidth); $l_iMod = $l_iLength % $l_iColumnWidth; if ($l_iColumnWidth $l_iLength) { die('Too many columns for this array length!'); } else { echo 'Array length: '.count($l_aTest); } // Do high columns first for ($i = 0; $i $l_iMod; $i++) { $l_aTable[column$i] = $l_iHigh; } // Do the rest for ($i = count($l_aTable); $i $l_iColumnWidth; $i++) { $l_aTable[column$i] = $l_iLow; } echo 'preResult:br /'; print_r($l_aTable); -- Matt Grimm Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I get: Your columns are: 102, 101, 101 ??? The other problem with this solution is that it's for a static number of columns, however I'm looking for a solution with dynamic variables. For example, I might want 4 columns with 100 items, or six columns with 15. Thanks for trying though. adam From: Matt Grimm [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Sorting data into columns vertically Date: Wed, 07 Jan 2004 11:39:48 -0900 Try this: // Populate an array of random length for ($i = 0; $i rand(300, 600); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / 3); $l_iHigh = ceil($l_iLength / 3); $l_iMod = $l_iLength % 3; $l_iFirst = $l_iHigh; $l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Sorting data into columns vertically
given: $num_cols and $num_items $num_with_extra = $num_items % $num_cols; $num_per_col = floor($num_items / $num_cols); the first $num_with_extra columns has $num_per_col+1 items in it and the rest have $num_per_col items in it (not tested in code, but looks okay in theory...) Martin -Original Message- From: Matt Grimm [mailto:[EMAIL PROTECTED] Sent: Thursday, 8 January 2004 9:37 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Sorting data into columns vertically Well you didn't say you wanted a dynamic number of columns... What's the problem with the solution 102, 101, 101? That's the count of the elements in each column -- you said in a 7 member array, you wanted 3 items in the first column, and two in the other two columns. That's 3, 2, 2, which the code will give you. If you want, echo the other variables and it will make more sense. -- Matt Grimm Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I get: Your columns are: 102, 101, 101 ??? The other problem with this solution is that it's for a static number of columns, however I'm looking for a solution with dynamic variables. For example, I might want 4 columns with 100 items, or six columns with 15. Thanks for trying though. adam From: Matt Grimm [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Sorting data into columns vertically Date: Wed, 07 Jan 2004 11:39:48 -0900 Try this: // Populate an array of random length for ($i = 0; $i rand(300, 600); $i++) { $l_aTest[] = '...'; } $l_iLength = count($l_aTest); $l_iLow = floor($l_iLength / 3); $l_iHigh = ceil($l_iLength / 3); $l_iMod = $l_iLength % 3; $l_iFirst = $l_iHigh; $l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from NOD32 1.594 (20040107) __ This message was checked by NOD32 for Exchange e-mail monitor. http://www.nod32.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
Hi Scott, You've discovered one of the basic tenets of form security on the web :) It is crucial that you never trust input from ANY outside source. This means you should do a couple of things: 1) limit the possible input values 2) validate the data type. If you expect a number, use is_numeric(), or a regex like ^[0-9]{1,5}$ (1-5 digit integer), and if your data does not match, stop all processing of the input and raise an error. 3) NEVER execute input from outside sources, instead, use output from the outside to choose between a controlled, limited number of options from within the program, leave nothing open-ended. Don't worry about controlling $_GET, $_REQUEST or $_WHATEVER, just limit the input you expect, and check to make sure it is within the limits you set. Regards, Greg -- phpDocumentor http://www.phpdoc.org Scott Fletcher wrote: Hi! I wanted to know is is there a way to configure PHP to make it not be affected when the web user tamper with the values in the post string after a webpage is submitted or something. (Further explanation below) I noticed when I use the hidden html input tag with hidden data in it then when I click the submit button to submit the webpage, the hidden data then show up in the URL address. Fine, no problem. But I noticed one problem, I can changed the value in the URL toolbar of the web-browser and get different result on the webpage. I know it is where $_REQUEST[], $_GET, etc. come into play. So, is there a way to keep that $_REQUEST[], $_GET[] data unchanged? Does this require the php.ini configuration or what? Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql Insert/Update Problem
Haseeb Iqbal wrote: here is what i am trying to do.i have a PHP CLI script that will open a dbx file extract records from the dbf file one by one check is the record is already on the linux server (mysql database). if the record is already on the linux server then it will update the mysql database on the linux server. but if the record is not in the mysq database running on linux then it will insert the record. the script is running on win2k server. Is this a one time thing that you need to do or is it continuous? If it's a one time thing, why not just dump one database and import it into the other? If continuous, why not enable replication? You could also use the REPLACE() query, which will UPDATE if the row exists and INSERT if it doesn't. Also, if you remove your indexes while you INSERT a bunch of data and then rebuild them afterwards, it'll be faster. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting and get length problems
Chris W wrote: In this application I am working on, if there is a problem with the data, I use a redirect to go back to the form and send the data with an error message in a get. That way the user doesn't need to retype everything. Most errors can be caught with java script before they post the form but not all. 3 of the fields in this form are to store various URL's so if they are long URL's it is easy to see how I could go over the limit of the max url length. So my question is what is the best alternative? Is there a way to redirect and use a post instead of a get to send the data? The only other Idea I have is to put the information in a temporary table and just send a get with the key for the record in the table. Easy way is with sessions. Throw $_GET into session and pull it back out on the next page. $_SESSION['get'] = $_GET; $_GET = $_SESSION['get']; As an alternative, how about you rethink the flow of your page? Make the part that displays your form into a function, class, or include file. Then you can just include it wherever you need it, without the need to actually redirect back to another page. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] script/binary that tracks links through logs
does anyone know of a program/script that tracks incoming links from site that youve traded links with. but not a simple php script that requires the other site to link to www.mysite.com/links_in/12/ but some software that analyses apache access logs for the referer field. this would mean the other site would only have to link www.mysite.com and the script/program would do the rest. if theres none, im writing one. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with while loop
I can't seam to get this while loop to work properly. It should create a message that has the first two lines and then it will list all the domain that meat the criteria. $lines = The following are web sites that are at 95% usage or more of there web space\n; $lines = Site Name Used(MB) Free(MB) Allowed(MB) \n; $result=mysql_query(SELECT * FROM domplans); while($row = mysql_fetch_array($result)){ $dom=$row[domname]; $total=$row[quota]; $result1=mysql_query(SELECT * FROM datasubused where domname = '$dom'); $proccess = mysql_fetch_array($result1); $totalused=$proccess[quotaused]; $totalfree=$total - $totalused; $percent = ceil(100*$totalused/$total); If($percent=95){ $lines = $dom $totalused $totalfree $total \n; for( $i=0;$icount($lines);$i++) { $message .=$lines[$i]; } } echo $message; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with while loop
On Jan 7, 2004, at 10:02 PM, Richard Kurth wrote: I can't seam to get this while loop to work properly. It should create a message that has the first two lines and then it will list all the domain that meat the criteria. $lines = The following are web sites that are at 95% usage or more of there web space\n; $lines = Site Name Used(MB) Free(MB) Allowed(MB) \n; $result=mysql_query(SELECT * FROM domplans); while($row = mysql_fetch_array($result)){ $dom=$row[domname]; $total=$row[quota]; $result1=mysql_query(SELECT * FROM datasubused where domname = '$dom'); $proccess = mysql_fetch_array($result1); $totalused=$proccess[quotaused]; $totalfree=$total - $totalused; $percent = ceil(100*$totalused/$total); If($percent=95){ $lines = $dom $totalused $totalfree $total \n; for( $i=0;$icount($lines);$i++) { $message .=$lines[$i]; } } echo $message; } You are overwriting $lines every time you make an assignment. From the looks of how you create $message, you want $lines to be an array. Try $lines[] = 'whatever' instead of $lines = 'whatever'; - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image Resizing with GD
Hello List, I've tried googling but couldn't come up with anything useful so I'm turning to the list. Could anyone send me a link to a tutorial on how to resize images with GD ? Thanks in advance... -Pete -- perl -e 'print pack(H*, 70766572746573406E79632E72722E636F6D0A)' signature.asc Description: This is a digitally signed message part
RE: [PHP] Image Resizing with GD
There are some really good user notes in the function description for imagecopyresized and imagecopymerge: http://us3.php.net/manual/en/function.imagecopymerge.php http://us3.php.net/manual/en/function.imagecopyresized.php You might also want to do some searching with google for thumbnail functions since most applications of GD image resizing is for creating thumbnails. -M _ From: Peter Vertes [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:21 AM To: [EMAIL PROTECTED] Subject: [PHP] Image Resizing with GD Hello List, I've tried googling but couldn't come up with anything useful so I'm turning to the list. Could anyone send me a link to a tutorial on how to resize images with GD ? Thanks in advance... -Pete -- perl -e 'print pack(H*, 70766572746573406E79632E72722E636F6D0A)'
[PHP] getenv of document_name in php
What is the getenv of document_name in php? -- - Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php