Re: [PHP] Exact string replacement...
hi there, Have u tried this... ?php $string = 'foo'; print preg_replace(/^\s$string\s/,' ','bfoo foo foobar.') . \n; print eregi_replace(^[[:space:]].$string.[[:space:]],' ','bfoo foo alfoobar.') . \n; ? This is not working properly.. Output I got is bfoo foo foobar. bfoo foo alfoobar help me out Rgds, Desikan On Sat, 9 Feb 2002 03:01:40 -0500, Brian Clark [EMAIL PROTECTED] said: * Desikan ([EMAIL PROTECTED]) [Feb 09. 2002 02:52]: hi Thanks, Sure, But I want to do thr replace operation for regular exprerssion and not exactly for the string alone... like ^and$,a*, etc ?php $string = 'foo'; print preg_replace(/^\s$string\s/,' ',' foo foobar.') . \n; print eregi_replace(^[[:space:]].$string.[[:space:]],' ',' foo foobar.') . \n; ? I like the top better.. -- Headers set. CCs on list replies - bit bucket. Brian Clark | Unable to leap tall buildings in a single bound. Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Desikan [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Exact string replacement...
* Desikan ([EMAIL PROTECTED]) [Feb 09. 2002 03:33]: hi there, Backatcha, Have u tried this... ?php $string = 'foo'; print preg_replace(/^\s$string\s/,' ','bfoo foo foobar.') . \n; print eregi_replace(^[[:space:]].$string.[[:space:]],' ','bfoo foo alfoobar.') . \n; ? This is not working properly.. Output I got is bfoo foo foobar. bfoo foo alfoobar You do realize that ^ is matching the beginning of a string, right? Take out the ^ in each and you'll get the correct result. help me out Hope that helps. -- Headers set. CCs on list replies - bit bucket. Brian Clark | The land of the free, and the home of the brave. Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php Projects
I've already got the steady supply of beer, but a backup? remind me - what's that word mean again... Alan McFarlane (Just after suffering a major NT dual server crash when the bac Nick Wilson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Arik Ashepa declared Hi. I was wondring... maybe you want to develop a project? have any ideas? Yes! How about a database backed set of scripts to create world peace and send a steady supply of beer to my house? - -- Nick Wilson Tel: +45 3325 0688 Fax: +45 3325 0677 Web: www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZCmLHpvrrTa6L5oRAk63AKCIidIl7jTdl9weiRbnJau/YVwCKQCcCukg vfCBVeUKS8xMpnfderSjLXw= =UDHe -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dll on Visual Basic
Hi, Basically, what I want to do is call php4ts.dll (or whatever) to use highlight_string/file function on Visual Basic and return it on a ritchtextbox. Is this possible? Help! Regards, Edgardo Rossetto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script breaks connection?
I have a scripts, which, when runs, breaks the connection to Apache and I have no idea why. This script has lots of function calls, some return large arrays. After I've trim the scripts to the point where it connects and run, if I add a printf(Hello World) or any custom function I get this error: Connection to host localhost is broken Is there a max number of functions that can be called or some other kind of limit that can affect it? I've compiled php 4 into apache on Linux. This is not the first time it happens, it happened before when I transfered a php file from another server to this one. It worked fine on the other server but I got connection broken when ran a specific file on this server. Please help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file upload and change name
Hi, Does anyone know how to change the name of and image and save the new name to the database? I know how to do a standard file upload, but can't seem to get the new new to be saved into the databaseany pointers would be fantastic. Cheers Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with query
Hi, i can´t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to know how many different dates that exists in the table. Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with query
$number=mysql_num_rows(mysql_query(SELECT DISTINCT date FROM $table)); Op zaterdag 09 februari 2002 13:41, schreef Daniel Alsén: Hi, i can´t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to know how many different dates that exists in the table. Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with query
Hi, i can?t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to know how many different dates that exists in the table. select count(distinct name) from site; in Mysql Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] Help with query
Thanks guys! - Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] One more quickie
Don´t really want to bother you with these quickies - but: If i have a result from mysql that is a date (2002-02-09) - how do i change that into a variable with only the first 7 characters (2002-02)? Thanks # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] One more quickie
Don?t really want to bother you with these quickies - but: If i have a result from mysql that is a date (2002-02-09) - how do i change that into a variable with only the first 7 characters (2002-02)? SELECT year(data), month (data) from table; Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] One more quickie
or: SELECT LEFT(date, 7) as YearAndMonth FROM table; Edward - Original Message - From: val petruchek [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 2:28 PM Subject: Re: [PHP] One more quickie Don?t really want to bother you with these quickies - but: If i have a result from mysql that is a date (2002-02-09) - how do i change that into a variable with only the first 7 characters (2002-02)? SELECT year(data), month (data) from table; Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] One more quickie
$qr=select DATE_FORMAT(date_field,\%Y-%d\) as fmt_date from table $whereclause; then grab 'fmt_date' from the results... Don´t really want to bother you with these quickies - but: If i have a result from mysql that is a date (2002-02-09) - how do i change that into a variable with only the first 7 characters (2002-02)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] attachment problem
Hi Olev: There are several threads on this in the archives. In fact it was discussed just the other day. http://groups.google.com/groups?hl=engroup=php.general Put mime email into the search criteria and that discussion is the third one down. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Well I made it work...but
hi! I was unable to find any pre-written php code for a survey without a database and using text files. So I was faced with the challenge of writing my first script! -lol What I eventually ended up with was a 3 answer poll, that will be called for as many questions as I need, then I wil display the total results at the end of the survey. The problem is that the only way I was able to get it to work was to create a seperate text file for each available answer, (eg, yes.txt, no.txt notsure.txt) Which fir multiple questions can get kinda filey-lol This is what I WANTED to do, but was unable so far to find the way if there is one. I wanted to have one text file for answer storage, possibly writing the values for each answer on a seperate line, or a comma seperated list on one line. I was never able to extract values from a specific area in the text file. I tried to use fseek() to move the file pointer, but all I could get was 1 or 0. As I write this I thtink I remember reading of a function that allows you to read part of a file, and print the rest or something, but I need to able to first read a specific line, or value in the file, then extract just that value, and then update that value acording to the users answer, and then replace the updated value back in its respective place. All without touching the other values. Can anyone guide me to the proper way of figuring this out? Also, I wanted to create a IP log to prevent anyone from taking the poll / survey. The way I did it was to simply write the users REMOTE_ADDR to a text file, and then I used strstr($firstvalue, $second) to search for it and display the appropriate content. Is this appropriate? thanks for reading this far-lol -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Any way to protect cookies?
I have a website with logins, personal profiles, and stuff. I'd like to allow people to have htmlin their profiles, but if I did, they could use javascript to get people's cookies and hack their accounts! What can I do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Exact string replacement...
use substr_replace string substr_replace(string text, string replacement, integer start, integer length) EG: ? $text = Wow! This is neat, yes it is!; print($text); print('br'); print(substr_replace($text, are, 10, 2)); ? 10 is the place where you want it to start replacement, 2 (is) more forward it ends. Desikan [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, Please help me out in the following... ?php $is='is'; echo eregi_replace( .$is. , ,This is a test string which contains is in dismissal); ? Actually I want to replace is alone from the string and not all the words that contains is... I have tried with ^.$is.$ --- but yields nothing Also tried with \b... thanks and regards, Desikan -- Desikan [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Any way to protect cookies?
Well, I guess using session instead of cookies for start and using a database, text-file whatever to store their html code, each user his own code... hope this helps Arik Leif K-Brooks wrote: I have a website with logins, personal profiles, and stuff. I'd like to allow people to have htmlin their profiles, but if I did, they could use javascript to get people's cookies and hack their accounts! What can I do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I'm new here is there.....
I know this php.general - is there another newsgroup which specifically deals with help issues? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Modifying a record works but not in actual database?
I'm trying to set up a modify record page, and after testing and triple-checking the syntax and form, and even running the query in the phpMyAdmin interface to make sure the query is correct. This is just a snippet of what I've done: ?php // open connection include (connectdatabase.inc); // format names to protects the O'Haras etc. $esc_fname = addslashes($fname); $esc_lname = addslashes($lname); $esc_email = addslashes($email); $esc_web = addslashes($web); // set up query $sql = 'UPDATE thistable SET FNAME = $esc_fname, LNAME = $esc_lname, EMAIL = $esc_email, WEB = $esc_web WHERE ID = $id'; // perform query $sql_result = mysql_query($sql); if (!$sql_result) { echo Can't execute $sql . mysql_error(); exit; } // close connection mysql_close($connection); ? The problem? On the PHP front (my mofidy record page) says it's performed without a problem. However, if I were to do a view all records - I can see that none of the changes has actually been made to the database. Adding a record is not a problem; nor is deleting a record. Can someone point me into the right direction as to what I might be doing wrong? Thanks! Laurie Landry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Console, colors and stuff
Hey Boys, I'm using PHP CGI version on Win32 to write some scripts. Not for a website or anything, just some scripting at the console window. So now I want to change the text color, clear the screen, and the other usual stuff. Just like I can do with ncursus on the Linux version of PHP. Only, I can't find something similar on Win32. It's pretty boring this way. Does anyone know how to do it? Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ok still want to join a project...
any offers? or start one... Arik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ok still want to join a project...
On Sunday 10 February 2002 01:42, Arik Ashepa wrote: any offers? or start one... If you're still stuck for ideas, how about a jobs board, something like monster.com? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Kaufman's First Law of Party Physics: Population density is inversely proportional to the square of the distance from the keg. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Modifying a record works but not in actual database?
On Sunday 10 February 2002 00:47, [EMAIL PROTECTED] wrote: I'm trying to set up a modify record page, and after testing and triple-checking the syntax and form, and even running the query in the phpMyAdmin interface to make sure the query is correct. This is just a snippet of what I've done: ?php // open connection include (connectdatabase.inc); // format names to protects the O'Haras etc. $esc_fname = addslashes($fname); $esc_lname = addslashes($lname); $esc_email = addslashes($email); $esc_web = addslashes($web); // set up query $sql = 'UPDATE thistable SET FNAME = $esc_fname, LNAME = $esc_lname, EMAIL = $esc_email, WEB = $esc_web WHERE ID = $id'; If you print/echo $sql at this point you'll (hopefully) see where you're going wrong. If you don't see what you're doing wrong then swap your single quotes for double quotes and vice-versa. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The Killer Ducks are coming!!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ok still want to join a project...
nice... anyone else has an idea? Jason Wong wrote: On Sunday 10 February 2002 01:42, Arik Ashepa wrote: any offers? or start one... If you're still stuck for ideas, how about a jobs board, something like monster.com? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Age
Could anybody find out the simplest method of calculating the age? The date of birth is in the format string ('01/01/1977'). André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Modifying a record works but not in actual database?
Thanks Jason, switching the single and double quotes did the trick! Now, I'm curious - what's the rule of thumb for when using single quotes and double quotes? Thanks! -- Laurie Landry [EMAIL PROTECTED] - email (604) 693-1120 - voicemail/fax Jason Wong [EMAIL PROTECTED] wrote: On Sunday 10 February 2002 00:47, [EMAIL PROTECTED] wrote: I'm trying to set up a modify record page, and after testing and triple-checking the syntax and form, and even running the query in the phpMyAdmin interface to make sure the query is correct. This is just a snippet of what I've done: ?php // open connection include (connectdatabase.inc); // format names to protects the O'Haras etc. $esc_fname = addslashes($fname); $esc_lname = addslashes($lname); $esc_email = addslashes($email); $esc_web = addslashes($web); // set up query $sql = 'UPDATE thistable SET FNAME = $esc_fname, LNAME = $esc_lname, EMAIL = $esc_email, WEB = $esc_web WHERE ID = $id'; If you print/echo $sql at this point you'll (hopefully) see where you're going wrong. If you don't see what you're doing wrong then swap your single quotes for double quotes and vice-versa. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The Killer Ducks are coming!!! */ -- 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] forms page
Hello PHP Group, Thanks for the information on the books. I have a questions about a forms page. I wish to create a page using PHP to create a page that is submitted to my email address. Is this similar to HTML? Also, if you have any good examples out there on the web - I'd like to take a look. Thanks, Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] free usefull piece of code for everybody!
a random image maker based on the gd library (PNG)... ?php function setPenColors($theimage) { global $redpen, $greenpen, $bluepen, $blackpen, $whitepen, $yellowpen, $aquapen, $fuschiapen, $greypen, $silverpen, $tealpen, $limepen, $navypen, $purplepen, $maroonpen, $olivepen; $redpen = ImageColorAllocate($theimage, 255, 0, 0); $greenpen = ImageColorAllocate($theimage, 0, 153, 0); $bluepen = ImageColorAllocate($theimage, 0, 0, 255); $blackpen = ImageColorAllocate($theimage, 0, 0, 0); $whitepen = ImageColorAllocate($theimage, 255, 255, 255); $yellowpen = ImageColorAllocate($theimage, 255, 255, 0); $aquapen = ImageColorAllocate($theimage, 0, 255, 255); $fuschiapen = ImageColorAllocate($theimage, 255, 0, 255); $greypen = ImageColorAllocate($theimage, 153, 153, 153); $silverpen = ImageColorAllocate($theimage, 204, 204, 204); $tealpen = ImageColorAllocate($theimage, 0, 153, 153); $limepen = ImageColorAllocate($theimage, 0, 255, 0); $navypen = ImageColorAllocate($theimage, 0, 0, 153); $purplepen = ImageColorAllocate($theimage, 153, 0, 153); $maroonpen = ImageColorAllocate($theimage, 153, 0, 0); $olivepen = ImageColorAllocate($theimage, 153, 153, 0); } $servername = getenv(SERVER_NAME); // set the content type header(Content-type: image/png); $imageWidth = 118; $imageHeight = 136; // create image $image = imageCreate($imageWidth, $imageHeight); $bgcolor = ImageColorAllocate($image, 0, 0, 0); $fgcolor = ImageColorAllocate($image, 255, 255, 255); setPenColors($image); srand ((double) microtime() * 100); $rndnum = rand(10,60); $oldx = rand(1,$imageWidth-2); $oldy = rand(1,$imageHeight-18); $pencolor = array ($redpen,$greenpen,$bluepen,blackpen,$whitepen,$yellowpen,$aquapen,$fuschiapen,$greypen,$silverpen,$tealpen,$limepen,$navypen,$purplepen,$maroonpen,$olivepen); $rndpen = rand(0,15); ImageRectangle($image, 0, 0, $imageWidth-1, $imageHeight-17, $pencolor[$rndpen]); for ($i=0; $i$rndnum; $i++) { $rndpen = rand(0,15); $newx = rand(1,$imageWidth-2); $newy = rand(1,$imageHeight-18); ImageLine ($image, $oldx, $oldy, $newx, $newy, $pencolor[$rndpen]); $oldx = $newx; $oldy = $newy; } ImageString($image,2, 4, $imageHeight-14, Random Image Maker, $limepen); // create an interlaced image for better loading in the browser imageInterlace($image, 1); // mark background color as being transparent imageColorTransparent($image, $bgcolor); // now send the picture to the client (this outputs all image data directly) imagePNG($image); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ok still want to join a project...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Arik Ashepa declared nice... anyone else has an idea? How about a Haiku db? The php list a place for conversation with other nutters Hehe,. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZWlsHpvrrTa6L5oRAriVAJ9GR95YAg98CIspv2X4Zjom2K3T3gCfT1AM vZOV12HCCE89gRjMfgVs/cM= =wbyf -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Exact string replacement...
Hello Desikan, this should suit your needs. ? $string = Is this is a way of getting strings containing \is\ dismissed from the string? It IS; $pattern = is; $string = preg_replace(/(^|\s|[^a-z]) . $pattern . ($|\s|[^a-z])/is, $1$2, $string); echo $string; ? ~James Please help me out in the following... ?php $is='is'; echo eregi_replace( .$is. , ,This is a test string which contains is in dismissal); ? Actually I want to replace is alone from the string and not all the words that contains is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Modifying a record works but not in actual database?
On Sunday 10 February 2002 02:10, [EMAIL PROTECTED] wrote: Thanks Jason, switching the single and double quotes did the trick! Now, I'm curious - what's the rule of thumb for when using single quotes and double quotes? Basically: Anything inside single quotes stays exactly as it is. Anything inside double quotes which starts with $ gets evaluated where possible. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Culture is the habit of being pleased with the best and knowing why. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Table exists?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, What would be the easiest way to see if a MySQL table exists with PHP? I can do it by checking against mysql_list_tables() but that seems a little clumsy. Is there a better way? - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZWpZHpvrrTa6L5oRAtJwAJ44JTLEU1kgAyXS8fBNawLocpsJPQCeJpwW 2xELNyaALyoYZv60kJeLU5k= =riQB -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free usefull piece of code for everybody!
On Sunday 10 February 2002 02:19, Arik Ashepa wrote: [snip] // now send the picture to the client (this outputs all image data directly) imagePNG($image); Very nice! Hey someone give this guy a project to work on :) -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Never ask the barber if you need a haircut. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I'm new here is there.....
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Cyberskydive) wrote: I know this php.general - is there another newsgroup which specifically deals with help issues? PHP General does deal with help issues. Alternatively, you can post to news:alt.php. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Console, colors and stuff
Try 'echo'ing ansi control sequences? -- Alan Richard [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey Boys, I'm using PHP CGI version on Win32 to write some scripts. Not for a website or anything, just some scripting at the console window. So now I want to change the text color, clear the screen, and the other usual stuff. Just like I can do with ncursus on the Linux version of PHP. Only, I can't find something similar on Win32. It's pretty boring this way. Does anyone know how to do it? Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Table exists?
Nick Wilson wrote: What would be the easiest way to see if a MySQL table exists with PHP? I can do it by checking against mysql_list_tables() but that seems a little clumsy. Is there a better way? Do a select on the table - if the query returns true the table exists otherwise the test is inconclusive.. Best regards Martin Petersen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Age
don't know if there is some date_diff -like function, but you can do it this way: $now = getdate(); $nw_year = $now[year]; $nw_month = $now[mon]; $nw_day = $now[mday]; $chk_date = 09/02/1977; list ($chk_day, $chk_month, $chk_year) = explode(/, $chk_date); print $nw_year; $age = $nw_year - $chk_year; if ($nw_month$chk_month) $age--; if ($nw_month==$chk_month $nw_day$chkday) $age--; print BRage: .$age; assuming that the date : dd/mm/ greets, edward - Original Message - From: André Felix Miertschink [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 8:08 PM Subject: [PHP] Age Could anybody find out the simplest method of calculating the age? The date of birth is in the format string ('01/01/1977'). André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Table exists?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Martin C. Petersen declared Do a select on the table - if the query returns true the table exists otherwise the test is inconclusive.. Yep, that'l do it. cheers. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZYQEHpvrrTa6L5oRAnT2AKCxXgZv9C5+4RCu/Atn5sLCOF7pmACfbgAc Trt749MnUo6/GJsU+D6ykyg= =QXfl -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] rating system
does anyone know a very flexible rating system, written in php of course? i have an application where i want to rate different data that the application saves and may relate the data to each other. I.e. a very active/known/famous/any-attribute user rates an item, then this vote might weigh more than one who is unknown to the system. This means you might also be able to rate a user and have some algorithm to show the result in a weighed way. And besides it should also do things like: let every user only vote once a day/month/hour/..., and all this common stuff. thanks for the help -- Wolfram ... translating template system ... http://freshmeat.net/projects/simpletemplateii -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_select_db() problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I just can't see what could possibly be wrong with my php here: $sel_db=mysql_select_db(mydb) or die (could not get the bugger); exit; I can 'USE mydb' just fine from the command line so what's the problem? (returns the die statement) Much thanks.. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZYWRHpvrrTa6L5oRArthAJ9Vew5DIKSR7qzc4M2abhxJfpz5TwCfRmZJ ZBn2oUXT4UgsH1hM/UyyNGs= =ajT+ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Table exists?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Nick Wilson) wrote: What would be the easiest way to see if a MySQL table exists with PHP? I can do it by checking against mysql_list_tables() but that seems a little clumsy. Is there a better way? See MySQL's documentation of the CREATE TABLE and DROP TABLE syntax: both support table existance checks. create table if not exists mytablename... drop table if exists mytablename... -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_select_db() problem
It may be having a problem because you are not specifying which connection to use. perhaps try something like this: if(!$db = @mysql_connect($dbhost, $dbuser, $dbpasswd)) die(An Error Occured. Unable to connect to the database.); if(!@mysql_select_db($dbname,$db)) die(An Error Occured. Unable to find the database $dbname on the MySQL server.); Hope that helps. Jeff At 09:24 PM 2/9/2002 +0100, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I just can't see what could possibly be wrong with my php here: $sel_db=mysql_select_db(mydb) or die (could not get the bugger); exit; I can 'USE mydb' just fine from the command line so what's the problem? (returns the die statement) Much thanks.. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZYWRHpvrrTa6L5oRArthAJ9Vew5DIKSR7qzc4M2abhxJfpz5TwCfRmZJ ZBn2oUXT4UgsH1hM/UyyNGs= =ajT+ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Console, colors and stuff
I thought about it, but in Windows 2000 and NT, you can't use ansi.sys from Win32 executables, only from Dos16 exe's. Richard Alan McFarlane [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Try 'echo'ing ansi control sequences? -- Alan Richard [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey Boys, I'm using PHP CGI version on Win32 to write some scripts. Not for a website or anything, just some scripting at the console window. So now I want to change the text color, clear the screen, and the other usual stuff. Just like I can do with ncursus on the Linux version of PHP. Only, I can't find something similar on Win32. It's pretty boring this way. Does anyone know how to do it? Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Table exists?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then CC Zona declared In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Nick Wilson) wrote: What would be the easiest way to see if a MySQL table exists with PHP? I can do it by checking against mysql_list_tables() but that seems a little clumsy. Is there a better way? See MySQL's documentation of the CREATE TABLE and DROP TABLE syntax: both support table existance checks. create table if not exists mytablename... drop table if exists mytablename... Yeah, but I don't want to create or drop the table, I just want to check it exists. Thanks anyway. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZYtKHpvrrTa6L5oRAstZAKCbKPBSjja+WkBB6xuV3p/CL5+u3ACgrHVS HzIhSNIpfVAVtEtOnLpvYMU= =D7Ja -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_select_db() problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Jeff Sheltren declared It may be having a problem because you are not specifying which connection to use. perhaps try something like this: if(!$db = @mysql_connect($dbhost, $dbuser, $dbpasswd)) die(An Error Occured. Unable to connect to the database.); if(!@mysql_select_db($dbname,$db)) die(An Error Occured. Unable to find the database $dbname on the MySQL server.); No, that's not it. If you don't specify a link id then it assumes the last connection or trys to establish one. (I've tried it anyway :-) Come on guys, someone must be able to spot the 'gotcha'! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZYz6HpvrrTa6L5oRAtwcAJ9FTvFFc57I7lUs8euOPp42nc6dZwCeMmis UK+HqUaQ6fJlMUFWOlVsMZ8= =ymec -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Modifying a record works but not in actual database?
try using // set up query $sql = UPDATE thistable SET FNAME = \$esc_fname\, LNAME = \$esc_lname\, EMAIL = \$esc_email\, WEB = \$esc_web\ WHERE ID = \$id\ ; variables aren't expanded inside ' so you need to use Paul Roberts [EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 4:47 PM Subject: [PHP] Modifying a record works but not in actual database? I'm trying to set up a modify record page, and after testing and triple-checking the syntax and form, and even running the query in the phpMyAdmin interface to make sure the query is correct. This is just a snippet of what I've done: ?php // open connection include (connectdatabase.inc); // format names to protects the O'Haras etc. $esc_fname = addslashes($fname); $esc_lname = addslashes($lname); $esc_email = addslashes($email); $esc_web = addslashes($web); // set up query $sql = 'UPDATE thistable SET FNAME = $esc_fname, LNAME = $esc_lname, EMAIL = $esc_email, WEB = $esc_web WHERE ID = $id'; // perform query $sql_result = mysql_query($sql); if (!$sql_result) { echo Can't execute $sql . mysql_error(); exit; } // close connection mysql_close($connection); ? The problem? On the PHP front (my mofidy record page) says it's performed without a problem. However, if I were to do a view all records - I can see that none of the changes has actually been made to the database. Adding a record is not a problem; nor is deleting a record. Can someone point me into the right direction as to what I might be doing wrong? Thanks! Laurie Landry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ok still want to join a project...
Emphasis on the second-last word? =dn - Original Message - From: Nick Wilson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 09 February 2002 18:24 Subject: Re: [PHP] ok still want to join a project... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Arik Ashepa declared nice... anyone else has an idea? How about a Haiku db? The php list a place for conversation with other nutters Hehe,. - -- Nick Wilson Tel: +45 3325 0688 Fax: +45 3325 0677 Web: www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZWlsHpvrrTa6L5oRAriVAJ9GR95YAg98CIspv2X4Zjom2K3T3gCfT1AM vZOV12HCCE89gRjMfgVs/cM= =wbyf -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ssl
James, The problem has, in my case, nothing to do with switching from SSL to non SSL. On my non SSL test machine everything works 100% but when I run the same script on a different machine with SSL it doesn't work. I think I know where the problem I'm having is coming from; My non SSL connection runs on apache with php, the SSL server is running Win2K with PHP as CGI (I am testing this soon on a cobalt; keep you posted on the issue). Please correct me if I'm wrong, but I think the CGI version of PHP doesn't support the WWW authentication method. So I'm guessing my subject was a little off. Maybe a good solution for you is creating a form on the page just before leaving SSL with the variables you want to transfer in hidden fields, and re-registering them in the non SSL environment. Frank. -Oorspronkelijk bericht- Van: James Arthur [mailto:[EMAIL PROTECTED]] Verzonden: zaterdag 9 februari 2002 22:03 Aan: Frank Hertogs Onderwerp: Re: [PHP] ssl On Friday 01 Feb 2002 22:25, Frank Hertogs wrote: Anyone have experience with authentication on ssl connections, I have a (working) script to authenticate a user but as soon as I put it on my ssl it just stops working. Frank, can you elaborate a little? Are you using cookies, sessions etc? I have a problem where I send my user to a https page which allows them to enter username and password. They then get given a session cookie. When they are redirected to the non-SSL page the session variables are not transferred. Is this a little like the problem you have? Have you found a way around it yet? --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 9 Feb 2002 21:25:49 -0000 Issue 1162
php-general Digest 9 Feb 2002 21:25:49 - Issue 1162 Topics (messages 84092 through 84138): Dll on Visual Basic 84092 by: Edgardo Rossetto Script breaks connection? 84093 by: Cedric Ancellin file upload and change name 84094 by: will hives Help with query 84095 by: Daniel Alsén 84096 by: Bas Jobsen 84097 by: val petruchek 84098 by: Daniel Alsén One more quickie 84099 by: Daniel Alsén 84100 by: val petruchek 84101 by: Edward van Bilderbeek - Bean IT 84102 by: Dennis Moore Re: attachment problem 84103 by: Analysis and Solutions Well I made it work...but 84104 by: cyberskydive Any way to protect cookies? 84105 by: Leif K-Brooks 84107 by: Arik Ashepa Re: Exact string replacement... 84106 by: cyberskydive 84120 by: liljim I'm new here is there. 84108 by: cyberskydive 84124 by: CC Zona Modifying a record works but not in actual database? 84109 by: lmlweb.mybc.com 84113 by: Jason Wong 84116 by: lmlweb.mybc.com 84121 by: Jason Wong 84136 by: Paul Roberts Console, colors and stuff 84110 by: Richard 84125 by: Alan McFarlane 84133 by: Richard ok still want to join a project... 84111 by: Arik Ashepa 84112 by: Jason Wong 84114 by: Arik Ashepa 84119 by: Nick Wilson 84137 by: DL Neil Age 84115 by: André Felix Miertschink 84127 by: Edward van Bilderbeek - Bean IT forms page 84117 by: Ronald D Wahlen free usefull piece of code for everybody! 84118 by: Arik Ashepa 84123 by: Jason Wong Table exists? 84122 by: Nick Wilson 84126 by: Martin C. Petersen 84128 by: Nick Wilson 84131 by: CC Zona 84134 by: Nick Wilson rating system 84129 by: Wolfram Kriesing mysql_select_db() problem 84130 by: Nick Wilson 84132 by: Jeff Sheltren 84135 by: Nick Wilson Re: ssl 84138 by: Frank Hertogs 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--- Hi, Basically, what I want to do is call php4ts.dll (or whatever) to use highlight_string/file function on Visual Basic and return it on a ritchtextbox. Is this possible? Help! Regards, Edgardo Rossetto ---End Message--- ---BeginMessage--- I have a scripts, which, when runs, breaks the connection to Apache and I have no idea why. This script has lots of function calls, some return large arrays. After I've trim the scripts to the point where it connects and run, if I add a printf(Hello World) or any custom function I get this error: Connection to host localhost is broken Is there a max number of functions that can be called or some other kind of limit that can affect it? I've compiled php 4 into apache on Linux. This is not the first time it happens, it happened before when I transfered a php file from another server to this one. It worked fine on the other server but I got connection broken when ran a specific file on this server. Please help ---End Message--- ---BeginMessage--- Hi, Does anyone know how to change the name of and image and save the new name to the database? I know how to do a standard file upload, but can't seem to get the new new to be saved into the databaseany pointers would be fantastic. Cheers Will ---End Message--- ---BeginMessage--- Hi, i can´t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to know how many different dates that exists in the table. Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # ---End Message--- ---BeginMessage--- $number=mysql_num_rows(mysql_query(SELECT DISTINCT date FROM $table)); Op zaterdag 09 februari 2002 13:41, schreef Daniel Alsén: Hi, i can´t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to know how many different dates that exists in the table. Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # ---End Message--- ---BeginMessage--- Hi, i can?t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to know how many different dates that exists in the table. select count(distinct name) from site; in Mysql Valentin Petruchek (aki Zliy Pes)
Re: [PHP] mysql_select_db() problem
On Sat, 2002-02-09 at 12:24, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I just can't see what could possibly be wrong with my php here: $sel_db=mysql_select_db(mydb) or die (could not get the bugger); exit; I can 'USE mydb' just fine from the command line so what's the problem? (returns the die statement) Much thanks.. - -- Nick Wilson I take it that the connection worked fine? (Yeah, dumb question, but you never know.) What do you get if you use error checking? if (!$dbh = mysql_connect(. . .)) { echo Could not connect; reason was . mysql_error() . \n; return false; } if (!$sel_db = mysql_select_db('mydb', $dbh)) { echo Could not select database '$sel_db'; reason was . mysql_error() . \n; return false; } i.e. what do you get if you use mysql_error() after this fails? Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Colecting IP information
Trying to colect ip, and name server, dns name from a user how do I do this? can you point me to the right place? Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012
Re: [PHP] Parameters via Link
Still doesnt' work, any ither suggestions? Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... On Saturday 09 February 2002 02:23, Manuel Ritsch wrote: Hey there I want to make a webpage out of one main pagewith php, if you press on a link i want that it changes the content of the page, but it doesn't seem to work, i tried it like this... link: a href=index.php?link=home php code: if($link == home) if ($link == home); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Trespassers will be shot. Survivors will be SHOT AGAIN! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Nested functions
Hi, Have been experimenting with the array_walk function and a little array debug print facility, but ran into a problem with nested functions. The code can be written with nested functions and successfully executed once; but when repeatedly executed an error appears. Can one code user-defined functions nested within one another - and repeatedly execute them? The PHP Manual: Chapter 12. Functions, says: A function may be defined using syntax such as the following: ... Any valid PHP code may appear inside a function, even other functions and class definitions. Here is some test-bed code: ?php Function ShowList( $title, $aList ) { Function FnNested( $item, $key ) { echo br$key= . $item . ~; } //end of FnNested echo brListing array=$title: n= . count( $aList ); array_walk( $aList, FnNested ); } //end of function ShowList //mainline code $aLocated = array( 'zero', 'one', 'two', 'three' ); ShowList( Located1, $aLocated ); ShowList( Located2, $aLocated ); ? Sample output: FnShowList~ Listing array=Located1: n=4 0=zero~ 1=one~ 2=two~ 3=three~ FnShowList~ Fatal error: Cannot redeclare fnnested() in c:\data\webs\webute_tst\l.php on line 6 Please advise, =dn WinNT 4.0 SP6a running PHP vn 4.0.6, Apache vn 1.3.20WinNT, MySQL vn 3.23.40-nt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parameters via Link
On Sat, 2002-02-09 at 15:39, Manuel Ritsch wrote: Still doesnt' work, any ither suggestions? Sounds like you don't have register_globals turned on. (Don't turn it on! globals are eevviill! ;) Try: if ($_REQUEST['link'] == 'home') { . . . } Or, if using an older (pre-4.1.0) version of PHP, try: if ($HTTP_GET_VARS['link'] == 'home') { . . . } Hope this helps, Torben Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... On Saturday 09 February 2002 02:23, Manuel Ritsch wrote: Hey there I want to make a webpage out of one main pagewith php, if you press on a link i want that it changes the content of the page, but it doesn't seem to work, i tried it like this... link: a href=index.php?link=home php code: if($link == home) if ($link == home); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Trespassers will be shot. Survivors will be SHOT AGAIN! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parameters via Link
I have PHP Version 4.0.5 and register_globals turned on but it doesnt' work =( Lars Torben Wilson [EMAIL PROTECTED] schrieb im Newsbeitrag 1013298469.9790.13.camel@ali">news:1013298469.9790.13.camel@ali... On Sat, 2002-02-09 at 15:39, Manuel Ritsch wrote: Still doesnt' work, any ither suggestions? Sounds like you don't have register_globals turned on. (Don't turn it on! globals are eevviill! ;) Try: if ($_REQUEST['link'] == 'home') { . . . } Or, if using an older (pre-4.1.0) version of PHP, try: if ($HTTP_GET_VARS['link'] == 'home') { . . . } Hope this helps, Torben Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... On Saturday 09 February 2002 02:23, Manuel Ritsch wrote: Hey there I want to make a webpage out of one main pagewith php, if you press on a link i want that it changes the content of the page, but it doesn't seem to work, i tried it like this... link: a href=index.php?link=home php code: if($link == home) if ($link == home); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Trespassers will be shot. Survivors will be SHOT AGAIN! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Nested functions
On Sat, 2002-02-09 at 15:40, DL Neil wrote: Hi, Have been experimenting with the array_walk function and a little array debug print facility, but ran into a problem with nested functions. The code can be written with nested functions and successfully executed once; but when repeatedly executed an error appears. Can one code user-defined functions nested within one another Yes. - and repeatedly execute them? No. ;) The PHP Manual: Chapter 12. Functions, says: A function may be defined using syntax such as the following: ... Any valid PHP code may appear inside a function, even other functions and class definitions. This is correct. As you know, the thing is that execution keeps running into that function declaration every time the containing function is run, tries to declare the function, and fails. Essentially: while you *can* do nested functions in PHP, don't. :) There really isn't any good reason to, anyway--except for (perhaps) a wee bit of namespace clarification. Here is some test-bed code: ?php Function ShowList( $title, $aList ) { Function FnNested( $item, $key ) { echo br$key= . $item . ~; } //end of FnNested echo brListing array=$title: n= . count( $aList ); array_walk( $aList, FnNested ); } //end of function ShowList //mainline code $aLocated = array( 'zero', 'one', 'two', 'three' ); ShowList( Located1, $aLocated ); ShowList( Located2, $aLocated ); ? There really isn't any reason to do this; you could achieve the same thing like so: ?php error_reporting(E_ALL); function FnNested( $item, $key ) { echo br$key= . $item . ~; } //end of FnNested function ShowList( $title, $aList ) { echo brListing array=$title: n= . count( $aList ); array_walk( $aList, FnNested ); } //end of function ShowList //mainline code $aLocated = array( 'zero', 'one', 'two', 'three' ); ShowList( Located1, $aLocated ); ShowList( Located2, $aLocated ); ? Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parameters via Link
On Sat, 2002-02-09 at 15:54, Manuel Ritsch wrote: I have PHP Version 4.0.5 and register_globals turned on but it doesnt' work =( Is it inside a function? If not, can you send me a copy of the script? Torben Lars Torben Wilson [EMAIL PROTECTED] schrieb im Newsbeitrag 1013298469.9790.13.camel@ali">news:1013298469.9790.13.camel@ali... On Sat, 2002-02-09 at 15:39, Manuel Ritsch wrote: Still doesnt' work, any ither suggestions? Sounds like you don't have register_globals turned on. (Don't turn it on! globals are eevviill! ;) Try: if ($_REQUEST['link'] == 'home') { . . . } Or, if using an older (pre-4.1.0) version of PHP, try: if ($HTTP_GET_VARS['link'] == 'home') { . . . } Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] set_error_handler() not catching some errors
set_error_handler() is passing some errors like: $d = x; Use of undefined constant x - assumed 'x' But others like not including a semicolon returns nothing: $d = 3 The page is not returned there is no error and the page is stopped being parsed. Any ideas? My handler function: Function errorHandler($errno, $errstr, $errfile, $errline) { print($errstr); print($errfile); print(Line: . $errline); // Exit the script to fix the error. exit(); } // Set the error handler. set_error_handler(errorHandler); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_select_db() problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Lars Torben Wilson declared I take it that the connection worked fine? (Yeah, dumb question, but you never know.) Yeah, all is well as far as connections concerned. What do you get if you use error checking? Well, that seems to be it, I'm getting 'Access deneid to user '@localhost'. I'm talking to a guy on the mysql list, apparently it is a phenomememememememmemonmmm that when you GRANT ALL using wildcards it tends to grant all on * except localhost! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8ZcMsHpvrrTa6L5oRAqyCAKChAKKFljtpKg+vKArgbLW6KwT2CQCeM5xc tRuUnNm8WUGOl8M7l1xrXfU= =xr5Z -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Colecting IP information
Dunno right off hand about NS and DNS but a simple getenv('REMOTE_ADDR'); will return the IP address of a user. Philip J. Newman [EMAIL PROTECTED] wrote in message 001d01c1b1c1$b33fec80$0401a8c0@philip">news:001d01c1b1c1$b33fec80$0401a8c0@philip... Trying to colect ip, and name server, dns name from a user how do I do this? can you point me to the right place? Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sitenavigation
Hi! Is i possible to make a function that makes a prev and a next link on the page if it returns, say over 20 rows or hits in a query? Could anyone give me a hint if they know how to? Best regrds Raymond -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] set_error_handler() not catching some errors
At 04:36 PM 2/9/2002 -0800, Charlie Killian wrote: But others like not including a semicolon returns nothing: $d = 3 The page is not returned there is no error and the page is stopped being parsed. This is by design. Quoting from http://bugs.php.net/bug.php?id=9386: quote [17 Jun 2001 4:56am] [EMAIL PROTECTED] FATAL errors are not passed through user error handlers due to the fact the engine may be unstable and this could present security issues, instead the engine reports the error via its default mechanism as described in php.ini and then shutsdown as gracefully as possible. - James /quote Sounds like you have your php.ini configured to not display errors, since you are not seeing the parse error message in your HTML output... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Phatt MySQL entry
Hi, I was wondering what you would do in this situation... I have a form, with 196 fields that I need entered into a database. But the form and it's contents need to be changed every day, and I need to store the old data in an archive so it can be accessed at a later date. That means that after a week, I'm going to have a tonne of data. Catch is, this form will be used every day for about 3 years. I'm pretty certain MySQL can handle it, but I need to know, what would be the best way to store this data? I've set up a calendar, that will take the user to a different version of the form every day. Accesible here: http://www.fernwoodwhc.com/shit/calendar.php And the form I'm talking about is here: http://www.fernwoodwhc.com/tech.php Here's a copy (minus passwords) of my form... I'm sure that there's a better way to do it... html ? $usr = username; $pwd = password; $db = fmms; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); if (!$cid) { echo(ERROR: . mysql_error() . \n);} $SQL = INSERT INTO tech; $SQL = $SQL . ('fs6, num6, sur6, giv6, apt6, ph6, c6, fs63, num63, sur63, giv63, apt63, ph63, c63, fs7, num7, sur7, giv7, apt7, ph7, c7, fs73, num73, sur73, giv73, apt73, ph73, c73, fs8, num8, sur8, giv8, apt8, ph8, c8, fs83, num83, sur83, giv83, apt83, ph83, c83, fs9, num9, sur9, giv9, apt9, ph9, c9, fs93, num93, sur93, giv93, apt93, ph93, c93, fs10, num10, sur10, giv10, apt10, ph10, c10, fs103, num103, sur103, giv103, apt103, ph103, c103, fs11, num11, sur11, giv11, apt11, ph11, c11, fs113, num113, sur113, giv113, apt113, ph113, c113, fs12, num12, sur12, giv12, apt12, ph12, c12, fs123, num123, sur123, giv123, apt123, ph123, c123, fs1, num1, sur1, giv1, apt1, ph1, c1, fs13, num13, sur13, giv13, apt13, ph13, c13, fs2, num2, sur2, giv2, apt2, ph2, c2, fs23, num23, sur23, giv23, apt23, ph23, c23, fs3, num3, sur3, giv3, apt3, ph3, c3, fs33, num33, sur33, giv33, apt33, ph33, c33, fs4, num4, sur4, giv4, apt4, ph4, c4, fs43, num43, sur43, giv43, apt43, ph43, c43, fs5, num5, sur5, giv5, apt5, ph5, c5, fs53, num53, sur53, giv53, apt53, ph53, c53, fs6p, num6p, sur6p, giv6p, apt6p, ph6p, c6p, fs63p, num63p, sur63p, giv63p, apt6p3, ph63p, c63p, fs7p, num7p, sur7p, giv7p, apt7p, ph7p, c7p, fs73p, num73p, sur73p, giv73p, apt7p3, ph73p, c73p') VALUES ; $SQL = $SQL . ('$fs6', '$num6', '$sur6', '$giv6', '$apt6', '$ph6', '$c6', '$fs63', '$num63', '$sur63', '$giv63', '$apt63', '$ph63', '$c63', '$fs7', '$num7', '$sur7', '$giv7', '$apt7', '$ph7', '$c7', '$fs73', '$num73', '$sur73', '$giv73', '$apt73', '$ph73', '$c73', '$fs8', '$num8', '$sur8', '$giv8', '$apt8', '$ph8', '$c8', '$fs83', '$num83', '$sur83', '$giv83', '$apt83', '$ph83', '$c83', '$fs9', '$num9', '$sur9', '$giv9', '$apt9', '$ph9', '$c9', '$fs93', '$num93', '$sur93', '$giv93', '$apt93', '$ph93', '$c93', '$fs10', '$num10', '$sur10', '$giv10', '$apt10', '$ph10', '$c10', '$fs103', '$num103', '$sur103', '$giv103', '$apt103', '$ph103', '$c103', '$fs11', '$num11', '$sur11', '$giv11', '$apt11', '$ph11', '$c11', '$fs113', '$num113', '$sur113', '$giv113', '$apt113', '$ph113', '$c113', '$fs12', '$num12', '$sur12', '$giv12', '$apt12', '$ph12', '$c12', '$fs123', '$num123', '$sur123', '$giv123', '$apt123', '$ph123', '$c123', '$fs1', '$num1', '$sur1', '$giv1', '$apt1', '$ph1', '$c1', '$fs13', '$num13', '$sur13', '$giv13', '$apt13', '$ph13', '$c13', '$fs2', '$num2', '$sur2', '$giv2', '$apt2', '$ph2', '$c2', '$fs23', '$num23', '$sur23', '$giv23', '$apt23', '$ph23', '$c23', '$fs3', '$num3', '$sur3', '$giv3', '$apt3', '$ph3', '$c3', '$fs33', '$num33', '$sur33', '$giv33', '$apt33', '$ph33', '$c33', '$fs4', '$num4', '$sur4', '$giv4', '$apt4', '$ph4', '$c4', '$fs43', '$num43', '$sur43', '$giv43', '$apt43', '$ph43', '$c43', '$fs5', '$num5', '$sur5', '$giv5', '$apt5', '$ph5', '$c5', '$fs53', '$num53', '$sur53', '$giv53', '$apt53', '$ph53', '$c53', '$fs6p', '$num6p', '$sur6p', '$giv6p', '$apt6p', '$ph6p', '$c6p', '$fs63p', '$num63p', '$sur63p', '$giv63p', '$apt6p3', '$ph63p', '$c63p', '$fs7p', '$num7p', '$sur7p', '$giv7p', '$apt7p', '$ph7p', '$c7p', '$fs73p', '$num73p', '$sur73p', '$giv73p', '$apt7p3', '$ph73p', '$c73p') ; $result = mysql_db_query($db,$SQL,$cid); if (!$result) { echo(ERROR: . mysql_error() . \n$SQL\n);} // echo (Data Added\n); mysql_close($cid); } ? head STYLE TYPE=TEXT/CSS BODY { scrollbar-3dlight-color : #3893CF; scrollbar-arrow-color : #00; scrollbar-base-color : #00; scrollbar-darkshadow-color : #3893CF; scrollbar-face-color : #3893CF; scrollbar-highlight-color : #00; scrollbar-shadow-color : #00; scrollbar-track-color : #3893CF; } /STYLE /head body bgcolor=#3893CF topmargin=0 leftmargin=0 form action= method=POST table border=0 cellspacing=5 style=border-collapse: collapse bordercolor=#11 tr td align=centerbfont size=2Time/font/b/td td align=centerbfont size=2FW/SP/font/b/td td align=centerbfont size=2#/font/b/td td align=centerbfont
RE: [PHP] Sitenavigation
http://phpclasses.upperdesign.com/browse.html/package/371/ __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] limit to X posts on each page?
I have a newssystem on my homepage but you have to scroll rather long to get to the last post now, how do I limit it to show like 10 posts per page or something like that? With one document that is, I don't want to have a bunch of files with 10 posts in each .. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] set_error_handler() not catching some errors
Thanks Mike. I updated display_errors = On and now I see the errors. Charlie Sounds like you have your php.ini configured to not display errors, since you are not seeing the parse error message in your HTML output... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free usefull piece of code for everybody!
Arik, Cute little applet. For your php project, I still think a map of all the known breweries would be nice. Everyone could put in their favorite. Hugh - Original Message - From: Arik Ashepa [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 10:19 AM Subject: [PHP] free usefull piece of code for everybody! a random image maker based on the gd library (PNG)... ?php function setPenColors($theimage) { global $redpen, $greenpen, $bluepen, $blackpen, $whitepen, $yellowpen, $aquapen, $fuschiapen, $greypen, $silverpen, $tealpen, $limepen, $navypen, $purplepen, $maroonpen, $olivepen; $redpen = ImageColorAllocate($theimage, 255, 0, 0); $greenpen = ImageColorAllocate($theimage, 0, 153, 0); $bluepen = ImageColorAllocate($theimage, 0, 0, 255); $blackpen = ImageColorAllocate($theimage, 0, 0, 0); $whitepen = ImageColorAllocate($theimage, 255, 255, 255); $yellowpen = ImageColorAllocate($theimage, 255, 255, 0); $aquapen = ImageColorAllocate($theimage, 0, 255, 255); $fuschiapen = ImageColorAllocate($theimage, 255, 0, 255); $greypen = ImageColorAllocate($theimage, 153, 153, 153); $silverpen = ImageColorAllocate($theimage, 204, 204, 204); $tealpen = ImageColorAllocate($theimage, 0, 153, 153); $limepen = ImageColorAllocate($theimage, 0, 255, 0); $navypen = ImageColorAllocate($theimage, 0, 0, 153); $purplepen = ImageColorAllocate($theimage, 153, 0, 153); $maroonpen = ImageColorAllocate($theimage, 153, 0, 0); $olivepen = ImageColorAllocate($theimage, 153, 153, 0); } $servername = getenv(SERVER_NAME); // set the content type header(Content-type: image/png); $imageWidth = 118; $imageHeight = 136; // create image $image = imageCreate($imageWidth, $imageHeight); $bgcolor = ImageColorAllocate($image, 0, 0, 0); $fgcolor = ImageColorAllocate($image, 255, 255, 255); setPenColors($image); srand ((double) microtime() * 100); $rndnum = rand(10,60); $oldx = rand(1,$imageWidth-2); $oldy = rand(1,$imageHeight-18); $pencolor = array ($redpen,$greenpen,$bluepen,blackpen,$whitepen,$yellowpen,$aquapen,$fuschiap en,$greypen,$silverpen,$tealpen,$limepen,$navypen,$purplepen,$maroonpen,$oli vepen); $rndpen = rand(0,15); ImageRectangle($image, 0, 0, $imageWidth-1, $imageHeight-17, $pencolor[$rndpen]); for ($i=0; $i$rndnum; $i++) { $rndpen = rand(0,15); $newx = rand(1,$imageWidth-2); $newy = rand(1,$imageHeight-18); ImageLine ($image, $oldx, $oldy, $newx, $newy, $pencolor[$rndpen]); $oldx = $newx; $oldy = $newy; } ImageString($image,2, 4, $imageHeight-14, Random Image Maker, $limepen); // create an interlaced image for better loading in the browser imageInterlace($image, 1); // mark background color as being transparent imageColorTransparent($image, $bgcolor); // now send the picture to the client (this outputs all image data directly) imagePNG($image); ? -- 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