Re: [PHP] way to write mysqli result set to disk
couldn't you serialize the data and store it? On 1/25/06, David Hall [EMAIL PROTECTED] wrote: James Benson wrote: jonathan wrote: hmm is this a mysql 5 feature. could be interesting but haven't heard much about it. You cannot see the mysql 5 plastered all over the page? I can see at least 5 different sections that say MySQL 5 you obviously don't use the mysql website enough to know that just cause you're looking in the mysql 5 manual, its a mysql 5 feature. http://dev.mysql.com/doc/refman/4.1/en/query-cache-in-select.html That's proof it was before mysql 5, because mysql 5 isn't plastered everywhere . . . Your reply was rude and unintelligent (Oh noes . . . http://dev.mysql.com/doc/refman/5.1/en/select.html Select statements are a mysql 5.1 only feature. We're gonna die . . .) David Hall -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] PHP not seeing MySQL functions
ah sorry, i assumed windows box On 1/22/06, John Nichel [EMAIL PROTECTED] wrote: PHP Superman wrote: did you uncomment the line that adds the proper php module(mysqli_blahblahblah.dll)? How would loading the mysqli modules help the poster with the mysql functions? How would loading Windoze dll's help the poster on a Linux box? On 1/16/06, Jonathan Duncan [EMAIL PROTECTED] wrote: I just got a new web server with RedHat Enterprise Linux 4 on it. It came -^ with MySQL 4.1.x and PHP 4.3.9 on it. I uninstalled the MySQL 4 and put MySQL 5 on it. When I run a PHP script that has a DB connection in it I get: Fatal error: Call to undefined function: mysql_connect() in ---^ OP, chance are, your RHEL box has the improved mysql (mysqli) libriaries set-up. Try mysqli_connect. If this isn't the case, then your libraries are not being loaded when you start Apache. Check your error logs. http://us2.php.net/mysqli -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] security of uploaded gif files
i think you guys are talking about the using the gd library, it may be possible so when you upload check for any php code or other data On 1/22/06, Rory Browne [EMAIL PROTECTED] wrote: I'd be a bit skeptical about the possibly of embedding PHP code inside a GIF file. Could you outline how he performed the task? On 1/22/06, jonathan [EMAIL PROTECTED] wrote: what is the best way to prevent malicious code from being uploaded via a .gif file? A friend showed me how php could be embedded within the .gif file. Does this problem also exist for .jpeg's? thanks, jon -- 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 -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] security of uploaded gif files
sorry guys if i'm wrong, but ?php header(Content-type: image/png); $im = imagecreate(1, 1) or die(Cannot Initialize new GD image stream); $background_color = imagecolorallocate($im, 252, 255, 255); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1000, 1000, 1000, My Text, $text_color); imagepng($im); imagedestroy($im); ? if you have the required gd library, and a user changes the above to exec(); a command, you might be in trouble, i might be wrong though... but if you successfully hide the directory and dont tell the user where he placed the file i think it would be pretty secure On 1/22/06, Sameer N Ingole [EMAIL PROTECTED] wrote: Rory Browne wrote: I'd be a bit skeptical about the possibly of embedding PHP code inside a GIF file. Could you outline how he performed the task? On 1/22/06, jonathan [EMAIL PROTECTED] wrote: what is the best way to prevent malicious code from being uploaded via a .gif file? A friend showed me how php could be embedded within the .gif file. Does this problem also exist for .jpeg's? thanks, jon If it is really possible, I am very much interested in knowing. jon, can you show how to do that? Regards, -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] PHP not seeing MySQL functions
did you uncomment the line that adds the proper php module(mysqli_blahblahblah.dll)? On 1/16/06, Jonathan Duncan [EMAIL PROTECTED] wrote: I just got a new web server with RedHat Enterprise Linux 4 on it. It came with MySQL 4.1.x and PHP 4.3.9 on it. I uninstalled the MySQL 4 and put MySQL 5 on it. When I run a PHP script that has a DB connection in it I get: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/mysqltest.php on line 5 I check the PHPINFO and see: Configure Command has '--with-mysql=shared,/usr' And dbx supported databases has 'MySQL' However, there is no MySQL section. I checked in the '/etc/php.ini' file and see: [MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off What is missing that would keep me getting the missing functions error? I restarted apache of course. Thanks, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] Access Client IP address
$_SERVER['REMOTE_ADDR'] will give you the proxy ip if they have one, and the browser sends the info, the user might change it to blahblahblah for all we know... On 1/4/06, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Is there any way to client's IP address inside a php document. I am trying to generate a code that depends on the IP address of the client. [/snip] http://us3.php.net/manual/en/reserved.variables.php#reserved.variables.serve r $_SERVER['REMOTE_ADDR'] but it may not always be reliable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] input validation?
input type=text maxlength=300 I think the attribute is called maxlength but i'm not sure, oh well add the maxlength attribute to your input tag to have a quick, clean non-javascript-realiant solution On 1/12/06, John Meyer [EMAIL PROTECTED] wrote: Stut wrote: Ok, you're clearly missing my point and while I don't want this to degrade into the usual pissing contest I do feel I need to clarify what I was saying. I completely agree that in this case Javascript should be used to provide the user with feedback as to how close to the limit they are. However, in your post you described the solution as either Javascript *or* PHP when the best solution is both. What I was pointing out is that while Javascript is a better solution from a usability point of view, not doing the validation with PHP is dangerous regardless of whether the length is validated using Javascript or not. I certainly don't believe that PHP is the total solution for most situations, but when it comes to input validation you *need* to do validation on the server-side regardless of what validation you do with Javascript since you have no control over whether the Javascript gets executed. This sounds almost like the old DB vs. Application logic debate I see on several mailing lists; whether you should store more logic in the DB Server through triggers or through application logic. My point on this is that it boils down to how important that data is. If it's somebody's comments on their blog or on a post, I'd just leave it on the application _or_ trim it down to the 300 characters and input it in. bank transactions, I'd have so many triggers going it would be unreal. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
[PHP] Problems requesting page
Hey everyone, i'm on a windows box with PHP 5 on Apache 2 and I have a strange problem. When i try to access a page it seems to be blank, before it always worked but now it sudenly stopped. I am not a big computer techy but i cleared IE's cache and it still doesen't work. Source Code in IE for requested Page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META http-equiv=Content-Type content=text/html; charset=windows-1252/HEAD BODY/BODY/HTML Code in requested page: ?php require_once(Include.php); Init(1); ? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional// http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head ?php Init(2); ? titleRegister for an account/title /head body ?php Init(3); ? form action=RegisterP.php name=Register method=post Username: input type=text name=Username / br / Password: input type=password name=Password / br / Confirm your password: input type=password name=PasswordCheck br / E-mail Address: input type=text name=EMail / br / input type=submit value=Submit /form ?php Init(4); ? /body /html
Re: [PHP] mysqli class not found
What OS are you using? I think that you entered the wrong filename. for windows i use php_mysqli.dll . Somewhere in php.ini there is a list of extensions you can use, uncomment the php_mysqli.dll , copy php_mysqli.dll to the php install directory and change the php.ini extension setting to your php install directory, that should fix the problem . On 12/29/05, Erik Saline [EMAIL PROTECTED] wrote: Thanks I deleted the new. I was following an example in the book for that. Now I get the error: Call to undefined function mysqli_connect() in /var/www/cgi-bin/db_connect.php on line 4, I added extenstion=mysqli.so to my php.ini Erik - Original Message - From: PHP Superman [EMAIL PROTECTED] To: Erik Saline [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Wednesday, December 28, 2005 6:56 PM Subject: Re: [PHP] mysqli class not found you are not missing anything, you are actually adding to much. Using new is for making objects, if you take away the new in the $result variable declaration it should work fine. On 12/28/05, Erik Saline [EMAIL PROTECTED] wrote: - Original Message - From: Erik Saline To: php-general@lists.php.net Sent: Wednesday, December 28, 2005 1:08 PM I installed Apache, PHP, and Mysql during the Fedora Core 4 installation. PHP 5.0.4 MYSQL 4.1.14 I used php -i to show that mysql and mysqli were installed. Configure Command = './configure' '--build=i386-redhat-linux' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' ' Here is the code. $result = new mysqli_connect('localhost', 'nobody', 'test', 'godisdead'); Here is the error. PHP Fatal error: Class 'mysqli' not found in /var/www/cgi-bin/db_connect.php on line 4, What am I missing? Erik -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now! -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] Variables and Strings
Thanks for the responses guys, but what i'm saying is i would like to return all the variable names i have in a string, $String=Blah Blah Blah $VarName Blah Blah Blah; $Vars=myspecialfunction($Varname); echo ($Vars); that code would produce $Varname, if there were more variables it would also return the Variable Names in an array On 12/29/05, Jochem Maas [EMAIL PROTECTED] wrote: PHP Superman wrote: Hey everyone, is there a way to return all the variables from a string into an array, for example $Var1=Yo; $Var2=Man; $SQL=SELECT * FROM tblname WHERE 4=$Var1 AND WHERE 3=$Var2; $AllVars=MySpecialFunction($SQL); your function MySpecialFunction() will recieve the following string: SELECT * FROM tblname WHERE 4=Yo AND WHERE 3=Man which apart from being (probably) incorrect SQL, is just a string - how is your special function supposed to tell which chars are part of the previously injected variables' values - and even more impossible: how would the function find out what those variables we're called to begin with (it can't). what is it you would like to achieve? rgds, jochem PS - learn to walk before you fly ;-) print_r($AllVars); would ideally print an array like: { array $Var1=Yo $Var2=Man } i think i should use an ereg or preg replace but I don't know much about them or how to use them, thanks in advance -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] Earlier versions hurt PHP 5
On 12/28/05, PHP Superman [EMAIL PROTECTED] wrote: I agree with Greg, if you guys don't care about new versions lets all downgrade to Pentium 1 computers using dial up, if we don't move from PHP 4 to PHP 5 now, then when PHP 6 comes with a truckload of new features and changes to programming standard people who use PHP 4 will have a lot of problems with their PHP 4 compatible code. I'm not trying to be harsh to you guys because it's really the web hosting company's fault but we should all upgrade to PHP 5 unless you are using PHP-Nuke or something like that. On 12/19/05, Greg Donald [EMAIL PROTECTED] wrote: On 12/19/05, PHPDiscuss - PHP Newsgroups and mailing lists [EMAIL PROTECTED] wrote: As a developer, I would love to use PHP 5+ for applications but I am afraid to do so because 90% of web hosting companies do not offer it. The biggest reason that that they do not offer it is because there is little demand for it. The reason why there is little demand for it is that developers do not use it because webhosts do not support it. A classic catch 22 situation! I fail to see what this has to do with a 1961 novel. Do you mean chicken-egg perhaps? There's nothing keeping _you_ from using one of those 10% who are supporting PHP5. If you aren't part of the solution.. I think that continuing to offer prominent download links for PHP 4 versions on the same page as download links for php 5 on the php.netand Zend sites is a major contributor to this problem. Doubtful. I gotta think most people who use PHP do not install it themselves. Those who do install it themselves are probably smart enough to find the older versions no matter where you hide them on the site. To get PHP 5 accepted, links to download earlier versions should be hidden away in some obsure area. PHP4 does what most people need it to do. No reason to upgrade. You can't really fix that since there's nothing broken. What is in PHP5 that you _need_ exactly? If it's OO then there are much, much better places to get your OO fix. Not to mention I have never once had a client ask for PHP specifically, much less PHP5. I use PHP 5 because I want to stay current with my skills, not because I need language functionality that's missing in PHP4. Same with Apache 2, PostgreSQL 8, and MySQL 5. -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now! -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] mysqli class not found
you are not missing anything, you are actually adding to much. Using new is for making objects, if you take away the new in the $result variable declaration it should work fine. On 12/28/05, Erik Saline [EMAIL PROTECTED] wrote: - Original Message - From: Erik Saline To: php-general@lists.php.net Sent: Wednesday, December 28, 2005 1:08 PM I installed Apache, PHP, and Mysql during the Fedora Core 4 installation. PHP 5.0.4 MYSQL 4.1.14 I used php -i to show that mysql and mysqli were installed. Configure Command = './configure' '--build=i386-redhat-linux' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' ' Here is the code. $result = new mysqli_connect('localhost', 'nobody', 'test', 'godisdead'); Here is the error. PHP Fatal error: Class 'mysqli' not found in /var/www/cgi-bin/db_connect.php on line 4, What am I missing? Erik -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
[PHP] Variables and Strings
Hey everyone, is there a way to return all the variables from a string into an array, for example $Var1=Yo; $Var2=Man; $SQL=SELECT * FROM tblname WHERE 4=$Var1 AND WHERE 3=$Var2; $AllVars=MySpecialFunction($SQL); print_r($AllVars); would ideally print an array like: { array $Var1=Yo $Var2=Man } i think i should use an ereg or preg replace but I don't know much about them or how to use them, thanks in advance
Re: [PHP] Re: insert to DB
PHP might not be sending you an error, are warnings turned on in php.ini? if not turn the on and see if you get any errors On 12/18/05, David Hall [EMAIL PROTECTED] wrote: ? if ($_POST[$submit]) { $Name = $_POST[Name]; $Rating = $_POST[Rating]; $sql = UPDATE leaderboard SET Name='$Name', Rating='$Rating' WHERE ID=$id; //replace news with your table name above $result = mysql_query($sql); echo Thank you! Information updated.; } } ? You don't set id in this case. Of course, from some of your other code, it looks like you're relying on register_globals to be on, so maybe it is and that's not why. David Hall -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!
Re: [PHP] PHP interference in frames
I'm taking a wild guess here, maybe the browser insists on waiting for some content but it's maximum content wait time is 5 seconds, the browser could detect the connection to the server is still open and wait for 5 seconds or another time On 12/22/05, Ron Rudman [EMAIL PROTECTED] wrote: I've got this down to a bare bones test but am still stumped. Can anyone explain why I get the behavior I do? I have a frameset with 3 frames: html headtitletesting/title/head frameset rows='100,100,*' frame src='test1.php'/frame frame src='test2.php'/frame frame src='test3.php'/frame /frameset /html test1.php and test2.php are both simply:? sleep(5); ? test3.php is simply: ? echo This is some content; ? When I invoke the main frameset, the output from test3.php takes 5 seconds to appear. If I comment out either one of the sleep calls, the output from test3.phpis immediate, which is what I expected in the first place. I have session.auto_start = 0 in php.ini, so this has nothing to do with sessions. I am running php 5.0.5. I get the same results with both apache 2/mod_php and lighttpd/fastcgi, the latter with 40 php processes running. I thought that each frame in a page was executed independently and asynchronously, yet frame4.php insists on waiting for one of the other frames to complete (if the sleeps are 5 and 10, frame3 produces its output after 5 seconds). What am I missing here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!