[PHP] Calling Function Identity
Is it possible to discover any sort of details about the function/script that is calling a piece of code? Ie, Passively If not, does anyone have a good design pattern of how a debugger for php should work? At the moment I am using a class which formats the data and dumps it to a log file, then just using a function as a wrapper so that set_error_handler uses it. I'm thinking there must be a better way of doing this, anyone have any ideas? Ray Hilton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] configuring with gd for TTF
I'm having all sorts of headaches trying to get TTF support in gd to work. I have compiled from scratch gd 1.8 with ttf support by way of freetype 2, this compiles fine. Then I compile php using the configure statement below and all I get when I try and call a TTF function is: Warning: libgd was not built with TrueType font support in /home/ray/webroot/rayh/htdocs/gfx/image.php on line 48 Etc etc... Can anyone point me in the right direction? Am I right in thinking that you can either use gd's native ttf support or compile freetype into php seperatley? ./configure --with-xml --with-dom --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs --with-sablot --with-openssl=/usr/local/ssl --with-zlib --with-ttf=no --with-gd --enable-shared-pdflib --with-imap --with-t1lib=/usr/local/lib/ --with-jpeg-dir=/usr/lib/ --with-freetype-dir=/usr/local/lib/ --enable-gd-native-tt Cheers, Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Shell scripting and PHP.
I think it's the same as perl, using the backtick operator, ie: $result = `uptime`; That's ` NOT ' -Original Message- From: Johan Vikerskog (ECS) [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 09:41 To: [EMAIL PROTECTED] Subject: [PHP] Shell scripting and PHP. Hi all! If i want to use some shell commands and use the result it displays to set a variable. How is this done? Is there a way of doing it like you can do with Perl? Anyone knows? Thanks for all the tips you can give me, or better yet, if you know of a tutorial somewere that covers this. //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] configuring with gd for TTF
Ok, well here goes... I have removed the --enable-gd-native-ttf and --with-freetype-dir (or whatever it was) copied your settings, more or less... Phpinfo() can be found at http://www.rayh.co.uk/downloads/info.php Wish me luck :) -Original Message- From: Brian White [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 09:40 To: Ray Hilton; 'PHP Mailing List' Subject: RE: [PHP] configuring with gd for TTF Ok. Well, given mine works, I thought I would tell you what I have! My phpinfo says exactly the same: GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with TTF library JPG Support enabled PNG Support enabled WBMP Support enabled My configure options were: ./configure --with-gd=/usr/local/src/gd-1.8.4/ --enable-gd-imgstrttf --with-ttf=/usr/local/freetype/ --enable-calendar --disable-short-tags --with-mysql=/usr/local/mysql/ --with-jpeg-dir=/usr/local/src/jpeg-6b/ --with-apxs=/usr/local/apache/bin/apxs gd-1.8.4 is actually compiled ( theoretically ) with freetype2.x support, though that shouldn't be making any difference, I would have thought. Freetype is 1.3. Also, whenever I configured and then compiled I always deleted config.cache and ran make clean first. Hope this helps. Brian At 09:36 3/07/2001 +0200, Ray Hilton wrote: Nope, not a sausage, I tried it with and without gd's ttf, specifiying to compile in freetype 1.x, or freetype 2, and numerous other combinations... Its doing my nut in!! I think the lib thing your talking about is just a matter of sticking the path in /etc/ld.so.conf and then running ldconfig... I just recompiled php, and according to php info: GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with freetype T1Lib Support enabled JPG Support enabled WBMP Support enabled Which is exactly the same as it was 10 compiles ago... And yet I still get: Warning: libgd was not built with TrueType font support in /home/ray/webroot/rayh/htdocs/gfx/image.php on line 48 Every single time... Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Brian White [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 09:08 To: Ray Hilton; 'PHP Mailing List' Subject: Re: [PHP] configuring with gd for TTF I completely gave up trying to compile freetype 2.x into GD. However I was able to successfully compile freetype 1.3 directly into PHP which seems to work fine. IE: forget trying to use: --enable-gd-native-ttf instead: --with-ttf=/usr/local/freetype/ which assumes you have freetype 1.3 installed to /usr/local/freetype BTW - I have my own question. To restart apache at the moment I have to set and export: LD_LIBRARY_PATH=/usr/local/freetype/lib/ Anyone know what I need to do to get this recognised by Apache internally. ( I am running Debian Linux Potato ) Regs Brian White At 08:50 3/07/2001 +0200, Ray Hilton wrote: I'm having all sorts of headaches trying to get TTF support in gd to work. I have compiled from scratch gd 1.8 with ttf support by way of freetype 2, this compiles fine. Then I compile php using the configure statement below and all I get when I try and call a TTF function is: Warning: libgd was not built with TrueType font support in /home/ray/webroot/rayh/htdocs/gfx/image.php on line 48 Etc etc... Can anyone point me in the right direction? Am I right in thinking that you can either use gd's native ttf support or compile freetype into php seperatley? ./configure --with-xml --with-dom --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs --with-sablot --with-openssl=/usr/local/ssl --with-zlib --with-ttf=no --with-gd --enable-shared-pdflib --with-imap --with-t1lib=/usr/local/lib/ --with-jpeg-dir=/usr/lib/ --with-freetype-dir=/usr/local/lib/ --enable-gd-native-tt Cheers, Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] - Brian White Step Two Designs Pty Ltd - SGML, XML HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] - Brian White Step Two Designs Pty Ltd - SGML, XML HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED] -- PHP General Mailing List (http
RE: [PHP] configuring with gd for TTF
Nope, not a sausage, I tried it with and without gd's ttf, specifiying to compile in freetype 1.x, or freetype 2, and numerous other combinations... Its doing my nut in!! I think the lib thing your talking about is just a matter of sticking the path in /etc/ld.so.conf and then running ldconfig... I just recompiled php, and according to php info: GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with freetype T1Lib Support enabled JPG Support enabled WBMP Support enabled Which is exactly the same as it was 10 compiles ago... And yet I still get: Warning: libgd was not built with TrueType font support in /home/ray/webroot/rayh/htdocs/gfx/image.php on line 48 Every single time... Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Brian White [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 09:08 To: Ray Hilton; 'PHP Mailing List' Subject: Re: [PHP] configuring with gd for TTF I completely gave up trying to compile freetype 2.x into GD. However I was able to successfully compile freetype 1.3 directly into PHP which seems to work fine. IE: forget trying to use: --enable-gd-native-ttf instead: --with-ttf=/usr/local/freetype/ which assumes you have freetype 1.3 installed to /usr/local/freetype BTW - I have my own question. To restart apache at the moment I have to set and export: LD_LIBRARY_PATH=/usr/local/freetype/lib/ Anyone know what I need to do to get this recognised by Apache internally. ( I am running Debian Linux Potato ) Regs Brian White At 08:50 3/07/2001 +0200, Ray Hilton wrote: I'm having all sorts of headaches trying to get TTF support in gd to work. I have compiled from scratch gd 1.8 with ttf support by way of freetype 2, this compiles fine. Then I compile php using the configure statement below and all I get when I try and call a TTF function is: Warning: libgd was not built with TrueType font support in /home/ray/webroot/rayh/htdocs/gfx/image.php on line 48 Etc etc... Can anyone point me in the right direction? Am I right in thinking that you can either use gd's native ttf support or compile freetype into php seperatley? ./configure --with-xml --with-dom --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs --with-sablot --with-openssl=/usr/local/ssl --with-zlib --with-ttf=no --with-gd --enable-shared-pdflib --with-imap --with-t1lib=/usr/local/lib/ --with-jpeg-dir=/usr/lib/ --with-freetype-dir=/usr/local/lib/ --enable-gd-native-tt Cheers, Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] - Brian White Step Two Designs Pty Ltd - SGML, XML HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Fatal Error: Call to undefined function: sybase_connect() in
Have you sompiled in sybase support? By defauly php doesn't compile with sybase functions, you must specifcally tell it too... -Original Message- From: nelo manuel [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 09:27 To: [EMAIL PROTECTED] Subject: [PHP] Fatal Error: Call to undefined function: sybase_connect() in Dear all, am quite new on php and Linux, after installing php-4.0.6 and run the test.php it worked OK but when i try to write the function to initially display records from sybase pubs2 i get the following msg Fatal Error:Call to undefined function: sybase_connect() in /home/httpd/html/index.php3 i am using Linux Redhat 7 kernel 2.4.3 can any one help me please :( Kind regards, Nelson _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Fatal Error: Call to undefined function: sybase_connect() in
Not sure other than that... If it compiles it means it can find the headers it needs from the sybase package... Is this sybase 11.9.2? I managed to build php with that some time ago, but I cant for the life of me remember any more details... Do any sybase functions work? And do you get any errors during configure/install? -Original Message- From: nelo manuel [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 11:28 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] Fatal Error: Call to undefined function: sybase_connect() in i have compile it with sybase on ./configure (according to mastering linux book, install and configuring php to access data from sybase) can some else pls help me :( From: Ray Hilton [EMAIL PROTECTED] To: 'nelo manuel' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] Fatal Error: Call to undefined function: sybase_connect() in Date: Tue, 3 Jul 2001 09:37:56 +0200 Have you sompiled in sybase support? By defauly php doesn't compile with sybase functions, you must specifcally tell it too... -Original Message- From: nelo manuel [mailto:[EMAIL PROTECTED]] Sent: 03 July 2001 09:27 To: [EMAIL PROTECTED] Subject: [PHP] Fatal Error: Call to undefined function: sybase_connect() in Dear all, am quite new on php and Linux, after installing php-4.0.6 and run the test.php it worked OK but when i try to write the function to initially display records from sybase pubs2 i get the following msg Fatal Error:Call to undefined function: sybase_connect() in /home/httpd/html/index.php3 i am using Linux Redhat 7 kernel 2.4.3 can any one help me please :( Kind regards, Nelson ___ _ _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] General Coding Question
I dont think thats XHTML complient... Correct me if im wrong? -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: 20 June 2001 23:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] General Coding Question im here to start a flamewar. dont use then. why not use ' ? echo input type=\text\ name=\name\ value=\$name\ echo input type='text' name='name' value='$name' I like the second. it is proper html check it with w3.org. -- Chris Lee [EMAIL PROTECTED] scott [gts] [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... on pages with mostly HTML code, the second style is much prefereable, but on pages with mostly PHP code, the first style is usually OK. overall, i tend towards the second, becuase it's a pain in the ass to esape all the double-quotes in my HTML, my echo statements usulaly end up looking like thi (which, to me, is terrible form) echo INPUT TYPE=\TEXT\ VALUE=\. $hash['var'] .\.. so i usually use this format, which to my eyes is much prettier :) ? INPUT TYPE=TEXT VALUE=?= $hash['var'] ? ? -Original Message- From: James Stevens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 20, 2001 12:23 PM To: [EMAIL PROTECTED] Subject: [PHP] General Coding Question Does it have any effect on performance in either case if a file is completely done in PHP(1) or interspersed with PHP(2). (1) ?php echo html; ... ? (2) html ... ?php echo $forminput; ? ... Also, and this is personal preference, which is easier to read/debug? James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Time Language Settings
How do I go arround getting php to output the time() function in a different language? I have tried the setlocale() function to no avail, perhaps my system doesn't have the appropriate locale to do this? If so, then how do install them on Red Hat 7? Cheers, Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Turning Off Headers
If your using the standalone binary, I /think/ its something like php -q If it's the module in apache, you will have a problem as apache itself will add a certain degree of header information. -Original Message- From: Meles Meles [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 14:03 To: [EMAIL PROTECTED] Subject: [PHP] Turning Off Headers Is there any way to tell PHP to NOT produce a Mime Header? None, none at all... Not a Content-type:, nothing... Badger [EMAIL PROTECTED] ---
RE: [PHP] HELP problems running PHP4 script in CRON
At the top, put: #!/path/to/php -q ? ...code... ? The reason itsgiving you those errors is because it doesnt no what interpreter to use for the script. Of course, your going to have to have the standalone binary of php built, not the apache module. On a side note, does anyone know if you can get php to build both at the same time? The binary and the .so module? At the moment, I just have to compile twice. Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Splashy [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 15:29 To: [EMAIL PROTECTED] Subject: [PHP] HELP problems running PHP4 script in CRON Hi, Please find script below and hopefully tell me why when I run it over the web it works perfectly but when I run it using cron or in a telnet session it errors saying no such file or directory. THIS IS THE ERROR /* ./fetch_news.php: ?: No such file or directory ./fetch_news.php: syntax error near unexpected token `fetchnews($mysourcefile,$m youtputfile,$myflashvar)' */ THIS IS THE SCRIPT ? #Requires 3 Params #$mysourcefile = path to content source html file #$myoutputfile = path to content output html file #$myflashvar = Flash variable you wish to assign the content to eg:mynews, mytechnology function fetchnews($mysourcefile,$myoutputfile,$myflashvar) { $mysource=fopen($mysourcefile,r) or die (Couldn't open the Source file); $myoutput=fopen($myoutputfile,w) or die (Couldn't open the Output file);; fwrite($myoutput,$myflashvar); while (!feof($mysource)) { $myline=fgets($mysource, 1024); $stripquotes=eregi_replace(#039,`,$myline); $stripcolors=eregi_replace(COLOR=\#.*\,,$myline); if (eregi('^a.*\/abr',$stripcolors)) { $newanchor=eregi_replace(br,,$stripcolors); fwrite($myoutput,$newanchorbr); } } fclose($myoutput); fclose($mysource); } ? ? fetchnews(http://www.moreover.com/cgi-local/page?c=Graphics%20industry% 20ne wso=html,graphicsnews.php,mynews=); ? All help and advise is as always gratefully received! Splashy.
RE: [PHP] SetCookie weirdness
This is actually a security feature of cookies, so that domains that dont match your cookie cannot read personal details set by another site. Don't worry, its all in order ;) Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Tomaz Kovacic [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 12:36 To: [EMAIL PROTECTED] Subject: [PHP] SetCookie weirdness Hi! Last night I've found some interesting cookie behavior. I was testing some script on my local server, so I used short version of domain ( http://www ) to reach local webserver. My script stopped working, so I started to investigate a little bit what's goin on.. I've managed to get my script working only when i user SetCookie command with only 3 parameters: SetCookie (mycookie, $cookie, time()+1200); My usual form of setting cookie is with all 6 arguments like: SetCookie(mycookie, $cookie, time()+1200, /, .domain.com, 0); But if I use longer form if domain: www.local (same as www.somedomaing.com) my longer form of setting cookie started to work again. Weird. Anyone experianced similar problems? Tomaz
RE: [PHP] Store PHP Code in MySQL?
Eval($var); That should execute the code I've never tried this to be honest, you will have to let me know your findings. I was thinking of doing something like it in perl, so that you could have a small daemon running, and it connects to a master server and updates its own code somehow... Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Joseph Koenig [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 23:23 To: [EMAIL PROTECTED] Subject: [PHP] Store PHP Code in MySQL? I've been playing a little bit trying to store some PHP code in MySQL and get it to execute. However, it behaves just like expected in that it just displays the code, and doesn't execute it. Essentially, i want to do this: ? while($data = mysql_fetch_array($result)) { echo $data[text]; } ? With $data[text] containing: ? echo $var; ? Anybody know a way to actually make this work? Thanks, Joe
RE: [PHP] inserting a variable into a variable
What on earth are you trying to do? :) I'm not sure what your getting at, do you mean defining a variable based on another variables name? Perhaps try using an array, and specifying $rm($cat) Sorry, im not too sure what you mean Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Hasan Niyaz [mailto:[EMAIL PROTECTED]] Sent: 20 June 2001 04:07 To: [EMAIL PROTECTED] Subject: [PHP] inserting a variable into a variable Hello all, I have come to a situation where i am having a variable inside another variable. for example. $rm_$cat_adt The above is a variable and $cat is again another variable This does not work.. Need some help! Thanks, Hasan
RE: [PHP] time
well, if its a server side script, the only clock available to it is the one on the server... Ray -Original Message- From: Jon Yaggie [mailto:[EMAIL PROTECTED]] Sent: 20 May 2001 15:51 To: [EMAIL PROTECTED] Subject: [PHP] time quickly can some one tell me if time() return server or usersystem time? Thank You, Jon Yaggie www.design-monster.com And they were singing . . . '100 little bugs in the code 100 bugs in the code fix one bug, compile it again 101 little bugs in the code 101 little bugs in the code . . .' And it continued until they reached 0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] image retrival from db?
I thought this one was quite good to get you up to speed: http://www.phpbuilder.net/columns/florian19991014.php3 Thing is, although very technically nice, it isnt really very practical, as your database increases in size rapidly, and data retrival takes longer and longer. I would recommend you still do stuff like thumbnail generation on the upload and then store the paths to the file in the database. Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Steve [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 00:57 To: [EMAIL PROTECTED] Subject: [PHP] image retrival from db? Anyone have a pointer to a script or documentation on how to retrieve an image that is stored in a database? I can insert the image, but unable to display the image once retieved, i apparently am missing something. Thanks Steve
RE: [PHP] What is the deal with cookies
Well, when you set a cookie, it is sent in the headers, so the browser isnt going to send the cookie back to the server until a refresh, the best way is to either cash the userlog on details in the log in function, so you need not refresh, or simply use a header(Location: /); or something to force the browser to reload the page. -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED]] Sent: 18 June 2001 23:28 To: [EMAIL PROTECTED] Subject: [PHP] What is the deal with cookies I have a script that authorizes the user and sets a cookie but when I run the script it takes the username and password sets the cookie. Verifies the cookie is set and then runs the rest of the code on the page. except it does not pass on the user name. I have to do a manual refresh to get it to pull the data from the database using the username furnished by the cookie. Look at the code below. how can I overcome this refresh problem. This is the script that calls the userauth.php file look at the userauth.php file below include(../inc/dataconf.inc); include(userauth.php); include(../inc/function.inc); conf(); $username = $user_name; $db = MYSQL_CONNECT($roothostname,$rootusername, $rootpassword) OR DIE(Unable to connect to database); $query = Select * from customers,datsubd,plans where datsubd.id = customers.id and customers.cusername='$username'and plans.planno=customers.plan; $result=mysql_db_query($dbName,$query); $row = mysql_fetch_array($result); ? ? include(top.inc);? table width=100% border=0 cellspacing=0 cellpadding=0 align=center tr td colspan=3/td /tr tr td width=25% align=left valign=top?php include(left.inc);? /td td width=100% align=center valign=top # Userauth.php function query($query) { Global $roothostname,$rootusername, $rootpassword,$dbName; // Connect to DB if (!$link = @MYSQL_CONNECT($roothostname,$rootusername, $rootpassword)) { $result = 0; die(db connect error); } else { // Select DB if (!@mysql_select_db($dbName, $link)) { $result = 0; die(db select error); } else { // Execute query if (!$result = @mysql_query($query, $link)) { $result = 0; die(db query error); } } } @mysql_close($link); return $result; } function login_user($user_name, $password) // Form our sql query $result = query(SELECT * FROM customers WHERE cusername ='$user_name'); $row = mysql_fetch_array($result); if (($row[cusername] == $user_name) AND ($row[cpassword] == $password) AND ($user_name != )) // User has been authenticated, send a cookie $user_id = $row[cusername]; $encryptedpassword = md5($password); SetCookie(LoginCookie, $user_id-$encryptedpassword, time()+50); // 3600 expires one hour from now you can increse this if you what it to last longer $success = 1; } else $success = 0; } return $success; } function verify_auth($cookie) // Split the cookie up into userid and password $auth = explode(-, $cookie); $query = query(SELECT * FROM customers WHERE cusername = '$auth[0]'); $row = mysql_fetch_array($query); $encryptedpassword = md5($row[cpassword]); if (($row[cusername] == $auth[0]) AND ($encryptedpassword == $auth[1]) AND ($auth[0] != )) $success = 1; } else $success = 0; } return $success; } function display_loginform() { global $SCRIPT_URL,$user_name; ? table width=400 border=1 align=center form name=login action=?$SCRIPT_URL? method=post trtd bgcolor=blackfont face=Arial color=white size=2bLoginb/font/td/tr trtdfont face=Arial color=black size=2Name input name=user_name value= size=10 Password input name=password type=password value= size=10/font/td/tr trtdfont face=Arial color=black size=2 input type=submit value=Login input type=reset value=Clear/font/td/tr /form /table ? exit; } script entry point here $SCRIPT_URL=getenv(SCRIPT_NAME); if($LoginCookie) // if cookie exists, check authenticity { $authenticated=verify_auth($LoginCookie); if($authenticated==0) display_loginform(); } else { $login=login_user($user_name,$password); if($login==0) display_loginform(); } // if user has logged in, the script carries on here $cookie_var = split(-, $LoginCookie); // this variable contains who the user is logged in as! $username = $cookie_var[0]; Best regards, Richard mailto:[EMAIL PROTECTED]
RE: [PHP] send data to a file composed of frames
The only real way I see you maintaining a session like that is to use cookies or some sort of client identifier so you can keep trak of that user and if ther are logged in or not. Then you just have some sort of flag that determines the course of action for your site. I am not entirely sure what you mean by not being able to go back to the previous page, this is perfectly possible, unless im missing the point Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: kaab kaoutar [mailto:[EMAIL PROTECTED]] Sent: 15 June 2001 12:25 To: [EMAIL PROTECTED] Subject: [PHP] send data to a file composed of frames Hi guys! I have a login in my site, some pictures and links are differents depending on being logged or not! I thought of using sessions in the whole site, but the disadvantage is that, we can never go back in a the previous page, when using sessions. i thought of using a hidden input in each page but some or rather almost all my pages are composed of frames and therefore the frames don't receive the login status! Can u please help ? THanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
RE: [PHP] Multipe Tables, Single Query Problem
Something like: SELECT name, title, description from videos, actors, links where actors.ID = links.ID and videos.ID=videoID, and videos.ID = 20; ? But in just want one row? You could return all the names in one row (I think) using MySQL (I assume?) string functions... I have a funny feeling you need a sub select, which mysql doesnt support... Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Simon Kimber [mailto:[EMAIL PROTECTED]] Sent: 06 June 2001 14:57 To: [EMAIL PROTECTED] Subject: [PHP] Multipe Tables, Single Query Problem Hi all, I have three tables in my (mysql) database: videos - ID, title, description, etc.. links - ID, videoID, actorID actors - ID, name, dateofbirth, gender, etc... what i need to do is return a particular video and all it's staring actors with just one query returning just one row, ie. with all the actor names in one field... is this possible? or do i have to get the video data first and then the actors separately? Simon Kimber Funny.co.uk - The Comedy Portal http://www.funny.co.uk/ Now Incorporating: The UK Live Comedy Directory FREE promotion for UK Comedy Acts and Venues http://www.funny.co.uk/uklive/ eml. [EMAIL PROTECTED] icq. 16156911
RE: [PHP] [php]using sendmail with php
I assume you could do it like in perl: Open(MAIL, |/usr/lib/sendmail); Print MAIL OUTPUT; To: ray [EMAIL PROTECTED] From: someone [EMAIL PROTECTED] Subject: blah blah Note the line break before the body, blah blah blah OUTPUT Close(MAIL) I have no idea how you would do this in php, but I hope its at least points you in the right direction... Im not sure if php allows you to open a pipe to another program. Ray Hilton - [EMAIL PROTECTED] http://rayh.co.uk -Original Message- From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 06:04 To: PHP General List (E-mail) Subject: [PHP] [php]using sendmail with php hey- i noticed a recent post about the weird email that someone was getting from a script that emails form data. I was curious on whether or not I could use sendmail with php, to possibly get around this problem(I've run into it myself). How might i do this?... chris
[PHP] suggestions for binary data in database
Hi, I have a site, http://rayh.co.uk which is basically my personal home page and nothing more than a hobby. However, on the site, i am currently storing images in the database, purely because i can. But i wonder, how much will the server load be affected when pulling binary data out of the database? compared to the file system? i assume its going to be quite a lot higher. DO you reckon it would be better to scrap that and store the images on the file system? Ray Hilton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]