php-general Digest 18 Feb 2001 23:29:59 -0000 Issue 520 Topics (messages 40415 through 40476): EOF (End of File) character.. 40415 by: David Bouw Re: checking image extensions 40416 by: Hrishi 40423 by: ..s.c.o.t.t.. passing arrays through URLS 40417 by: Jamie Smith 40418 by: Jamie Smith Re: Simple REGEX? 40419 by: ..s.c.o.t.t.. Re: Apache config 40420 by: ..s.c.o.t.t.. Re: Count of multi-dimensional array 40421 by: ..s.c.o.t.t.. Re: Determingin if cookies are useable? 40422 by: ..s.c.o.t.t.. Re: Stylesheets 40424 by: ..s.c.o.t.t.. Re: Standard-Output 40425 by: Ben Peter Re: REGEX prob 40426 by: n e t b r a i n 40429 by: ..s.c.o.t.t.. 40438 by: Christian Reiniger 40457 by: n e t b r a i n using a regular expression to trim whitespace 40427 by: ..s.c.o.t.t.. Re: MySQL: Add Autoincrement Field? 40428 by: Hrishi Apache log analyzer 40430 by: John Vanderbeck Arrays and forms 40431 by: Jamie Smith Help!Opening another php file from a link of a completed form. 40432 by: Edith Lai apache 40433 by: Brandon Feldhahn 40435 by: Jeff Oien /n for PC & Unix 40434 by: Todd Cary 40449 by: Toby Butzon Re: UPS shipping calculation 40436 by: Ayan R. Kayal Re: searching for testcase that causes "failed to rollback outstanding transactions" or SEGFAULTs 40437 by: Thies C. Arntzen Re: Database Code Portability 40439 by: Manuel Lemos create array of random unique integers? 40440 by: andrew 40461 by: Robin Vickery Re: Can I select only the newest record? 40441 by: Brian Drexler 40448 by: PHPBeginner.com exit signal Floating point exception(8) 40442 by: Charles Peters 40443 by: Rasmus Lerdorf 40444 by: Charles Peters 40446 by: Rasmus Lerdorf Re: Creative solution with XML,PHP,MYSQL 40445 by: Brian Drexler Code Charge 40447 by: Charles Peters PHP functions 40450 by: Boaz Yahav 40451 by: Boaz Yahav 40452 by: Egon Schmid (.vacation) Uploading Files via PHP 40453 by: Brian Drexler 40456 by: Michael Stearne 40463 by: Brian Drexler 40471 by: Michael Stearne making form, getting variables from 40454 by: Dennis Gearon Re: Macs and PHP 40455 by: Michael Stearne 40462 by: Jesse Swensen 40465 by: Mike Yuen PDFLib, PHP 4.0.4, Arrrrrrgh! 40458 by: Cal Evans using slash as delimiter 40459 by: Paul Schreiber PHP as CGI 40460 by: Federico Ragazzoni PHP+MySQL SEARCH 40464 by: Gerry Sum function 40466 by: Claudia array - too stupid 40467 by: andreas \(.work\) Re: E-mail Validation Question 40468 by: Nuno Silva Re: Converting CFML to PHP 40469 by: Camden Spiller 40470 by: Brian Drexler 40472 by: Michael Stearne Apache and $HTTP_*_VARS 40473 by: Todd Cary SMTP on IIS 5.0 Windows 2000 Pro 40474 by: Peter Knif 40476 by: David Harrison Re: How to get new row on top? 40475 by: Tom 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] ----------------------------------------------------------------------
Hi... How do I get an EOF character when echo'ing an web page which will be written to an file.?? What I am trying to do is the following. I have an textstring (variable): Then I do the following: header("Content-disposition: filename=CLIEOP03"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); echo ("$datestring"); ($datastring contains the text) My browser pops up with a box to ask if I want to save this file.. The problem is, that when I save this file it has no EOF character at the end.. Normally I then use my text editor to open the file and then I just save it again to get the needed character.. I generate this file for an application.. The problem is that the application won't accept the file if there is no EOF character.. What is the correct characters to use to get an EOF character?? Thanks for the help.. Bye Bye David
> > if ((substr($imgName, -4) != ".jpg") || (substr($imgName, -4) != ".gif")) this case, in plain english is : if ext is not jpg, OR if ext is not gif, error the ext will never be both jpg and gif at the same time, so you're looking for the condition: if ((substr($imgName, -4) != ".jpg") && (substr($imgName, -4) != ".gif")) { //error } else { //do image processing thing. } also note, some progs. save jpegs as .jpeg
or, a bit more concisely, you could use a regexp... to allow only jpg/gif/png file formats, setup the regexp to match on those three formats, and yell at people who submit anything other than those three.... $imgName = "one.jpg"; if (! preg_match('/\.(jpg|gif|png)$/', $imgName) ) { print "file format is not supported!"; } > -----Original Message----- > From: John Vanderbeck [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 08:27 > To: Alvin Tan; Php-General > Subject: Re: [PHP] checking image extensions > > > > Hi, Newbie question here. I'm trying to write a function to check an image > > extension, part of the code is: > > > > if (substr($imgName, -4) != ".jpg") > > if ((substr($imgName, -4) != ".jpg") || (substr($imgName, -4) != ".gif")) > { > echo "<P CLASS=Error>I'm sorry, but the ikmage format you submitted is not > a supported format.</P>"; > } > > - John Vanderbeck > - Admin, GameDesign > > > > -- > 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] >
I need to pass a array through a url. Currently I'm assigning the array to the url like so http://localhost/dir/page.php?checkbox_array=$checkbox_array but when I want to sort through the array on the recieved page it is not possible because the array seems to have been replaced with the string value of "Array". The array I wish to can be of any size / dimensions. Also by passing a fenominal amont of variables throught the array I am starting to wonder what the limits are of this method an how likly is it that a browser will becoming the limiting factor in this. Becasue I have only a limited amont of time to test this site I'm only testing on Netscape and IE 4+ and they seem fine but I'd hate to find out later that thjis was a poor method for this reason. All any help with this is apreciated in anticipation. Reagrds Jamie
I need to pass a array through a url. Currently I'm assigning the array to the url like so http://localhost/dir/page.php?checkbox_array=$checkbox_array but when I want to sort through the array on the recieved page it is not possible because the array seems to have been replaced with the string value of "Array". The array I wish to can be of any size / dimensions. Also by passing a fenominal amont of variables throught the array I am starting to wonder what the limits are of this method an how likly is it that a browser will becoming the limiting factor in this. Becasue I have only a limited amont of time to test this site I'm only testing on Netscape and IE 4+ and they seem fine but I'd hate to find out later that thjis was a poor method for this reason. All any help with this is apreciated in anticipation. Reagrds Jamie
well, if the only characters that you want to allow are alphanum/space/underscore, you could use a perl regexp to match against anything *other* than those things...(a positive match would indicate that the string being matched had invalid characters in it) use this: preg_match('/[^\w\s]/', $input); (to see an explanation of why this works, please read the bottom of my email... i give a short breakdown of it) if you want to allow any more characters, simply place the character you want to allow within the brackets, and any instance of that character in the string to be matched will be ignored (rather than matched) for example, to allow periods and question marks in your input (without getting a positive match on the regexp), modify it to look like this: '/[^\w\s\.\?]/' what will match and what will not match using this regexp: print preg_match('/[^\w\s]/', $t); $t = "ea!ti_t99"; will print "1" since the "!" will match the regexp $t = "Hello one_two" will print "0" since nothing matches $t = "How *are* you" will print "1" since the "*" matches the regexp works like this: [ ] = character class ^ = not \w = alphanumeric \s = space the character class brackets are just to let the regexp know that the things inside of it are to be matched one by one against the string. "[suv]" would not match the entire string "suv", but rather "s" or "u" or "v", so "[\w\s]" would match any string that had an alphanumeric character or whitespace in it. since you want to find strings that have NOT-alphanum or NOT-space, you simply negate the character class that will match alphanum and space, by adding a "^" to it... making it "[^\w\s]" (match anything that is NOT an alphanumeric or space character - meaning match any string that has invalid characters). if you want to allow other characters into your input, just add them into the character class. if you find that you need to allow "?" into your input, use this "[^\w\s\?]"... and it will match any string that does NOT have alphanum/space/?, meaning that it will match any string with invalid chars..... > -----Original Message----- > From: James, Yz [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 12:15 > To: [EMAIL PROTECTED] > Subject: [PHP] Simple REGEX? > > > Hi guys, > > I'd like to restrict the characters a client is inputting to a database. > > I already have a system that'll exclude certain characters. Alpha Numerics > are permitted, together with the underscore and spaces. Is there a > collective expression for the following characters? : > > !",.?@() > > Because I'd like to allow those too. And I'm useless with RegEx. > > Thanks as always, > 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] >
any good .conf files? ...mine reads like a stephen king novel :) it's easy... if you go to php.net and read thru their installation documentation, there are about 4-5 lines total that you need to add to your httpd.conf (at least when you install php as a stanalone cgi) to get apache to properly handle php content... took me about 5 minutes to add the lines, restart apache, and get my first "Hello world" php script to greet me :) im using win2k myself, so if you have any severe trouble, i could possibly help you out... > -----Original Message----- > From: Sitkei es Tarsa Bt [mailto:[EMAIL PROTECTED]] > Subject: [PHP] Apache config > > > Hi, > I would like to use Apache and PHP4 on W2K. > If you have any good Httpd.conf file for the > Apache, please send me. > Thank you. > Paul. [mailto:[EMAIL PROTECTED]]
it's not very elegant, but i havent come across any PHP core function that will do what you asked, so here's a little loop that will return the total length of a multidimensional array $total = 0; for ($i=0; $i < count($myarray); $i++) { $total += count( $myarray[$i] ); } print $total; in your case, it will (should) print "8" > -----Original Message----- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 09:52 > To: bill > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Count of multi-dimensional array > > > count($myarray) will give you 3 > > On Sat, 17 Feb 2001, bill wrote: > > > How can i get the count of a multi-dimensional array? > > > > if I have > > > > $myarray[0][chicken] > > $myarray[0][fish] > > $myarray[0][meat] > > $myarray[1][fries] > > $myarray[1][chips] > > $myarray[2][coke] > > $myarray[2][pepsi] > > $myarray[2][rootbeer] > > > > How can I get the number of first elements (which would be 3 above)? > > > > thanks, > > > > bill > >
hmmm... what i would do is set a cookie named "cookies_enabled" in the very beginning of your site, and check for the presense of that variable in places that you need cookie functionality... logically, if $cookies_enabled isnt set, it means that the cookie doesnt exist (and thus cookie support for the browser is lacking or dismal) > -----Original Message----- > From: John Vanderbeck [mailto:[EMAIL PROTECTED]] > Subject: Re: [PHP] Determingin if cookies are useable? > > Well, since cookies are set in the header, I would say you would have to at > least refresh the same page. I'm just putting a cookie into my home page > for now. and it will be checked in just afew areas of the site that REQUIRE > the cookies to work right. > > - John Vanderbeck > - Admin, GameDesign
well, CSS support in netscape 4 is abyssmal to begin with, and it's a 5 year old browser, so i would venture to guess that's why you cant get anything to look the way it should... i never thought i'd see the day when MSIE was more standards compliant and more stable than netscape... (well, at least until netscape 6 is finalized and non-beta code :) > -----Original Message----- > From: Christian Reiniger [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 06:09 > To: PHP List > Subject: Re: [PHP] Stylesheets > > > On Saturday 17 February 2001 10:26, Michael Hall wrote: > > I'm building a PHP application which uses stylesheets. Stylesheets seem > > to be broken in a big way on my system - using Netscape 4 something on > > Red Hat 6.1. > > Is this Netscape or somehow something to do with PHP? Things work as > > Do you have javascript turned of? Netscape4 only interprets CSS if > javascript is enabled. > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > Drink wet cement. Get stoned.
Martin, you can either use the file 'php://stdout', which will open stadard output independant of platform, or access /dev/stdout, which is a symlink to the stdout stream of your process. Also, any output that is printed from PHP will be printed to stdout. Cheers, Ben Martin Thoma wrote: > > Hello ! > > Which is the name for the standard-output on Linux ? > > The background: I want to use PGP (2.6.3.) to put the encrypted file out > on standard-output. > > Regards > > Martin > > -- > 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]
Hi Christian, >> function change_sess(&$html_code){ >> if(eregi("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}",$html_code)){ >> >> str_replace("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}","<?=append_url() >>;?>", $html_code); >str_replace doesn't know about regular expressions, so it tries to find >the literal string "&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}" in your URL >- which it doesn't find. >Use eregi_replace instead Hmmmm, ok but with the eregi_replace the prob is the same ... :( no changes are made on my cache file ... Ideas or suggestion are very welcomed .. :) many thanks in advance max
did you check the value *before* writing it to a file? before trying to solve any problem, you have to know where to look.... perhaps the problem lies with the file instead of the regexp. the following code worked great for me: <?php $html='<a href="link.htm?something=value&flag=982420537&PHPSESSID=2c86b460d360b13c3ef08b8a46b9c afc">Lnk</a>'; $html = preg_replace('/&flag=(\d{9})&PHPSESSID=(\w{32})/', append_url(), $html ); print $html; save_url($html); die("Done"); function append_url() { return "&new_url=this"; } function save_url($html) { if ( !($f = fopen('test.txt', 'w')) ) { die("Cannot write file"); } else { fwrite($f, $html); fclose($f); } return 1; } ?> > -----Original Message----- > From: n e t b r a i n [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 12:49 > To: [EMAIL PROTECTED] > Subject: [PHP] REGEX prob > > > Hi all, > > I'm trying to match a particular piece of string in a big string using a > regex in order to change it whith another value ... I mean: > > eg: > > $html="<a > href=link.htm?&flag=982420537&PHPSESSID=2c86b460d360b13c3ef08b8a46b9cafc>Lnk > </a>"; > > function change_sess(&$html_code){ > if(eregi("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}",$html_code)){ > > str_replace("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}","<?=append_url();?>", > $html_code); > } > } > > change_sess($html); > ... > $fp=fopen($my_file,"w"); > fwrite($fp,$html); > ... > > But open the $my_file, the changes are not applied ... (I mean: there's > always the original string --> > &flag=982420537&PHPSESSID=2c86b460d360b13c3ef08b8a46b9cafc) > > Anyone could help me, please? > > many thanks in advance > max > > > -- > 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] >
On Sunday 18 February 2001 19:54, n e t b r a i n wrote: > >> function change_sess(&$html_code){ > >> if(eregi("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}",$html_code)){ > >> > >> str_replace("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}","<?=append_ur > >>l() ;?>", $html_code); > > > >str_replace doesn't know about regular expressions, so it tries to > > find the literal string "&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}" in > > your URL - which it doesn't find. > >Use eregi_replace instead > > Hmmmm, ok but with the eregi_replace the prob is the same ... :( no > changes are made on my cache file ... Ah, yes. str_replace and eregi_replace don't modify the string - they return a modified string. That means you have to do a $html_code = eregi_replace (..., $html_code); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) AAAAA - American Association Against Acronym Abuse
Hi Christian, >$html_code = eregi_replace (..., $html_code); arghhh ... I'm so stupid !! Yes, u're right ... really, many thanks max
there's a much easier way to get rid of whitespace and linebreaks at the end of a variable than using a looped ereg_replace (as i previously suggested) 1) use trim() 2) use preg_replace('/\s*$/', '', $input) both will cremate spaces and linebreaks
On Saturday 17 February 2001 10:20, Jeff Oien wrote: >So if I want to delete >a record by title, I'll end up deleting all songs with >that title. just for the discussion, you can use a delete query like "delete from song_list where song_title='title' and song_book='book'" to delete only one record, assuming that song names are unique per book. however, with scalability and performance taken into consideration, an index with a unique id makes a lot of sense. note that you can have only one autoindex field per table as of mysql 3.22.* cheers, hrishi
Hello, Does anyone know where I might find a good PHP script for analyzing apache logs, with as much information as can be gathered? I looked around on a few of the script sites, but didn't see any and I thought this wierd. - John Vanderbeck - Admin, GameDesign
Thanks to all the replies to my previous email on arrays (passing arrays through URLs) but I cannot seem to get serialize() to work correctly so I'm now trying to echo out the array as a series of hidden elements in a form that when submitted will re-build the array. I've been driving myself mad with this problem for some time now an I hope that someone can help me with this. I'm trying to insert into a table called options an option_type (eg shape), an option_value (eg square) and product_code (a six digit code). I want this table to be filled from a web form with check boxes (which are called from the same table with a code of XXX so that I know they are possible options for any product). I can do this and have got the code below generated <tr><td colspan='3'><i><b>Colour</b></i></td></tr> <td><input type="checkbox" name="form_options[Colour][]" value="Red">Red</td> <td><input type="checkbox" name="form_options[Colour][]" value="Violet">Violet</td> <td><input type="checkbox" name="form_options[Colour][]" value="Green">Green</td> </tr> <tr> <td><input type="checkbox" name="form_options[Colour][]" value="Blue">Blue</td> </tr> <tr><td colspan='3'><i><b>Size</b></i></td></tr> <td><input type="checkbox" name="form_options[Size][]" value="A3">A3</td> <td><input type="checkbox" name="form_options[Size][]" value="A4">A4</td> <td><input type="checkbox" name="form_options[Size][]" value="A5">A5</td> </tr> >From the options table that looks like this: type - value - code colour - red - XXX colour - blue - XXX colour - violet - XXX colour - geen - XXX size - A3 - XXX size - A4 - XXX size - A5 - XXX I think this html form code is right so that when the form is submitted the an array $form_options will be generated now here is my problem: I don't know how to output the array to a html <input type=hidden> fields so that I can safly pass the array form page to page or so that I can then do inserts into the database here is as close as I have gotten : foreach ($form_options as $arrayType){ $i++; $type = ($arrayType[$i]); foreach ($arrayType as $value){ echo("Option :". $type ." Value :". $value . "<br>"); } but this code only produces : Option :Red Value :Red Option :Red Value :Violet Option :Red Value :Green Option :Red Value :Blue Option :A4 Value :A3 Option :A4 Value :A4 Option :A4 Value :A5 I can't seem to find the 'Type' value that should be in the array. Can anyone help me with this code as I DESPERATLY need it. Thanks again Jamie PS sorry for the long winded explaination but I hope I was clear enough in what my aims are.
I'd like to achieve something like this: I've made a form let say "a.php" and when user submitted it, the following code display the thank you page: // Form completed echo "Thank you! Information entered."; echo "Please click <a href='http://mysite/a.php'>here</a> to input another product."; echo "Or click <a href='http://mysite/b.php'>here</a> to input the details of your product."; I've made a blank (uncoded) page of "b.php" and one of the field is product name. If i want the "b.php" page being opened up with the product name already filled with the value entered by user in "a.php", what should i do to achieve it? Please help!! Thanks Edith Lai
hi everyone, ok i just DLed apache httpd server and put all the files in the httpd folder and made the chages is the httpd.conf file for php to work, but it just shows as text or trys to make me downlaod the site. Whats going on? What can i do so it will recongnize php?
These tutorials were very helpful for me: http://www.thickbook.com/extra/index.phtml?t=in Jeff Oien > hi everyone, ok i just DLed apache httpd server and put all the files in > the httpd folder and made the chages is the httpd.conf file for php to > work, but it just shows as text or trys to make me downlaod the site. > Whats going on? What can i do so it will recongnize php?
When I write to a file with PHP, I get double line spacing when read on a PC. Is there a way to handle this so that a text file can be created by PHP and be read correctly by Linux or a WIN based computer? In my PHP code, I have been using \r\n to duplicate the 0Dh 0Ah that a WIN based computer needs. Todd -- Todd Cary Ariste Software [EMAIL PROTECTED]
Just use \n. Both OS's understand this to be a linefeed and will behave accordingly. With the exception of a class that performs POP3 queries, I've never had to use \r\n in my code. Regards, Toby Butzon Todd Cary wrote: > > When I write to a file with PHP, I get double line spacing when read on > a PC. Is there a way to handle this so that a text file can be created > by PHP and be read correctly by Linux or a WIN based computer? > > In my PHP code, I have been using \r\n to duplicate the 0Dh 0Ah that a > WIN based computer needs. > > Todd > > -- > Todd Cary > Ariste Software > [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]
http://www.intershipper.net I think they even have PHP code for using their system... Cheers... O- ~ARK CFO, Hmedicine.com, Inc. http://www.hmedicine.com Do I listen to pop music because I'm miserable? Or am I miserable because I listen to pop music?... ~Rob from "High Fidelity" > -----Original Message----- > From: Isaac Force [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 10:49 PM > > I'm looking for a better way to calculate UPS shipping costs than > opening a connection to the UPS website every time a user wants > to calculate their shipping (Which is what I'm finding). > > Anybody care to point me in the direction of where I can > information on how to do this?
hi, (sorry for cross-posting) i'm currently investigating some reported problems with the PHP 4 OCI8 interface. some people have reported SEGFAULTs and "failed to rollback outstanding transactions" messages in their apache error_log. sadly i cannot reproduce any of those problems on my machine. i would be very happy to hear of anybody who managed to crash PHP4+OCI8 and who could send me a _SHORT_ testscript that allows me to reproduce (and fix) this problem! regards, tc
Hello Dave, On 17-Feb-01 01:52:57, you wrote: >I haven't seen this issue discussed, sorry if I missed it: >My question is why are the PHP database functions so unportable? Is there a >reason why they have to be specific to, say MySQL. It seems to me (even Different databases provide different features through different API. >though I am an amatuer to this stuff) that the code should be much more >easily portable from one db to another? >Do most coders add an abstraction layer themselves? Or maybe people just >don't port PHP code much and so don't worry about it? Yes, most people don't care much about writing database independent code, because they assume they will never need to switch from their current database of choice. This is often not the case. Many developers that started with lower end database like MySQL and PostgreSQL often realize that they need their databases to scale up to a point that you will need an high end database to handle. Other developers find themselves in the opposite migration way. They develop products that rely on specific high end databases but then they realize that there is a much wider audience of low end database users that could be interested in their products if they could work with those databases. This uncertainty of the future needs lead me to start developing Metabase two years ago. Metabase is a PHP database abstraction package that you may rely to write database independent applications. It features not only database independent access but also database independent schema installation. Metabase is free and you may want to look at it here: http://phpclasses.UpperDesign.com/browse.html/package/20 Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
Hi, is there a quick way to create an array of integers, randomized and without repeats? e.g. if my set is 1 - 10, create an array whoese key values are 1 through 10, with corresponding key values as a random set of the same 1 through 10?? thanks in advance for any suggestions :) andrew
>>>>> "a" == andrew <[EMAIL PROTECTED]> writes: > Hi, is there a quick way to create an array of integers, randomized > and without repeats? > e.g. if my set is 1 - 10, create an array whoese key values are 1 > through 10, with corresponding key values as a random set of the > same 1 through 10?? > thanks in advance for any suggestions :) andrew Yeah, this will give you an array of the numbers 1 - 10 in random order. If you want a different range, change the parameters to suit. <?php function rand_array( $start, $finish ) { srand ( (double) microtime() * 1000000); $rand_array = range( $start, $finish ); // it really irritates me the way PHP's sort functions mess around // with the original array rather than returning a sorted array so // I can assign it to where I want it. shuffle( $rand_array ); return $rand_array; } print_r( rand_array(1, 10) ); ?> -- Robin Vickery................................................. BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
This worked: SELECT * from that_table ORDER BY thetimestamp DESC LIMIT 1 Thanks to all for the help. Brian Drexler ----- Original Message ----- From: Christian Reiniger <[EMAIL PROTECTED]> To: Php-General <[EMAIL PROTECTED]> Sent: Saturday, February 17, 2001 8:58 AM Subject: Re: [PHP] Can I select only the newest record? > On Saturday 17 February 2001 12:12, PHPBeginner.com wrote: > > I wonder, if LAST_INSERT_ID will work in here... > > > > I know it works when on the same file was an insertion.. but will it > > return you the last ever inserted id, say a week ago? > > It will you return the id that was used on the last INSERT that *this* > process (i.e. this script while being executed right now) did. > > => it won't help. > > > > MySQL table. I have a datetime field and an Auto_incremented field. > > If you want the "newest" field, add a timestamp field and do a > SELECT * from that_table ORDER BY thetimestamp DESC LIMIT 1 > > a timestamp field in MySQL is by default automatically set to NOW() at > each INSERT and UPDATE if you don't set it yourself in the query. > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > Drink wet cement. Get stoned. > > -- > 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]
You're welcome! Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Brian Drexler [mailto:[EMAIL PROTECTED]] Sent: Monday, February 19, 2001 1:57 AM To: [EMAIL PROTECTED]; Php-General Subject: Re: [PHP] Can I select only the newest record? This worked: SELECT * from that_table ORDER BY thetimestamp DESC LIMIT 1 Thanks to all for the help. Brian Drexler ----- Original Message ----- From: Christian Reiniger <[EMAIL PROTECTED]> To: Php-General <[EMAIL PROTECTED]> Sent: Saturday, February 17, 2001 8:58 AM Subject: Re: [PHP] Can I select only the newest record? > On Saturday 17 February 2001 12:12, PHPBeginner.com wrote: > > I wonder, if LAST_INSERT_ID will work in here... > > > > I know it works when on the same file was an insertion.. but will it > > return you the last ever inserted id, say a week ago? > > It will you return the id that was used on the last INSERT that *this* > process (i.e. this script while being executed right now) did. > > => it won't help. > > > > MySQL table. I have a datetime field and an Auto_incremented field. > > If you want the "newest" field, add a timestamp field and do a > SELECT * from that_table ORDER BY thetimestamp DESC LIMIT 1 > > a timestamp field in MySQL is by default automatically set to NOW() at > each INSERT and UPDATE if you don't set it yourself in the query. > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > Drink wet cement. Get stoned. > > -- > 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]
Geetings and Salutations- I am experiencing a similar problem, but only on two similarly configured FreeBSD 4.0-Stable servers. Here are the details... We are running php-4.0.1p12, and it is built with -imap=/usr/local specified in the log files. In /var/log/messages, we have the following type messages: [Sun Feb 18 05:48:19 2001] [notice] child pid 258 exit signal Floating point exception(8) I am clueless on how to approach this issue, and could use a little help. Please respond to the list, and cc: me at [EMAIL PROTECTED], as I am not subscribed to the list. Thanks, Charles Peters __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
Upgrade to the latest tarball from snaps.php.net On Sun, 18 Feb 2001, Charles Peters wrote: > Geetings and Salutations- > > I am experiencing a similar problem, but only on two > similarly configured FreeBSD 4.0-Stable servers. Here > are the details... > > We are running php-4.0.1p12, and it is built with > -imap=/usr/local specified in the log files. > > In /var/log/messages, we have the following type > messages: > > [Sun Feb 18 05:48:19 2001] [notice] child pid 258 exit > signal Floating point exception(8) > > I am clueless on how to approach this issue, and could > use a little help. > > Please respond to the list, and cc: me at > [EMAIL PROTECTED], as I am not subscribed to the > list. > > Thanks, > > Charles Peters > > > > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.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] >
Thanks Rasmus, I appreciate your quick response. I would imagine that there was a know issue involving this bug and the version of php that I was using? Charles --- Rasmus Lerdorf <[EMAIL PROTECTED]> wrote: > Upgrade to the latest tarball from snaps.php.net > > On Sun, 18 Feb 2001, Charles Peters wrote: > > > Geetings and Salutations- > > > > I am experiencing a similar problem, but only on > two > > similarly configured FreeBSD 4.0-Stable servers. > Here > > are the details... > > > > We are running php-4.0.1p12, and it is built with > > -imap=/usr/local specified in the log files. > > > > In /var/log/messages, we have the following type > > messages: > > > > [Sun Feb 18 05:48:19 2001] [notice] child pid 258 > exit > > signal Floating point exception(8) > > > > I am clueless on how to approach this issue, and > could > > use a little help. > > > > Please respond to the list, and cc: me at > > [EMAIL PROTECTED], as I am not subscribed to > the > > list. > > > > Thanks, > > > > Charles Peters > > > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Get personalized email addresses from Yahoo! Mail > - only $35 > > a year! http://personal.mail.yahoo.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] > > > __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
Yes On Sun, 18 Feb 2001, Charles Peters wrote: > Thanks Rasmus, > > I appreciate your quick response. > > I would imagine that there was a know issue involving > this bug and the version of php that I was using? > > Charles > > > --- Rasmus Lerdorf <[EMAIL PROTECTED]> wrote: > > Upgrade to the latest tarball from snaps.php.net > > > > On Sun, 18 Feb 2001, Charles Peters wrote: > > > > > Geetings and Salutations- > > > > > > I am experiencing a similar problem, but only on > > two > > > similarly configured FreeBSD 4.0-Stable servers. > > Here > > > are the details... > > > > > > We are running php-4.0.1p12, and it is built with > > > -imap=/usr/local specified in the log files. > > > > > > In /var/log/messages, we have the following type > > > messages: > > > > > > [Sun Feb 18 05:48:19 2001] [notice] child pid 258 > > exit > > > signal Floating point exception(8) > > > > > > I am clueless on how to approach this issue, and > > could > > > use a little help. > > > > > > Please respond to the list, and cc: me at > > > [EMAIL PROTECTED], as I am not subscribed to > > the > > > list. > > > > > > Thanks, > > > > > > Charles Peters > > > > > > > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Get personalized email addresses from Yahoo! Mail > > - only $35 > > > a year! http://personal.mail.yahoo.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] > > > > > > > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/ >
You could use frames, then you wouldn't have to refresh ALL of the page.... ----- Original Message ----- From: Siim Einfeldt aka Itpunk <[EMAIL PROTECTED]> To: Brian V Bonini <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, February 17, 2001 10:07 AM Subject: RE: [PHP] Re: Creative solution with XML,PHP,MYSQL > > > Maybe Flash is an option? > > Well, I know I could probably do it some way in flash (if I had > experiences with it), but this is just a bit out 'of the box'. But still, > thanks for offering. > > Siim > > > -- > 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]
Greetings and Salutations Yall- I am investigating the possible purchase of Code Charge (info at http://www.php.org). Has anyone here used the product, and do you have opinions about it. Any comments would be appreciated. Thanks, Charles __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
Hi I guess I was sleeping when this had happened but I still have to ask : 1. When were all of the php functions that hade a "_" in them renamed to have a "-" instead? For example "aspell-suggest" instead of "aspell_suggest". 2. When were these functions removed : ada-commit,ada-connect,ada-exec,ada-fieldname,ada-fieldnum,ada-fieldtype,ada -freeresult,ada-numfields ada-numrows,ada-result,ada-resultall,ada-rollback,ada-afetch,ada-autocommit, ada-close,ada-fetchrow is-writeable,dir,set-socket-blocking,hw-Changeobject,hw-DocumentAttributes,h w-DocumentBodyTag hw-DocumentSize,hw-OutputDocument,hw-Username,ifx-free-slob Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow.
Or maybe this is just the file name on the php.net site that got me confused? The listing is for _ but the file name is with an - -----Original Message----- From: Boaz Yahav [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 18, 2001 7:31 PM To: PHP General (E-mail) Subject: [PHP] PHP functions Hi I guess I was sleeping when this had happened but I still have to ask : 1. When were all of the php functions that hade a "_" in them renamed to have a "-" instead? For example "aspell-suggest" instead of "aspell_suggest". 2. When were these functions removed : ada-commit,ada-connect,ada-exec,ada-fieldname,ada-fieldnum,ada-fieldtype,ada -freeresult,ada-numfields ada-numrows,ada-result,ada-resultall,ada-rollback,ada-afetch,ada-autocommit, ada-close,ada-fetchrow is-writeable,dir,set-socket-blocking,hw-Changeobject,hw-DocumentAttributes,h w-DocumentBodyTag hw-DocumentSize,hw-OutputDocument,hw-Username,ifx-free-slob Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -- 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]
Boaz Yahav wrote: > > Or maybe this is just the file name on the php.net site that > got me confused? The reason is, that the filenames are derived from refentry id's and ther an underscore isn't allowed. > The listing is for _ but the file name is with an - Correct. -Egon > -----Original Message----- > From: Boaz Yahav [mailto:[EMAIL PROTECTED]] > Sent: Sunday, February 18, 2001 7:31 PM > To: PHP General (E-mail) > Subject: [PHP] PHP functions > > Hi > > I guess I was sleeping when this had happened but I still have to ask : > > 1. When were all of the php functions that hade a "_" in them renamed to > have a "-" instead? > For example "aspell-suggest" instead of "aspell_suggest". > > 2. When were these functions removed : > > > ada-commit,ada-connect,ada-exec,ada-fieldname,ada-fieldnum,ada-fieldtype,ada > -freeresult,ada-numfields > > ada-numrows,ada-result,ada-resultall,ada-rollback,ada-afetch,ada-autocommit, > ada-close,ada-fetchrow > > is-writeable,dir,set-socket-blocking,hw-Changeobject,hw-DocumentAttributes,h > w-DocumentBodyTag > hw-DocumentSize,hw-OutputDocument,hw-Username,ifx-free-slob > > Sincerely > > berber > > Visit http://www.weberdev.com Today!!! > To see where PHP might take you tomorrow. > > > -- > 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] -- SIX Offene Systeme GmbH · Stuttgart - Berlin Sielminger Straße 63 · D-70771 Leinfelden-Echterdingen Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4
I've been using a PHP upload script to upload files to our server, but my problem is this. I can't upload anything but JPG, GIF, and HTML files. Anyone have any idea why? This is probably something simple that I'm just overlooking, but please help. Brian Drexler
The script you are using is probably checking the MIME type of the file uploaded and rejecting any of the ones that are not one of the types you listed. Look at or post some of the code you are using to find out if this is the case. Michael Brian Drexler wrote: > I've been using a PHP upload script to upload files to our server, but my > problem is this. I can't upload anything but JPG, GIF, and HTML files. > Anyone have any idea why? This is probably something simple that I'm just > overlooking, but please help. > > Brian Drexler > >
<? exec( "mv $image '$Destination/$FileName'"); ?> ----- Original Message ----- From: Michael Stearne <[EMAIL PROTECTED]> To: Brian Drexler <[EMAIL PROTECTED]> Cc: Php-General <[EMAIL PROTECTED]> Sent: Sunday, February 18, 2001 1:55 PM Subject: Re: [PHP] Uploading Files via PHP > The script you are using is probably checking the MIME type of the file > uploaded and rejecting any of the ones that are not one of the types you > listed. Look at or post some of the code you are using to find out if > this is the case. > > Michael > > > Brian Drexler wrote: > > > I've been using a PHP upload script to upload files to our server, but my > > problem is this. I can't upload anything but JPG, GIF, and HTML files. > > Anyone have any idea why? This is probably something simple that I'm just > > overlooking, but please help. > > > > Brian Drexler > > > > > > > > -- > 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]
Hmm. I don't know one thing you could try is putting $image in quotes, like '$image'. Also you might try to use the code I have pasted below. Using exec is probably not the most effecient way to do the copy of the file (and using mv limits you to *nix). Make sure you remove the checks for image type files that I make in the checkImgType() function. HTH, Michael if($Image!="none"){ $ImageExt=checkImgType($Image_type,$Image_name); } if($Image!="none"){ $ImageFinal=$ABS_PRODUCTS_IMAGES_DIR.$LastInsertID."Image".$ImageExt; copy($Image, $ImageFinal); } function checkImgType($image_type,$image_name){ if((strcmp($image_type,"image/jpeg")==0)||(strcmp($image_type,"image/gif")==0)||(strcmp($image_type,"image/pjpeg")==0)||(strcmp($image_type,"image/jpg")==0)) { switch($image_type){ case "image/jpg": $imageExt=".jpg"; break; case "image/jpeg": $imageExt=".jpg"; break; case "image/pjpeg": $imageExt=".jpg"; break; case "image/gif": $imageExt=".gif"; break; } return $imageExt; }else { print "<b><font color=red>$image_name is not a valid file to upload.<br> Please upload JPEG (.jpg) or GIF (.gif) type images only.</font></b><br> <br>"; return 0; } } Brian Drexler wrote: > <? > exec( "mv $image '$Destination/$FileName'"); > ?> > > ----- Original Message ----- > From: Michael Stearne <[EMAIL PROTECTED]> > To: Brian Drexler <[EMAIL PROTECTED]> > Cc: Php-General <[EMAIL PROTECTED]> > Sent: Sunday, February 18, 2001 1:55 PM > Subject: Re: [PHP] Uploading Files via PHP > > >> The script you are using is probably checking the MIME type of the file >> uploaded and rejecting any of the ones that are not one of the types you >> listed. Look at or post some of the code you are using to find out if >> this is the case. >> >> Michael >> >> >> Brian Drexler wrote: >> >>> I've been using a PHP upload script to upload files to our server, but >> > my > >>> problem is this. I can't upload anything but JPG, GIF, and HTML files. >>> Anyone have any idea why? This is probably something simple that I'm >> > just > >>> overlooking, but please help. >>> >>> Brian Drexler >>> >>> >> >> >> -- >> 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] >
Some questions about how to get a whole bunch of fields in a form as input to another page, i.e. *.cgi, or*.phpx: 1/ All fields, buttons, etc have to have different names? 2/ Using 'selected' on pulldowns automatically returns that value unless selected? 3/ The WHOLE PAGE is included in one form? -OR- Multiple forms are used on one page, and submit button returns All forms? -- ________________________________________________________________ Sites by friends of mine: http://www.myhiddentreasures.com/ ________________________________________________________________ ---------W-A-R-N-I-N-G -personal-propaganda-signature---------- ---------->>TAKE WHAT YOU LIKE AND LEAVE THE REST<<------------ >>>>SINCE OUR GOVERNMENT WON'T PRESERVE OUR CLIMATE, IT'S UP TO US! Imagine ** yourself ** and your kids now an endangered species <1>Inflate automobile tires to near maximum in summer, -2psi in winter <2>add insulation to house and hot water heater, and refrigerator, <3>combine trips in cars, make less of them <4>buy cars, sports vehicles and recreational vehicles with good if not best mileage <4>put awnings over windows is summer, remove in winter. <5> add solar hot water heating. <6>Push for energy recycling clothes dryers <7> walk more, play outside with your kids! <8> let your grass grow to 3-4 inches, chokes weeds, saves water and energy, keeps house cooler <9> Put WHITE or REFLECTIVE materials on roofs to send energy back into space. <10> Vote for burial of logging slash onsite in logging areas for better watersheds and less burned vegetation. <11> compost your leaves and grass, bury in flower beds, lawns, gardens, or give away. <12> VOTE for energy and CO2 ratings on ALL products and foods. KNOW how much damage your purchases do to the climate. <13> Give your kids less stuff and more of you. <14> recycle everything you can <15> limit your children to an average 1 per adult between all your marriages. (Only REPLACE yourself, not expand the population)
Mike Yuen wrote: > I'm got another person working for me on a site. He's a Mac user and for > some reason, he can't seem to register as a new person. I know this > problem isn't due to the large amount of traffic b/c it's a new site with > 3 users max at any time. > > I haven't found any similar problems in any knowledge base and i'm > thinking it has something to do with my cable modem connection and the > fact that: > 1. I'm in Seattle and he's in Cleveland (distance issue) - less likely. That's not really possible. The only way this could happen is that if you have certain IPs blocked. > > 2. ON the more likely side, all the crap that is running on my computer > (ie: firewalls, IDS, telnet, applications). This all depends on the type of authentication you are using to allows users access to the site. It's probably not a firewall problem becuase if any user can see the sight at all, all should be able to. But all the other crap you have running on your computer shouldn't matter as long as you or one other user can register. The problem is probably somewhere in your script. Are you checking for browser types? Are you and the other Win user using IE and the Mac user using NS. Is the web server IIS or Apache? Are you using PHP for checking the users or Apache or IIS? If you could post some code, it would probably help. Michael
Another thing to look for is JavaScript. There have been several sites I have visited (I am also a big Mac user), that use a lot of JavaScript that will break on IE 5 for the Mac. -- Jesse Swensen [EMAIL PROTECTED] > From: Michael Stearne <[EMAIL PROTECTED]> > Date: Sun, 18 Feb 2001 13:45:21 -0500 > To: Mike Yuen <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Macs and PHP > > Mike Yuen wrote: > >> I'm got another person working for me on a site. He's a Mac user and for >> some reason, he can't seem to register as a new person. I know this >> problem isn't due to the large amount of traffic b/c it's a new site with >> 3 users max at any time. >> >> I haven't found any similar problems in any knowledge base and i'm >> thinking it has something to do with my cable modem connection and the >> fact that: >> 1. I'm in Seattle and he's in Cleveland (distance issue) - less likely. > > That's not really possible. The only way this could happen is that if > you have certain IPs blocked. > >> >> 2. ON the more likely side, all the crap that is running on my computer >> (ie: firewalls, IDS, telnet, applications). > > This all depends on the type of authentication you are using to allows > users access to the site. It's probably not a firewall problem becuase > if any user can see the sight at all, all should be able to. But all > the other crap you have running on your computer shouldn't matter as > long as you or one other user can register. The problem is probably > somewhere in your script. > > Are you checking for browser types? Are you and the other Win user > using IE and the Mac user using NS. Is the web server IIS or Apache? > Are you using PHP for checking the users or Apache or IIS? > > If you could post some code, it would probably help. > > Michael > > > > > -- > 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] > >
As I mentioned in an earlier email. Mac users can't register for the test site i'm building and I have no idea why this is. Here's some information that may help diagnose this problem: - The site is running on Apache1.3.14 on a Windows O/S. - I'm not checking for browser type - All authentication is done through a MySQL database. - The actual signup page is an html page and sent to a PHP page that accepts/denies the information submitted. Here's the actual coding for the newmemberacceptance.php page (the page that accepts or rejects a new user). Thanks, Mike <?PHP //destroy existing session if it exists if(session_is_registered("CUserName")) { session_destroy(); } include ("dblib.inc"); session_start(); ?> <HTML> <HEAD> <TITLE>Member registration</TITLE> </HEAD> <BODY> <?PHP //registers session variables for later use session_register ("CUserName"); session_register ("CFirstName"); session_register ("CLastName"); //saves session variables for later use $CUserNameSession="CUserName"; $CFirstNameSession="CFirstName"; $CLastNameSession="CLastName"; print "Thank you for your interests in LDSCalgary.com $CFirstName $CLastName<BR><BR>"; /************************************************************************************* This is function tests for matching passwords *************************************************************************************/ if (empty($CUserName)) { print "UserName is empty<BR>"; exit(); } if(empty($CPassword)) { print "You must choose a password<BR>"; exit(); } if($CPassword == $CPassword2) { print ""; } else { print "Passwords do not match.<BR>Please press on the back button and re-enter your passwords so they match.<BR>"; session_destroy(); exit(); } /************************************************************************************* This is function tests for user information *************************************************************************************/ if (isset($CUserName) && isset($CPassword) && isset($CFirstName)) { //checking for user input $dberror=""; $ret=add_to_database($CUserName,$CFirstName,$CLastName,$CCity,$CEmail,$CGender,$CCommunity,$CAge,$CHeight,$CMarital,$CKid,$CBody,$CEducation,$CChurch,$CWard,$CStake,$CTemple,$CMission,$CMissionLocation,$CUrl,$CGreeting,$CPassword,$CMailingList,$CEyeColor,$CHairColor,$Interests1,$Interests2,$Interests3,$Interests4,$Interests5,$Interests6,$Interests7,&$dberror); if(!$ret) print "Error: $dberror<BR>"; else print "Congratulations! Your profile has been added.<BR>"; } /************************************************************************************* FUNCTION: add_to_database PURPOSE: Add data to clients / interests table in Database *************************************************************************************/ function add_to_database($CUserName,$CFirstName,$CLastName,$CCity,$CEmail,$CGender,$CCommunity,$CAge,$CHeight,$CMarital,$CKid,$CBody,$CEducation,$CChurch,$CWard,$CStake,$CTemple,$CMission,$CMissionLocation,$CUrl,$CGreeting,$CPassword,$CMailingList,$CEyeColor,$CHairColor,$Interests1,$Interests2,$Interests3,$Interests4,$Interests5,$Interests6,$Interests7,&$dberror) { $result = mysql_query("SELECT CUserName FROM clients WHERE CUserName = '$CUserName'"); $count = mysql_num_rows($result); if ($count >= 1) { print "I'm sorry, the user name you selected is currently in use, please select another.<BR>Please press on the back button of your browser."; exit; } else { $query = "INSERT INTO clients (CUserName,CFirstName,CLastName,CCity,CEmail,CGender,CCommunity,CAge,CHeight,CMarital,CKids,CBody,CEducation,CChurch,CWard,CStake,CTemple,CMission,CMissionLocation,CUrl,CGreeting,CPassword,CMailingList,CEyeColor,CHairColor) VALUES ('$CUserName','$CFirstName','$CLastName','$CCity','$CEmail','$CGender','$CCommunity','$CAge','$CHeight','$CMarital','$CKid','$CBody','$CEducation','$CChurch','$CWard','$CStake','$CTemple','$CMission','$CMissionLocation','$CUrl','$CGreeting','$CPassword','$CMailingList','$CEyeColor','$CHairColor')"; //Inserts interests data from form into Interests table $query2 = "INSERT INTO interests (I1,I2,I3,I4,I5,I6,I7,CUserName) VALUES ('$Interests1','$Interests2','$Interests3','$Interests4','$Interests5','$Interests6','$Interests7','$CUserName')"; } if (!mysql_query ($query2) or !mysql_query($query)) { $dberror = mysql_error(); return false; } return true; } /****************************************************************************************** This prints out the user input on the screen ******************************************************************************************/ foreach ($HTTP_POST_VARS as $key=>$val) if (gettype($val) == "array") { print "$key:<BR>\n"; foreach ($val as $two_dim_value) print ".....$two_dim_value<BR>"; } else { print "$key: $val<BR>\n"; } print "<BR>"; ?> <B>Click <a href="memberprofile.php?<?=$PHPSESSID; ?>">here</a> to continue.</b> </body> </html>
Ok this used to work but now I've done something to break it. My info.php says that I have PHP support: pdf PDF Support enabled PDFLib Version 3.03 CJK Font Support yes In-memory PDF Creation Support yes BUT when I try and run the clock test code, I get: Fatal error: Call to undefined function: pdf_new() in /home/httpd/pwn/htdocs/test/test.php on line 6 The first 6 lines of code are: <?php $radius = 200; $margin = 20; $pagecount = 10; $pdf = PDF_new(); It seems that PHP doesn't want to recognize any fo the PDF functions. Anybody got ANY idea what's wrong? TIA, Cal http://www.calevans.com
okay, i swear, this *must* be a FAQ. :-) I looked on php.net's FAQ and php.faqts.com, but couldn't find it. How do I use slashes to delimit query string (url) paramters? i.e., I want http://foo.com/name/paul instead of http://foo.com/?name=paul Manuel Lemos does this on his php classes site: http://phpclasses.UpperDesign.com/ thanks. Paul shad 96c / 4B CS / mac activist / eda / fumbler fan of / jewel / sophie b. / sarah slean / steve poltz / emm gryner / / x-files / buffy / dawson's creek / habs / bills / 49ers / t h i n k d i f f e r e n t. "We're a couple of nice guys ... which stopped being a desirable character trait about fifty years ago." -- Dawson Leary, "Dawson's Creek"
Hi, I've compiled PHP as CGI in /usr/local/php/ . Does anyone know what I can write in httpd.conf file? Tanks
I got this from a book but given the fact that it would only search for one type of information I modified it and it works great, but I wanted to know what you think about it if anything. Could an array be maid to trim it down? if ($search_in == "1"){ $query1 = "SELECT * FROM FISH where ID LIKE '%$search_text%' OR name LIKE '%$search_text%' OR Category LIKE '%$search_text%' OR Color LIKE '%$search_text%' OR Size LIKE '%$search_text%'"; } Any feedback would be a preciated. -- Gerry Figueroa -------------- - - - - - * War does not determine who is right, war determine who is left.
I am looking for code that explains how to sum a value in a database based on a current field retrieved from the database. Example: query = "select course_name, course_build, milestone, testcase, time_tested, issue_status, comment, bug_number, tested_by, date_tested from testissues where test_issue_id = $viewid"; $result = mysql_query( $query ); 1 - retrieve needed fields from database based on the id the user links from ($viewid) 2 - assign the course_name value from the query statement to a variable to be used on html page Assign: $course_name = mysql_result( $result, 0, "course_name" ); Use variable: print " <td><font color = #006666><b>$course_name</b></font></td>\n"; Now I would like to sum ALL the time_tested values in my database WHERE the course_name = $course_name (the variable retrieved for the record) query = "select sum(time_tested) where course_name = $course_name"; $result = mysql_query( $query ); $total_time = mysql_result( $result, 0, "sum(time_tested)"); First issue -- php does not seem to recognize the value of $course_name Second issue -- will the $total_time value be calculated correctly based on the above syntax?
hi, how can i store an array in mysql ? what i do now ( works fine ) ======================== a) transform the array to a § delimeted string // $tempItem is a § dlimited string example: 4321§117§A123§42WQ§1243 b) $tempItem = serialize($tempItem); c) store it in mysql-table and i get my array back with d) $myItems = explode("§",unserialize($myValueFromDB)); but i think theres an easier way out there any solutions greetings andreas
Jeff Oien wrote: > Just a curiosity. I installed and tested Manuel Lemos's > PHP E-mail validation class. When I entered an address > at the @wi.rr.com domain, no matter what I put before > the domain, it would come back as valid. (That's the > Wisconsin domain for Road Runner cable service.) But > when I tried it for @earthlink.net only real addresses > came back as valid. Does anyone know what it is about > some mail servers at certain domains that it would return > everything as valid? > Jeff Oien > > so [EMAIL PROTECTED] would show as a valid address. > [EMAIL PROTECTED] wouldn't but [EMAIL PROTECTED] would > hi, this happens because some MTA's don't allow certain commands to be issued (security feature), qmail for instance... the class acts like it should: it tells you that the email is valid. (it's better than refusing a valid email...) regards, Nuno Silva
Checkout: http://sourceforge.net/projects/cf2php Camden
Maybe I'm not all with it, but what is CFML? ----- Original Message ----- From: Camden Spiller <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, February 18, 2001 3:52 PM Subject: RE: [PHP] Converting CFML to PHP Checkout: http://sourceforge.net/projects/cf2php Camden
Cold Fusion Markup Language. It's Cold Fusion's "programming language". Michael Brian Drexler wrote: > Maybe I'm not all with it, but what is CFML? > > > ----- Original Message ----- > From: Camden Spiller <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, February 18, 2001 3:52 PM > Subject: RE: [PHP] Converting CFML to PHP > > > Checkout: http://sourceforge.net/projects/cf2php > > Camden > > >
I use $myvar = $HTTP_GET_VARS[myvar]; This works with IIS running under Win 2K but it does not work with Apache running under Win 98. I have track_vars = On Is there something else that I have missed? I have register_globals = Off If I set it ON, the variable does get passed. Todd -- Todd Cary Ariste Software [EMAIL PROTECTED]
Hi everyone, I'm trying to run a simple PHP e-mail script on my Windows 2000 Pro machine and I keep receiving Server Error. I tried the same script on a Unix server and it worked fine. Does anyone know what the problem might be? Thanks in advance. -- ***** Peter Knif ***** [EMAIL PROTECTED]
Have you set SMTP = your.smtp.server.com ;for win32 only in you php.ini file? --dave > -----Original Message----- > From: Peter Knif [mailto:[EMAIL PROTECTED]] > Sent: Monday, 19 February 2001 8:13 AM > To: [EMAIL PROTECTED] > Subject: [PHP] SMTP on IIS 5.0 Windows 2000 Pro > > > Hi everyone, > > I'm trying to run a simple PHP e-mail script on my Windows > 2000 Pro machine > and I keep receiving Server Error. I tried the same script on > a Unix server > and it worked fine. Does anyone know what the problem might > be? Thanks in > advance. > > > -- > ***** Peter Knif ***** > > [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] >
The approach I've used is four steps: (1) read the current file into a variable (which preserves it) (2) open the 'old' file for writing "w" (which clears it also) (3) write the "new stuf" to the file first (4) lastly write the "old stuff" to the file Here's a code sample that I just tested........... $new_line="<A HREF=\"$URL\" target=\"_myclassy\"> $LABEL</A><BR>\n"; $filecontents = join ('', file('./classified.html')); $fp=fopen("./classified.html","w"); fwrite($fp,$new_line); fwrite($fp,$filecontents); fclose($fp); Hope that helps, but YMMV. CHeers, Tom Henry [EMAIL PROTECTED] (Jan Grafström) wrote in <[EMAIL PROTECTED]>: >Hi! >I have this code: >$message = ereg_replace("\r\n\r\n", "\n<P>", $message); >And the new rows are placed under the old ones. >I want to change so the old messages get placed under is that possible? >Thanks for help. >Jan > >