[PHP] Quick question regarding debugging and PHP structure.

2008-12-31 Thread Ólafur Waage
Short: Is it possible to see the PHP code that is going to be processed in whole? Long: I love to see things visually, and while programming i create all kinds of debugging variables i keep on the side for each page/request. I know this is possibly not possible since this has to be done from

Re: [PHP] Image Resizing

2008-12-20 Thread Ólafur Waage
With the built in functions (GD), you can read up on this function: http://is.php.net/manual/en/function.imagecopyresized.php If you have Imagick installed, you can read up on this: http://is.php.net/manual/en/function.imagick-thumbnailimage.php On Sat, Dec 20, 2008 at 8:38 PM, Stephen Alistoun

Re: [PHP] still can't get a login with session working ... is there another way to mask the url parameter?

2008-12-18 Thread Ólafur Waage
1st. Replace your $sql query with this $sql = sprintf(SELECT * FROM admin WHERE UserName = '%s' AND Password = '%s', mysql_real_escape_string($UserName), mysql_real_escape_string($Password)); $result = mysql_query($sql) or die(mysql_error()); Ólafur Waage olaf...@gmail.com On Thu, Dec 18, 2008

Re: [PHP] Good PHP book?

2008-12-14 Thread Ólafur Waage
Hey, php.net is the best book, but if you want a good book that goes over all the elements of php then pickup the Zend PHP 5 Certification Study Guide: http://www.amazon.com/architects-Zend-Certification-Study-Guide/dp/0973862149/ref=pd_bbs_sr_1?ie=UTF8s=booksqid=1229296547sr=8-1 Olafur Waage

[PHP] Quick question regarding $_SESSION and header()

2008-12-11 Thread Ólafur Waage
I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: [PHP-QA] Re: [PHP] Quick question regarding $_SESSION and header()

2008-12-11 Thread Ólafur Waage
Whoops, sent the thanks to the wrong list :P On Thu, Dec 11, 2008 at 7:33 PM, Daniel Brown danbr...@php.net wrote: (Forwarding back to PHP General for the archives.) On Thu, Dec 11, 2008 at 14:31, Ólafur Waage olaf...@gmail.com wrote: Its fixed, thanks guys :) On Thu, Dec 11, 2008 at 7:16

Re: [PHP] imagecreatefromgif imagecolortransparent() ??

2008-12-04 Thread Ólafur Waage
Here's a code snippet from the php.net documentation on imagecolortransparent by Blaine Ehrhart ?php $im = imagecreatefromgif('trans.gif'); $img = imagecreatetruecolor(16,16); $trans = imagecolorallocate($img,255,99,140); imagecolortransparent($img,$trans);

Re: [PHP] It's Sunday, and I'm bored...

2008-11-09 Thread Ólafur Waage
Commit Early Commit Often. :P On Sun, Nov 9, 2008 at 11:03 AM, Richard Heyes [EMAIL PROTECTED] wrote: Hi, I just looked at my commit diff that I need to check - 1500 lines (!). Uhhh... Maybe that policy of committing frequently wouldn't be so terrible after all... -- Richard Heyes HTML5

Re: [PHP] It's Sunday, and I'm bored...

2008-11-09 Thread Ólafur Waage
On Sun, Nov 9, 2008 at 5:33 PM, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Commit Early Commit Often. :P [/snip] Are you from Louisiana? Iceland so no -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP]Executing a .jar from a php script

2008-10-27 Thread Ólafur Waage
Does the php server have access to run that file? (ie. if its apache, does he or his group have the rights to run that file) Also you can try to use $var = system('java -jar JARNAME', $dump); and try to output from both variables. 2008/10/27 Bastien Helders [EMAIL PROTECTED]: Hi, I would like

Re: [PHP] Public in Classes

2008-09-21 Thread Ólafur Waage
Here you go. http://talks.php.net/show/php5_ca/4 Ólafur Waage [EMAIL PROTECTED] 2008/9/21 Ben Stones [EMAIL PROTECTED]: Hi, Just started with object oriented programming and glad I have come across it, just need a few things clearing up. When I make a variable or method public, does

Re: [PHP] Printing date out of array

2008-08-31 Thread Ólafur Waage
I would suggest the time() value to be saved in your database. Since the date() function can use that as the second parameter and you can use any format date() allows. Or make your own. Ólafur Waage [EMAIL PROTECTED] 2008/8/31 Michael S. Dunsavage [EMAIL PROTECTED]: This is my date array

Re: [PHP] ASCII Captcha

2008-08-29 Thread Ólafur Waage
Thats exactly what i am talking about Richard. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Richard Heyes [EMAIL PROTECTED]: pre

Re: [PHP] ASCII Captcha

2008-08-29 Thread Ólafur Waage
I just realized that i should have said ASCII Art but not just ASCII, it was so clear in my head but i notice now how it could have been misunderstood. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Ólafur Waage [EMAIL PROTECTED]: Thats exactly what i am talking about Richard. Ólafur Waage [EMAIL

Re: [PHP] Problems sending $_POST vairable to an ASP page

2008-08-28 Thread Ólafur Waage
IIRC ASP cant recive PHP $_POST variables but it can recive HTML post from forms. If you want to send variables to another language. You can try via a get variable. Dont know if the items you want to send are safe to send over though. Ólafur Waage 2008/8/28 shaun thornburgh [EMAIL PROTECTED

[PHP] ASCII Captcha

2008-08-28 Thread Ólafur Waage
Has anyone tried a ASCII Captcha method. To use a similar method like this ASCII generator (http://www.network-science.de/ascii/) Or even gone the next level and have an ASCII based simple math question? I know this isnt strictly a PHP question but spam free sites are very dear to us. Ólafur

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-24 Thread Ólafur Waage
I am pretty certain that this isnt possible under current code. But i just wanted a confirmation on this, since i worked on the code for a while trying to get to the end point. And yes Jochem, i am looking for a magical location :P Well, thanks guys :) Ólafur Waage 2008/8/24 Micah Gersten

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Ólafur Waage
Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results Ólafur Waage 2008/8/23 Robert Cummings [EMAIL PROTECTED]: On Fri

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Ólafur Waage
Luke, i am looking for local directory info. Not URL info as i said before. And Ashley, as i said in the original mail. I had tried $_SERVER. Thanks for the reply though. Ólafur Waage 2008/8/23 Luke [EMAIL PROTECTED]: $_REQUEST? Luke Slater Lead Developer NuVoo On 23 Aug 2008, at 12:53

Re: [PHP] Serving pages based on user input

2008-08-23 Thread Ólafur Waage
You can read about the header function. http://is2.php.net/manual/en/function.header.php Ólafur Waage 2008/8/23 Prasad Chand [EMAIL PROTECTED]: Hi, I am fairly new to PHP. I would like to serve a page to a user based on his input. Say, I have a page 1 where user has 3 options(drop down menu

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Ólafur Waage
PROTECTED]: 2008/8/23 Ólafur Waage [EMAIL PROTECTED]: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results If checking

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ólafur Waage
came from. Ólafur Waage. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ólafur Waage
to know which directory they tried to access unless you write your own index.php and store it in a session variable. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: Thanks for the reply Micah but i have no interest in the URL. I am

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ólafur Waage
to figure out the full local path of /foo/bar (which would be /var/www/example.com/foo/bar ) or any other directory i browse too. Ólafur Waage 2008/8/22 Ashley Sheridan [EMAIL PROTECTED]: On Fri, 2008-08-22 at 21:56 +, Ólafur Waage wrote: That is the brick wall i faced. There is no way to know where

[PHP] Quick question regarding getcwd() and directory location.

2008-08-21 Thread Ólafur Waage
tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem with script timing out in php 4.4.8

2008-06-04 Thread Ólafur Waage
Could you try setting the max_execution_time with ini_set and confirming the status of it with ini_get ? - Waage 2008/6/4 Arno Kuhl [EMAIL PROTECTED]: I recently picked up an issue when I upgraded my IDE, where the browser window timed out while I was debugging the code. I checked with support

Re: [PHP] urlencode and urldecode

2008-05-18 Thread Ólafur Waage
You can read about apache's mod_include and its echo element. http://httpd.apache.org/docs/2.2/mod/mod_include.html#element.echo 2008/5/17 Chris W [EMAIL PROTECTED]: Whenever you build a query string you need to us the urlencode to encode any characters that may be in there that aren't legal

Re: [PHP] encoding to a file

2008-05-18 Thread Ólafur Waage
This should work as expected. ?php $f = fopen(file.txt, r); stream_encoding($f, iso-8859-1); ? 2008/5/16 J. Manuel Velasco - UBILIBET [EMAIL PROTECTED]: Hello. When I create a file I need to specify the encoding to ISO-8859-1, how can i do this please ? I have read about

Re: [PHP] Loading 2M array crashes program .. but only some of the time

2008-05-18 Thread Ólafur Waage
Are you using a persistent connection? 2008/5/18 Mary Anderson [EMAIL PROTECTED]: Hi all, I have a php - postgresql program which bombs with a statement that it has run out of memory. I am running php 5.1.6 and postgres 8.3.something. My program bombs, saying that it fails to allocate

Re: [PHP] syntax of sprintf

2008-05-18 Thread Ólafur Waage
Try this one $sSQL = sprintf(SELECT username FROM individuals WHERE username='%s', mysql_real_escape_string($username)); $query = mysql_query($sSQL); if($query !== false) { // do something } 2008/5/18 Sudhakar [EMAIL PROTECTED]: until i started using the techniques for avoiding sql injection, i

Re: [PHP] Re: fsockopen on ssl://

2008-05-18 Thread Ólafur Waage
Are you doing the command line on the same machine as the server? Have you checked out the apache configuration? Since phpcli runs alone. (iirc) 2008/5/18 bob pilly [EMAIL PROTECTED]: Hi Manuel Thanks for the reply. I have tested it with a timeout of 20 seconds and the same thing occurs. It

Re: [PHP] client time zone?

2008-01-06 Thread Ólafur Waage
value. But you'll never know if the client has the wrong timezone and you'll have to deal with timezones that don't have daylight savings like for instance Iceland :) - Ólafur Waage 2008/1/6, Per Jessen [EMAIL PROTECTED]: jekillen wrote: Hello; I am running a server that is using UTC and I

Re: [PHP] image* Functions' Memory Usage

2008-01-04 Thread Ólafur Waage
that and the other doesn't) and the problems with the end users on the image generating step are very hard to debug, since they usually describe the problems very badly. Hope this helps some. - Ólafur Waage [EMAIL PROTECTED] 2008/1/4, Casey [EMAIL PROTECTED]: Greetings, list. I have a web application

Re: [PHP] How to show proper time to users from around the world

2007-08-30 Thread Ólafur Waage
Since there are always many ways to do things here's one id like to see how well it worked. It would be getting the IP address of the user and matching it against an IP address locator. Since ive seen these to be accurate to what timezone people are in. Olafur W 2007/8/30, Hemanth [EMAIL

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Ólafur Waage
Ive already finished the code and pasted it to this mailing list :) Just an fyi. Ólafur Waage 2007/8/11, Tijnema [EMAIL PROTECTED]: On 8/11/07, Stut [EMAIL PROTECTED] wrote: Tijnema wrote: On 8/11/07, Richard Heyes [EMAIL PROTECTED] wrote: Richard Heyes wrote: How can i match

Re: [PHP] preg_match_all to match img tags

2007-08-10 Thread Ólafur Waage
-Original Message- From: brian [mailto:[EMAIL PROTECTED] Sent: Friday, August 10, 2007 3:18 AM To: php-general@lists.php.net Subject: Re: [PHP] preg_match_all to match img tags Ólafur Waage wrote: I know this isn't exactly a php related question but due to the quality of answers ive

[PHP] preg_match_all to match img tags

2007-08-09 Thread Ólafur Waage
I know this isn't exactly a php related question but due to the quality of answers ive seen lately ill give this a shot. (yes yes im smoothing up the crowd before the question) I have a weblog system that i am creating, the trouble is that if a user links to an external image larger than

Re: [PHP] MD5 bot Question

2007-04-10 Thread Ólafur Waage
You were talking about an OCR reader for the arrows to see what letters it is pointing to. If the arrow would be at a random location in the actual image, the arrow being not an arrow but ie. a man pointing and the arm being flexible (so even if the man himself would move around randomly, the arm

[PHP] Session Authentication

2007-04-09 Thread Ólafur Waage
Lets say i have a login system. This system authenticates the user via mysql, when the user is authenticated, i set a session variable to let the system know the user is authenticated. ie. $_SESSION[authenticated] = true; Lets also say i know that's how the system works, that a session variable

Re: [PHP] Session Authentication

2007-04-09 Thread Ólafur Waage
Thanks, yes my knowledge of sessions was a little vague. 2007/4/9, Stut [EMAIL PROTECTED]: Ólafur Waage wrote: Lets say i have a login system. This system authenticates the user via mysql, when the user is authenticated, i set a session variable to let the system know the user

Re: [PHP] Session Authentication

2007-04-09 Thread Ólafur Waage
Thanks for the replies guys, became a pretty big thread. The actual code is just a select statement from the user table using sprintf and mysql_real_escape_string for the username and password. I count how many row's the select statement returns, if its not zero then i authenticate by setting a

Re: [PHP] name of the variable

2007-03-09 Thread Ólafur Waage
I found this on the zend forums. Hope it helps. function Dump($var) { if (key_exists($var, $GLOBALS)) { echo pre$$var:\n; var_dump($GLOBALS[$var]); echo \n/pre\n; } else echo span class='error'No variables

Re: [PHP] Re: [an attempt to inject a bit of humor back into the situation] Re: [PHP] Recomended host

2006-12-19 Thread Ólafur Waage
Jochem Maas wrote: Robert Cummings wrote: On Tue, 2006-12-19 at 16:01 -0500, [EMAIL PROTECTED] wrote: Merry Christmas Everyone! and I mean everyone (even Eight-of-Nine ;-) INSENSITIVE CLOD!!! I practice animism! your catching on ... about the insensitivity that is ;-)

[PHP] For those who havent seen this

2006-12-19 Thread Ólafur Waage
http://dbug.ospinto.com/ Turns arrays into a table for visual debugging. I've been using this for a few things here and there, it itsnt so often here that we link nifty little gadgets so here is one. - Olafur -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] causing HTTP error status

2006-05-06 Thread Ólafur Waage
Nic wrote: Richard Lynch [EMAIL PROTECTED] writes: On Fri, May 5, 2006 5:01 am, Nic wrote: Hi Rabin Rabin Vincent [EMAIL PROTECTED] writes: On 5/5/06, Nic [EMAIL PROTECTED] wrote: But /mydir/some.php doing: header(HTTP/1.1 404 Rubbish!!!) _never_ causes the

Re: [PHP] What editor do you use?

2006-05-05 Thread Ólafur Waage
Nicolas Verhaeghe wrote: -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 1:54 PM To: Nicolas Verhaeghe Cc: 'Jay Blanchard'; 'PHP-General' Subject: RE: [PHP] What editor do you use? On Thu, 2006-05-04 at 16:39, Nicolas Verhaeghe wrote:

Re: [PHP] Sanity checker?

2006-05-03 Thread Ólafur Waage
How would you define ie. a sane case or elseif statment without knowing more about the code, how it is executed or included files that effect the file. File that the checker possibly doesnt have access to. Björn Bartels wrote: Hi, there... agreeing with other posts, i'd say this could

Re: [PHP] XML Parsing, starting out.

2006-04-29 Thread Ólafur Waage
Mattias Thorslund wrote: [EMAIL PROTECTED] wrote: Hello, 1st msg here so im excited what results i will get :) Im a novice with php parsing and have been able to help myself quite well with what ive needed with xml_parse_into_struct and then echoing the fixed variable names but now im