php-general Digest 7 Jun 2003 02:50:12 -0000 Issue 2102 Topics (messages 150496 through 150559):
Re: How easy is this idea? 150496 by: Maxim Maletsky Linux vs. Windows 150497 by: AzFLSite 150502 by: Maxim Maletsky 150504 by: John W. Holmes 150536 by: DvDmanDT 150543 by: AzFLSite 150544 by: DvDmanDT Re: ob_get_contents returns FALSE? 150498 by: Shawn McKenzie Upgraded from PHP 4.1.2 to PHP 4.3.2 150499 by: Chris Boget Re: PHP/Javascript Help 150500 by: Stephen Software Testing and Internationalization - Free book by LISA/Lemoine International 150501 by: Alex Lam 150503 by: John W. Holmes COOKIES Question? 150505 by: Joaco 150518 by: Bix Need aternate for "exit;" 150506 by: PHPSpooky 150512 by: Carl Furst imagettftext - font size randomly changes 150507 by: Doug Dossett Re: mysql backup solution 150508 by: Luis Lebron How can I check form variables in $_POST to make sure they are the right format? 150509 by: Dan Anderson 150513 by: Awlad Hussain 150514 by: Dan Anderson 150516 by: Dillon, John Re: libphp4.so 150510 by: Ryan Vennell 150526 by: Jason Wong Re: [FYI] phpbooks.com 150511 by: Bix 150523 by: Jennifer Goodie Re: Automatic Headers and Footers 150515 by: Robert Cummings Re: Trouble with fopen() || Win2k Machine 150517 by: CF High 150525 by: Jason Wong 150527 by: CF High Include Bug? 150519 by: Steven Walker 150520 by: Rasmus Lerdorf 150521 by: Steven Walker 150531 by: joel boonstra 150546 by: Steven Walker About php_hostconnect failure 150522 by: Fang, Ting MYSQL_CLIENT_COMPRESS 150524 by: Armand Turpel cookies and iexplorer 150528 by: Omar 150529 by: Boaz Yahav Re: Heredoc question 150530 by: Mark Error starting apache w/ php installed (or not?) 150532 by: Ryan Vennell Question about fopen 150533 by: Jay Blanchard 150534 by: Kevin Stone 150535 by: Jay Blanchard 150541 by: Philip Olson 150542 by: Jay Blanchard Duplicate records 150537 by: Steve Marquez 150538 by: Tyler Longren 150540 by: John Griffin 150549 by: John W. Holmes Re: Show php code 150539 by: Jaap van Ganswijk new window 150545 by: Adriaan Nel 150547 by: Brad Bonkoski 150548 by: John W. Holmes Need help with display of results 150550 by: Gloria L. McMillan 150554 by: Gloria L. McMillan 150558 by: Lars Torben Wilson 150559 by: Lars Torben Wilson Web Server Firewall Suggested 150551 by: Luis Lebron Capturing HTTP Response 150552 by: Ralph Re: PGP? 150553 by: Ryan Vennell Problem Display of data 150555 by: Gloria L. McMillan 150556 by: Hugh Danaher 150557 by: John W. Holmes 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] ----------------------------------------------------------------------
--- Begin Message ---Short Answer: Its all about programming. Task you asked is easy to accomplish. Long Answer: PHP or JavaScript, it is still to program. If you feel yourself being a good programmer already or a being a quick learner then there should be no worries from your side doing such thingies... in PHP or JavaScript or both. -- Maxim Maletsky [EMAIL PROTECTED] On Fri, 6 Jun 2003 10:38:05 +0100 "Simon Thurtle" <[EMAIL PROTECTED]> wrote: > OK, now I have I have been convinced that PHP is the best thing since cheese > burgers, I have a question... > How easy is it to... Have a set of 6 HTML drop downs each with texted based > info that when selections are made generate a dynamic on screen price? > > So in english, drop down one could be vehicle type, drop down two could be > engine size, three is CD player (yes / no selection). OK? > > So would I need to make a DB for this? (Baring in mind the prices are pretty > much static) or can I justy define the variables in an include? > > Or am I talking rubbish? > > Cheers, > > S > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---Thought I throw in my post from the forums into this mailing list: Just wanted to give my results on this test I did. First the story. I will be hosting sites on my server and decided to go with .NET/Win2003, with IIS. Well most sites are php based or perl with mysql backend. After configuring everything I gave it a test from another system externally. i did that and noticed it was slow. Slower compared to the linux box I currently have the site on for testing purposes on another provider. Heck even while statements without hitting the DB were giving delays that were over 10 seconds! Wooa I couldnt believe it. So I decided to add a code snippet to get the seconds of script execution. I did this off a query with 12 results that echoed out into html. Now with Linux I came up with numbers like: 0.0163360 The above number was pretty consistent. Now onto Windows 2003 .NET. On the same page with the same output: 2.6936080 0.9500151 4.9112860 0.6226690 0.6032619 Wooa!! But this cant be true. I have had Win2k host php sites before and it seemed faster then .NET. But these are the results so far. So with this my thoughts of cause are: a) Windows just plain sucks with open source b) .NET doesnt seem to allow cgi, only ISAPI. Perhaps ISAPI is slowing it down c) In Linux Im using Apache, where in Windows Im using IIS d) The .NET OS is a beta and that could be the issue e) My code just sucks. But why would it be faster on Linux then? Any thoughts on the possibilities I have shown here? The Chaos __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---> c) In Linux Im using Apache, where in Windows Im using > IIS probably this is the issue. Make it be apache as well. -- Maxim Maletsky [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---> Thought I throw in my post from the forums into this > mailing list: Do you like starting wars? > Just wanted to give my results on this test I did. > First the story. I will be hosting sites on my server > and decided to go with .NET/Win2003, with IIS. Well > most sites are php based or perl with mysql backend. > After configuring everything I gave it a test from > another system externally. i did that and noticed it > was slow. Slower compared to the linux box I currently > have the site on for testing purposes on another > provider. Heck even while statements without hitting > the DB were giving delays that were over 10 seconds! That's just something horribly wrong with your installation. I guess it could be some "beta" bug with .NET. Yeah, windows can be slower, but not that slow. Are you sure the databases are the same on each one, including the indexes? > a) Windows just plain sucks with open source > b) .NET doesnt seem to allow cgi, only ISAPI. Perhaps > ISAPI is slowing it down Usually ISAPI is faster than CGI, but .NET could be screwing with things. > c) In Linux Im using Apache, where in Windows Im using > IIS > d) The .NET OS is a beta and that could be the issue I'd bank on this one, since PHP runs quite fast on Win2K with IIS and PHP as an ISAPI. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---It's quite suprising how fast my PHP (and Perl) is under WinME/Apache 1.3.27/PHP 4.3.2... It's unstable as F though so not way to recommended... I was intrested in your server specs? How much RAM? And so on... And was the tests on the same server or did I missunderstand something? "Azflsite" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Thought I throw in my post from the forums into this > mailing list: > > Just wanted to give my results on this test I did. > First the story. I will be hosting sites on my server > and decided to go with .NET/Win2003, with IIS. Well > most sites are php based or perl with mysql backend. > After configuring everything I gave it a test from > another system externally. i did that and noticed it > was slow. Slower compared to the linux box I currently > have the site on for testing purposes on another > provider. Heck even while statements without hitting > the DB were giving delays that were over 10 seconds! > > Wooa I couldnt believe it. So I decided to add a code > snippet to get the seconds of script execution. I did > this off a query with 12 results that echoed out into > html. Now with Linux I came up with numbers like: > > 0.0163360 > > > The above number was pretty consistent. Now onto > Windows 2003 .NET. On the same page with the same > output: > > 2.6936080 > 0.9500151 > 4.9112860 > 0.6226690 > 0.6032619 > > Wooa!! But this cant be true. I have had Win2k host > php sites before and it seemed faster then .NET. But > these are the results so far. So with this my thoughts > of cause are: > > a) Windows just plain sucks with open source > b) .NET doesnt seem to allow cgi, only ISAPI. Perhaps > ISAPI is slowing it down > c) In Linux Im using Apache, where in Windows Im using > IIS > d) The .NET OS is a beta and that could be the issue > e) My code just sucks. But why would it be faster on > Linux then? > > Any thoughts on the possibilities I have shown here? > > The Chaos > > __________________________________ > Do you Yahoo!? > Yahoo! Calendar - Free online calendar with sync to Outlook(TM). > http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---Thanks everyone for your replies. I did test on the same server. I had .NET installed and tested. Then installed Linux on same box. The box is a p4 1.7 gig with 512 ddr with a 30 gig 7200rpm hdd Im going to drop to win2k and see the results. I will post results here if anyone cares. Silly --- DvDmanDT <[EMAIL PROTECTED]> wrote: > It's quite suprising how fast my PHP (and Perl) is > under WinME/Apache > 1.3.27/PHP 4.3.2... It's unstable as F though so not > way to recommended... > > I was intrested in your server specs? How much RAM? > And so on... And was the > tests on the same server or did I missunderstand > something? > "Azflsite" <[EMAIL PROTECTED]> skrev i meddelandet > news:[EMAIL PROTECTED] > > Thought I throw in my post from the forums into > this > > mailing list: > > > > Just wanted to give my results on this test I did. > > First the story. I will be hosting sites on my > server > > and decided to go with .NET/Win2003, with IIS. > Well > > most sites are php based or perl with mysql > backend. > > After configuring everything I gave it a test from > > another system externally. i did that and noticed > it > > was slow. Slower compared to the linux box I > currently > > have the site on for testing purposes on another > > provider. Heck even while statements without > hitting > > the DB were giving delays that were over 10 > seconds! > > > > Wooa I couldnt believe it. So I decided to add a > code > > snippet to get the seconds of script execution. I > did > > this off a query with 12 results that echoed out > into > > html. Now with Linux I came up with numbers like: > > > > 0.0163360 > > > > > > The above number was pretty consistent. Now onto > > Windows 2003 .NET. On the same page with the same > > output: > > > > 2.6936080 > > 0.9500151 > > 4.9112860 > > 0.6226690 > > 0.6032619 > > > > Wooa!! But this cant be true. I have had Win2k > host > > php sites before and it seemed faster then .NET. > But > > these are the results so far. So with this my > thoughts > > of cause are: > > > > a) Windows just plain sucks with open source > > b) .NET doesnt seem to allow cgi, only ISAPI. > Perhaps > > ISAPI is slowing it down > > c) In Linux Im using Apache, where in Windows Im > using > > IIS > > d) The .NET OS is a beta and that could be the > issue > > e) My code just sucks. But why would it be faster > on > > Linux then? > > > > Any thoughts on the possibilities I have shown > here? > > > > The Chaos > > > > __________________________________ > > Do you Yahoo!? > > Yahoo! Calendar - Free online calendar with sync > to Outlook(TM). > > http://calendar.yahoo.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---Thanks, this sorta draws my intrest now... Also, I'm a bit outdated on the microsoft front... Has windows gone opensource? "Azflsite" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Thanks everyone for your replies. > > I did test on the same server. I had .NET installed > and tested. Then installed Linux on same box. The box > is a p4 1.7 gig with 512 ddr with a 30 gig 7200rpm hdd > > Im going to drop to win2k and see the results. I will > post results here if anyone cares. > > Silly > --- DvDmanDT <[EMAIL PROTECTED]> wrote: > > It's quite suprising how fast my PHP (and Perl) is > > under WinME/Apache > > 1.3.27/PHP 4.3.2... It's unstable as F though so not > > way to recommended... > > > > I was intrested in your server specs? How much RAM? > > And so on... And was the > > tests on the same server or did I missunderstand > > something? > > "Azflsite" <[EMAIL PROTECTED]> skrev i meddelandet > > > news:[EMAIL PROTECTED] > > > Thought I throw in my post from the forums into > > this > > > mailing list: > > > > > > Just wanted to give my results on this test I did. > > > First the story. I will be hosting sites on my > > server > > > and decided to go with .NET/Win2003, with IIS. > > Well > > > most sites are php based or perl with mysql > > backend. > > > After configuring everything I gave it a test from > > > another system externally. i did that and noticed > > it > > > was slow. Slower compared to the linux box I > > currently > > > have the site on for testing purposes on another > > > provider. Heck even while statements without > > hitting > > > the DB were giving delays that were over 10 > > seconds! > > > > > > Wooa I couldnt believe it. So I decided to add a > > code > > > snippet to get the seconds of script execution. I > > did > > > this off a query with 12 results that echoed out > > into > > > html. Now with Linux I came up with numbers like: > > > > > > 0.0163360 > > > > > > > > > The above number was pretty consistent. Now onto > > > Windows 2003 .NET. On the same page with the same > > > output: > > > > > > 2.6936080 > > > 0.9500151 > > > 4.9112860 > > > 0.6226690 > > > 0.6032619 > > > > > > Wooa!! But this cant be true. I have had Win2k > > host > > > php sites before and it seemed faster then .NET. > > But > > > these are the results so far. So with this my > > thoughts > > > of cause are: > > > > > > a) Windows just plain sucks with open source > > > b) .NET doesnt seem to allow cgi, only ISAPI. > > Perhaps > > > ISAPI is slowing it down > > > c) In Linux Im using Apache, where in Windows Im > > using > > > IIS > > > d) The .NET OS is a beta and that could be the > > issue > > > e) My code just sucks. But why would it be faster > > on > > > Linux then? > > > > > > Any thoughts on the possibilities I have shown > > here? > > > > > > The Chaos > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! Calendar - Free online calendar with sync > > to Outlook(TM). > > > http://calendar.yahoo.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Calendar - Free online calendar with sync to Outlook(TM). > http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---Any advice? Thanks! Shawn "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I can't get ob_get_contents() to return false, or I don't know how to test > for it. Help appreciated. The following never echos STARTING!!! > > ob_end_flush(); > if(ob_get_contents() === FALSE) { > echo "STARTING!!!"; > ob_start(); > } > > also tried: if(ob_get_contents() == FALSE) > and: if(!ob_get_contents()) > and: if(ob_get_contents() == "") > > But I do get the following notice at the ob_end_flush(); line which tells me > that output buffering is not on: > > Notice: ob_end_flush() [ref.outcontrol]: failed to delete buffer default > output handler. > > Thanks! > Shawn > >
--- End Message ---
--- Begin Message ---We upgraded from php 4.1.2 to php 4.3.2 and some errors have been discovered. Some scripts use the form <input type=file> and use to return a value of none when no date is entered. This value (none)is no longer returned and has caused application errors. Is there something that can be modified in the .ini file to change this behavior back. It would be alot easier doing this than modifying the large number of scripts that allow file uploads. Any help is greatly appreciated. thnx, Chris
--- End Message ---
--- Begin Message ---Thanks for your reply. I had actually made a mistake in the code. It looks like this now: print "<a href=\"#\" onClick=\"window.opener.document.order.".stripslashes($HTTP_GET_VARS['name'] ).".value='$y-$m-$d';\">$d</a>"; How could I still use the id thing on this? I now use ' in the brakets as well, if that helps any... I'm not yours, so why should I be sincere about it, Stephen Craton Senior Executive Web Developer Mophus.com, Inc. ----- Original Message ----- From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]> To: "'Stephen'" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]> Sent: Friday, June 06, 2003 4:22 AM Subject: RE: [PHP] PHP/Javascript Help > -----Original Message----- > From: Stephen [mailto:[EMAIL PROTECTED] > Sent: 05 June 2003 19:15 > > Here's my javascript link code for each day of the month in > the calendar script: > > print "<a href=\"#\" > onClick=\"window.opener.document.".$HTTP_GET_VARS['name'].".da > te.value='$y-$m-$d';\">$d</a>"; > > $HTTP_GET_VARS['name'] holds the text field name, ie > delivery[3322ffds]. If I replace the name either order in the > text field and as the variable I pass in the URL it works fine. You need to make use of the JavaScript ['id'] identity with .id (see any good JavaScript book for more on this), thus: print "<a href=\"#\" onClick=\"window.opener.document['" . $HTTP_GET_VARS['name'] . "'].date.value='$y-$m-$d';\">$d</a>"; Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---Dear colleague, LISA, in collaboration with Lemoine International has made "Software Testing and Internationalization" by Galileo Computing freely available for download. This 330 page book will transform how you view testing methodologies and procedures. It introduces the reader to essential concepts and approaches used by practitioners in the software testing arena, while also taking into account the realities of low budgets and real schedule deadlines. It is in this context that the specific needs of small, agile project teams are covered in detail. Topics covered: * New approaches to quality * Risk analysis and evaluation * Risk-based testing * Exploratory testing * Testing and tuning * Testing by using * Use cases, requirements, and test cases * Debugging * Myths and realities of Automated Testing * Windows scripting * Test frameworks * Testing-based application development * Tools for developers and testers * Agile test management * International planning and architecture * International development issues * Internationalization testing To download a copy, please visit http://www.lisa.org/interact/2003/swtestregister.html Founded in 1990 as a non-profit association, LISA is the premier organization for the GILT (Globalization, Internationalization, Localization, and Translation) business communities. Over 400 leading IT manufacturers and solutions providers, along with industry professionals and an increasing number of vertical market corporations with an international business focus, have helped establish LISA best practice guidelines and language-technology standards for enterprise globalization.
--- End Message ---
--- Begin Message ---> Dear colleague, > > LISA, in collaboration with Lemoine International has made "Software > Testing and Internationalization" by Galileo Computing freely available > for download. [snip] > To download a copy, please visit > http://www.lisa.org/interact/2003/swtestregister.html How about a privacy statement on the page where you collect all of our info? ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---I was wondering if anyone out there knew if there was any code you could add to your page that would allow the user to accept a cookie from your site even though the browser has denied it due to security settings. Basically, can I add a button that will allow a viewer to allow cookies on their machine even though their settings would normally block it? Thanks, Joaco
--- End Message ---
--- Begin Message ---Not possible AFAIK since it would negate the point in having a local cookie policy and would leave possibility for abuse. Bix "Joaco" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I was wondering if anyone out there knew if there was any code you could add > to your page that would allow the user to accept a cookie from your site > even though the browser has denied it due to security settings. > > Basically, can I add a button that will allow a viewer to allow cookies on > their machine even though their settings would normally block it? > > Thanks, > > Joaco > >
--- End Message ---
--- Begin Message ---Glory! I'm stuck in a crazy problem. I have a Global.PHP file that runs the whole show. It's a Link Index Program with a Yahoo Style Directory Structure. There are certain additional features like "New Links", "Popular Links", "Top Rated" etcetera. The global.php file contains functions for each feature. But each function ends with exit; If you don't use the exit; , then the main Category Structure, which is the prime function, a global function, also displays on every page.. And if you do use exit; .. then all the rest of the HTML and Interface code disappears and the page just ends there. This is a problem.. I need to display the rest of the Interface, but not the Category Structure, when you click on a feature like New Links.. Let me give you example of New Links function.. function new_links($numdays) { global $nol; // displays a list of links added in the last x days - limit is $nol links if (!$numdays) { $numdays = '5'; } else { $numdays = "$numdays"; } $time = time(); $mintime = $time - ($numdays * 24 * 60 * 60); $links_sql = "SELECT * FROM sslinks WHERE link_dateadd > $mintime AND link_validated = 'yes' ORDER BY link_dateadd DESC LIMIT 0,$nol"; $links = links_sql($links_sql); echo html_header("New Links"); if (!$links) { $links = ss_template('no_new_links.tmpl'); } echo ss_template('new_links_page.tmpl', array('%maxnumlinks%' => $nol, '%numdays%' => $numdays, '%links%' => $links)); echo html_footer(); exit; } Now this function goes in a place inside a page which has a complete Site interface.. I cant have the page just stop here.. the rest of the Interface needs to display. Removing "exit;" does that.. but also repeats the Directory Structure which is a Global Function.. I tried using "break;" but that doesn't work this way.. Any suggestions? PHPSpooky ______________________________________ "If God had wanted me otherwise, He would have created me otherwise." - Johann Wolfgang von Goethe
--- End Message ---
--- Begin Message ---Perhaps a return, if it's a global function? Like return(1) if success and return(0) if failure or something like that? However I have a question for you, why do you turn $numdays into a string and then do mathematical operations on it? $numdays = "$numdays"; and $numdays = '5'; Does that force some kind of behavior that's needed? Interesting. Carl Furst Chief Technical Officer Vote.com 50 Water St. South Norwalk, CT. 06854 203-854-9912 x.231 -----Original Message----- From: PHPSpooky [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 11:16 AM To: [EMAIL PROTECTED] Subject: [PHP] Need aternate for "exit;" Glory! I'm stuck in a crazy problem. I have a Global.PHP file that runs the whole show. It's a Link Index Program with a Yahoo Style Directory Structure. There are certain additional features like "New Links", "Popular Links", "Top Rated" etcetera. The global.php file contains functions for each feature. But each function ends with exit; If you don't use the exit; , then the main Category Structure, which is the prime function, a global function, also displays on every page.. And if you do use exit; .. then all the rest of the HTML and Interface code disappears and the page just ends there. This is a problem.. I need to display the rest of the Interface, but not the Category Structure, when you click on a feature like New Links.. Let me give you example of New Links function.. function new_links($numdays) { global $nol; // displays a list of links added in the last x days - limit is $nol links if (!$numdays) { $numdays = '5'; } else { $numdays = "$numdays"; } $time = time(); $mintime = $time - ($numdays * 24 * 60 * 60); $links_sql = "SELECT * FROM sslinks WHERE link_dateadd > $mintime AND link_validated = 'yes' ORDER BY link_dateadd DESC LIMIT 0,$nol"; $links = links_sql($links_sql); echo html_header("New Links"); if (!$links) { $links = ss_template('no_new_links.tmpl'); } echo ss_template('new_links_page.tmpl', array('%maxnumlinks%' => $nol, '%numdays%' => $numdays, '%links%' => $links)); echo html_footer(); exit; } Now this function goes in a place inside a page which has a complete Site interface.. I cant have the page just stop here.. the rest of the Interface needs to display. Removing "exit;" does that.. but also repeats the Directory Structure which is a Global Function.. I tried using "break;" but that doesn't work this way.. Any suggestions? PHPSpooky ______________________________________ "If God had wanted me otherwise, He would have created me otherwise." - Johann Wolfgang von Goethe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---Hello all, I'm using the following code to create images on the fly on a web site for page headers. This works great for the most part, but a couple times now the text has started resizing for no apparent reason. The first time it was just slightly wider than normal. Most recently the text was giant. I'm running PHP 4.3.1 on Win2k Server. Code: header("Content-type: image/jpeg"); $im = imagecreate(200,14); $white = imagecolorallocate($im, 255,255,255); $green = imagecolorallocate($im, 51,102,0); $shadow = imagecolorallocate($im, 204,204,153); imagettftext($im, 12, 0, 1, 14, $shadow, "arialbd.ttf", $imgText); imagettftext($im, 12, 0, 0, 13, $green, "arialbd.ttf", $imgText); imagejpeg($im); imagedestroy($im); If I restart IIS, the problem goes away. Has anyone else seen this problem, know why this might be happening and/or have a fix? Thanks much, Doug Dossett, LLC www.dougdossett.com
--- End Message ---
--- Begin Message ---This is what I use http://members.lycos.co.uk/wipe_out/automysqlbackup/ -----Original Message----- From: John Kaspar [mailto:[EMAIL PROTECTED] Sent: Friday, April 25, 2003 3:48 PM To: [EMAIL PROTECTED] Subject: [PHP] mysql backup solution I've got a large mysql database (~400 megs) on a host that I need to backup regularly. If I use phpMyAdmin's dump features, it just freezes. I've currently got a php script that goes thru each table and backs up about 10,000 records iteratively (for example accounts1.txt, accounts2.txt). But it just backs them up to the host itself. (a) I need it to zip up the files to make them smaller, (b) I would like the script to save the zipped files to a designated folder on my local harddrive via ftp download (without me having to say where, or giving it an okay). Is that possible? Does someone have a better backup method? Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---Is there a way to check form variables provided in $_POST once a user submits the form to make sure they are currency or numbers? Thanks, Dan
--- End Message ---
--- Begin Message ---whats the different between currency and number??? aren't they both number? are you trying to check if the number format is in currency like 2 decimal place or something?? ----- Original Message ----- From: "Dan Anderson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 06, 2003 4:45 PM Subject: [PHP] How can I check form variables in $_POST to make sure they are theright format? > Is there a way to check form variables provided in $_POST once a user > submits the form to make sure they are currency or numbers? > > Thanks, > > Dan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---> whats the different between currency and number??? aren't they both number? > > are you trying to check if the number format is in currency like 2 decimal > place or something?? > Well I want to check that the format is a number. Because it's currency, I want to double check to see if there are any $s or similar, and strip them (maybe trim?). And I want to convert the number from a string to a number -- which is another reason I want to make sure nobody enters something stupid like "eighteen dollars". Thanks, -Dan > > > ----- Original Message ----- > From: "Dan Anderson" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, June 06, 2003 4:45 PM > Subject: [PHP] How can I check form variables in $_POST to make sure they > are theright format? > > > > Is there a way to check form variables provided in $_POST once a user > > submits the form to make sure they are currency or numbers? > > > > Thanks, > > > > Dan > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >
--- End Message ---
--- Begin Message ---See: http://www.php.net/manual/en/function.is-numeric.php Well I want to check that the format is a number. Because it's currency, I want to double check to see if there are any $s or similar, and strip them (maybe trim?). And I want to convert the number from a string to a number -- which is another reason I want to make sure nobody enters something stupid like "eighteen dollars". Thanks, -Dan http://www.cantor.com CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Copyright and any other intellectual property rights in its contents are the sole property of Cantor Fitzgerald. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). For further important information, please read the Important Legal Information and Legal Statement at http://www.cantor.com/legal_information.html
--- End Message ---
--- Begin Message ---a little help? >>> Ryan Vennell<[EMAIL PROTECTED]> 06/05/03 09:36AM >>> ok, when i compile php i dont get libphp4.so. i'm not a linux Newb or anything but i'm not an extremely advanced user either so any help would be useful... i cant exactly run apache w/ php w/out this module. thanks for any help any of you can give me. Redhat 8/apache2 (ugh @ both) -Ryan
--- End Message ---
--- Begin Message ---On Friday 06 June 2003 23:53, Ryan Vennell wrote: > a little help? Perhaps a little (more) info would help? > >>> Ryan Vennell<[EMAIL PROTECTED]> 06/05/03 09:36AM >>> > > ok, when i compile php i dont get libphp4.so. i'm not a linux Newb or > anything but i'm not an extremely advanced user either so any help would be > useful... i cant exactly run apache w/ php w/out this module. thanks for > any help any of you can give me. > > Redhat 8/apache2 (ugh @ both) How did you compile it? Did you ./configure it correctly? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* You must dine in our cafeteria. You can eat dirt cheap there!!!! */
--- End Message ---
--- Begin Message ---Goodstuff! Tight design work and works a charm ;o) Bix. "Mark Owen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi guys, > > we set up a new resource for organizing all books on PHP in a quick-to-scan, > Google-like center. Hope you enjoy it. > > http://www.phpbooks.com > > Mark >
--- End Message ---
--- Begin Message ---> I mean if someone is into programming/php they will have enough > brains (most of the time) to do that much right? By that logic they'd also have enough brains to look at the documentation before asking questions on the mailing list, or to not reply to spam on the list, etc., etc. and we all know that isn't true.
--- End Message ---
--- Begin Message ---Jay Blanchard wrote: > > There are so many ways to skin this cat. You could (as you said, it will > require adding HTML to the list of php parsed file types) have the > header, body, and footer files read into a single file and then output. > You could do something like this ... (a lot of folks use the following > simple method to include navigation in web pages)... > > <html> > <head></head> > <body> > <?php > include("headerfile.inc"); > ?> > ... other html ... > > ... other html ... > > ... other html ... > > ... other html ... > > <?php > include("footerfile.inc"); > ?> > </body> > </html> > > I do not think that this needs to be difficult, but if you want more > complexity you could have it. The reasonn for my "difficult" answer was because the criteria for his solution indicated that he did not want to modify the html pages themselves. Thus the above solution is invalid :| Cheers, Rob. -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------'
--- End Message ---
--- Begin Message ---Thanks for the suggestion. Still no luck though with the file path on windows; e.g. file path is http://192.168.1.2/dev_files/drop_down.js So, when I open the file for writing: $fw = fopen($file_path, "wb") an error results ("can't open file") Looks like I need to escape out of slashes within the file path on windows. In any case, thanks for the idea -- it's a step in the right direction, --Noah "Ptker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If the file is binary, try fopen($file_path, "wb"); > "Cf High" <[EMAIL PROTECTED]> ~{P4HkO{O"PBNE~} > :[EMAIL PROTECTED] > > Hey all. > > > > Quick question here that's driving me up the wall: > > > > Using fopen(), I'm easily able to open files for reading; however, when I > > attempt to open files for writing using fopen($file_path, "W+"), an error > > occurs. > > > > I'm able to use fopen($file_path, "a+"), but I need to be able to > overwrite > > files; not write to the end of the file. > > > > Again, I'm testing on windows here.......... > > > > Any suggestions greatly appreciated, > > > > --Noah > > > > > >
--- End Message ---
--- Begin Message ---On Saturday 07 June 2003 03:25, CF High wrote: > Still no luck though with the file path on windows; e.g. file path is > http://192.168.1.2/dev_files/drop_down.js > > So, when I open the file for writing: $fw = fopen($file_path, "wb") an > error results ("can't open file") > You can't open an HTTP stream for writing! -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* APL is a natural extension of assembler language programming; ...and is best for educational purposes. -- A. Perlis */
--- End Message ---
--- Begin Message ---Ah, well that's a useful bit of info ;--) Didn't run across that in php.net's description of fopen() Thanks, Jason -- I'll switch to relative paths.......... --Noah "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Saturday 07 June 2003 03:25, CF High wrote: > > > Still no luck though with the file path on windows; e.g. file path is > > http://192.168.1.2/dev_files/drop_down.js > > > > So, when I open the file for writing: $fw = fopen($file_path, "wb") an > > error results ("can't open file") > > > > You can't open an HTTP stream for writing! > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > APL is a natural extension of assembler language programming; > ...and is best for educational purposes. > -- A. Perlis > */ >
--- End Message ---
--- Begin Message --- Hello,
I have found troubling behavior using include() that looks like a bug. When I specify an include file by a full path name versus a relative path, PHP acts as though it has included the file, but variable and constant definitions in the include file are not coming through. My server is running PHP 4.3.1.
Here is an example:
I created a file called 'include.php', with the following contents:
<?
echo "include.php opened <br>"; //should print -only- if included, right?
$testVar = "test succeeded!";
?>
Then I created 'test.php', with the following contents:
<?
$testVar = "not defined"; //include.php should redefine this as 'test succeeded!'
//include("http://www.walkereffects.com/test/include.php"); // full path
include("include.php"); // relative path
echo $testVar;
?>
Using the relative path version of include outputs: include.php opened test succeeded!
And using the full path results in: include.php opened not defined
This doesn't seem right! Any ideas how I can work around this?
Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---Uh, http://www.walkereffects.com/test/include.php is not a "full path name", that is a URL. That will make an HTTP request to your web server for /test/include.php which will of course get parsed by PHP and you will only get the parsed output which means you won't see any variables or any PHP tags at all for that matter. This is doing exactly what you are asking it to do. -Rasmus On Fri, 6 Jun 2003, Steven Walker wrote: > Hello, > > I have found troubling behavior using include() that looks like a bug. > When I specify an include file by a full path name versus a relative > path, PHP acts as though it has included the file, but variable and > constant definitions in the include file are not coming through. My > server is running PHP 4.3.1. > > Here is an example: > > I created a file called 'include.php', with the following contents: > <? > echo "include.php opened <br>"; //should print -only- if included, > right? > $testVar = "test succeeded!"; > ?> > > Then I created 'test.php', with the following contents: > <? > $testVar = "not defined"; //include.php should redefine this as > 'test > succeeded!' > //include("http://www.walkereffects.com/test/include.php"); // full > path > include("include.php"); // relative path > echo $testVar; > ?> > > Using the relative path version of include outputs: > include.php opened > test succeeded! > > And using the full path results in: > include.php opened > not defined > > This doesn't seem right! Any ideas how I can work around this? > > Steven J. Walker > Walker Effects > www.walkereffects.com > [EMAIL PROTECTED]
--- End Message ---
--- Begin Message --- I get it... so instead I should use:
include("/usr/home/sites/www.walkereffects.com/web/test/include.php")
Thank you,
Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED]
On Friday, June 6, 2003, at 10:08 AM, Rasmus Lerdorf wrote:
Uh, http://www.walkereffects.com/test/include.php is not a "full path
name", that is a URL. That will make an HTTP request to your web server
for /test/include.php which will of course get parsed by PHP and you will
only get the parsed output which means you won't see any variables or any
PHP tags at all for that matter. This is doing exactly what you are
asking it to do.
-Rasmus
On Fri, 6 Jun 2003, Steven Walker wrote:
Hello,
I have found troubling behavior using include() that looks like a bug. When I specify an include file by a full path name versus a relative path, PHP acts as though it has included the file, but variable and constant definitions in the include file are not coming through. My server is running PHP 4.3.1.
Here is an example:
I created a file called 'include.php', with the following contents: <? echo "include.php opened <br>"; //should print -only- if included, right? $testVar = "test succeeded!"; ?>
Then I created 'test.php', with the following contents:
<?
$testVar = "not defined"; //include.php should redefine this as 'test
succeeded!'
//include("http://www.walkereffects.com/test/include.php"); // full
path
include("include.php"); // relative path
echo $testVar;
?>
Using the relative path version of include outputs: include.php opened test succeeded!
And using the full path results in: include.php opened not defined
This doesn't seem right! Any ideas how I can work around this?
Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED]
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---On Fri, Jun 06, 2003 at 10:19:10AM -0700, Steven Walker wrote: > I get it... so instead I should use: > > include("/usr/home/sites/www.walkereffects.com/web/test/include.php") I would recommend using your .htaccess file, or ini_set, or something else to set your include_path variable to contain '/usr/home/sites/www.walkereffects.com/' or something like that. Your include() call can then just look like: <? include('web/test/include.php'); ?> and it'll work from anywhere, regardless of where the file that's doing the including is located [1]. As a bonus, if you ever change hosts, or your host re-organizes its directory structure, and all of your includes rely on the include_path, simply re-set include_path, and your site works again. joel [1] Of course, the order of directories in your include_path matters, too. If it contains '.:/usr/home/sites/www.walkereffects.com/', then a file matching in the current working directory will take precedence over the one in your site root. So keep that in mind... -- [ joel boonstra | gospelcom.net ]
--- End Message ---
--- Begin Message ---I would recommend using your .htaccess file, or ini_set, or something else to set your include_path variable
Thanks Joel, that worked nicely.
Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED]
--- End Message ---
--- Begin Message --- Title: About php_hostconnect failureAny information about causes for php_hostconnect failure would be highly appreciated!
(This happened with the following source code: fopen ("http://httpd.apache.org/", "r")).The warning message says:
Failed to open steam: Bad file descriptorThanks a lot!
Fang, Ting
--- End Message ---
--- Begin Message ---Hi, Is there any body who have experience with the flags in mysql_connect() in php >= 4.3 . Especially the MYSQL_CLIENT_COMPRESS flag. Give it sense, to use this feature if both, apache/php and the mysql server reside on the same machine? Thanks, Armand
--- End Message ---
--- Begin Message ---I have this login page, if the login is correct, i create 3 cookies: - user = $login - password = $pass - seepage = 1 on the other pages, i placed a condition: if $seepage != 1 go to login page else show page It works fine to some people (works fine for me), but there are other people who canīt see a page with the condition. We tryed changin the security leven on the browser (internet explorer 5.x & 6), and lots of other related things, but they still canīt see the page. Do you have any advice? I don't have a clue about what could be wrong with these people. Thank you.
--- End Message ---
--- Begin Message ---I'm not sure what you are trying to do but what reason can you possibly have to store the password of a user in his cookie? Usually the username is also not something you need in the cookie. Are you sure the cookies are set at all? can you show some code? specially the one you set the cookies with? Also, is there any chance that the cookies are set on a different domain than the one you are in (e.g., you are using an IFRAME or something?) Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -----Original Message----- From: Omar [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 8:41 PM To: [EMAIL PROTECTED] Subject: [PHP] cookies and iexplorer I have this login page, if the login is correct, i create 3 cookies: - user = $login - password = $pass - seepage = 1 on the other pages, i placed a condition: if $seepage != 1 go to login page else show page It works fine to some people (works fine for me), but there are other people who canīt see a page with the condition. We tryed changin the security leven on the browser (internet explorer 5.x & 6), and lots of other related things, but they still canīt see the page. Do you have any advice? I don't have a clue about what could be wrong with these people. Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---Or you can just escape out of PHP like so: <?php $truth = true; $head = "brain bucket"; ?> This is a test of the emergency broadcasting system. If this had been an actual emergency, you would have been instructed to <?php echo $truth?" place your {$head} between your legs and\n":""; ?> read from the chapters of Matthew, Mark, Luke and DUCK!! --- Sparky Kopetzky <[EMAIL PROTECTED]> wrote: > I did figure a way around heredoc last night. Here's the solution > if anyone > can use it: > > <?php > $truth = true; > $head = "brain bucket"; > $message = <<<TEST > This is a test of the emergency broadcasting system. > If this had been an actual emergency, you would have > been instructed to > TEST; > > if ($truth) > { > $message .= " place your {$head} between your legs and\n"; > } > > $message .= <<<TEST > read from the chapters of Matthew, Mark, Luke > and DUCK!! > TEST; > > print $message; > ?> > $message is actually works in heredoc just like any other string. > Didn't > expect that. > Hope this helps someone else who is trying the same thing as I am. > > Robin E. Kopetzky > Black Mesa Computers/Internet Services > www.blackmesa-isp.net > > ----- Original Message ----- > From: "Jennifer Goodie" <[EMAIL PROTECTED]> > To: "Sparky Kopetzky" <[EMAIL PROTECTED]>; "PHP General" > <[EMAIL PROTECTED]> > Sent: Thursday, June 05, 2003 16:47 > Subject: RE: [PHP] Heredoc question > > > > > Can one use <?php ?> within the heredoc syntax or is there > > > another way?? I'm trying to dynamically generate email from > > > generic text but with obvious additions, like this: > > > > http://us4.php.net/types.string says that heredoc acts just like > double > > quoted, which would mean it expands variables, so I would try > just > throwing > > them in there like this... > > > > > > $message = <<<my_message > > Name: {$lot->get_name()} > > > > Lot {$lot->get_id()} has been approved. Here is the > > link to the lot: > > my_message; > > > > > > There's an example of almost exactly like this on that page. > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > ===== Mark Weinstock [EMAIL PROTECTED] *************************************** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *************************************** __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---ok when i try to start apache2 (on redhat 8, php 4.2.2) i get this: Starting httpd: Syntax error on line 176 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp4.so into server: libssl.so.4: cannot open shared object file: No such file or directory [FAILED] line 176 of the httpd.conf is this: LoadModule php4_module modules/libphp4.so if i go into the modules directory, libphp4.so is right there in the directory with all the other modules. but it can't find it? is there something i'm missing here? thanks for any help...
--- End Message ---
--- Begin Message ---I have a file named billed.crm.php and it fopen throws the error "no such file or directory". It seems to have something to do with the multiple "." in the file name. Does anyone know why? Thanks! jay
--- End Message ---
--- Begin Message -------- Original Message ----- From: "Jay Blanchard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 06, 2003 1:13 PM Subject: [PHP] Question about fopen > I have a file named billed.crm.php and it fopen throws the error "no > such file or directory". It seems to have something to do with the > multiple "." in the file name. Does anyone know why? > > Thanks! > > jay It should make no difference. I hate to ask this but you're absolutely 100% certain the path is correct? - Kevin
--- End Message ---
--- Begin Message ---[snip] > I have a file named billed.crm.php and it fopen throws the error "no > such file or directory". It seems to have something to do with the > multiple "." in the file name. Does anyone know why? It should make no difference. I hate to ask this but you're absolutely 100% certain the path is correct? [/snip] yep...this file is contained in the same path of other single "." files where no problem occurs, and I, like you thought that it should not make a difference. Jay
--- End Message ---
--- Begin Message ---On Fri, 6 Jun 2003, Jay Blanchard wrote: > [snip] > > I have a file named billed.crm.php and it fopen throws the error "no > > such file or directory". It seems to have something to do with the > > multiple "." in the file name. Does anyone know why? > > It should make no difference. I hate to ask this but you're absolutely > 100% certain the path is correct? > [/snip] > > yep...this file is contained in the same path of other single "." files > where no problem occurs, and I, like you thought that it should not make > a difference. It won't make a difference, the issue must be something else, like permissions. Regards, Philip
--- End Message ---
--- Begin Message ---[snip] > > I have a file named billed.crm.php and it fopen throws the error "no > > such file or directory". It seems to have something to do with the > > multiple "." in the file name. Does anyone know why? > > It should make no difference. I hate to ask this but you're > absolutely 100% certain the path is correct? [/snip] > > yep...this file is contained in the same path of other single "." > files where no problem occurs, and I, like you thought that it should > not make a difference. It won't make a difference, the issue must be something else, like permissions. [/snip] ***SLAPPING FOREHEAD*** Not permissions, but you have to make sure that you have transferred files from the dev server to the prod server! Having an freaky Friday Thanks! jay
--- End Message ---
--- Begin Message ---Hello. I am adding a record to a MySQL Database using PHP. I have the records listed by the field: $id_num. I want the DB to be updated only with new id numbers, and return an error if there is a duplicate number already in the DB. Here is the code I am using: <?php $insert_data = "INSERT into articles Values ( '<a href=\"upload_form.php?id_num=$id_num\">edit</a>', '<a href=\"delete.php?id_num=$id_num\">delete</a>', '$id_num', '$title', '$author', '$article_contents', '$start_date', '' );"; $response = mysql_query( $insert_data, $dbh ); $get_table_data = "SELECT * FROM ccfs"; $response = mysql_query( $get_table_data, $dbh ); ?> Can anyone help me? Hope this makes sense. Thanks! Steve Marquez Marquez Design [EMAIL PROTECTED] www.marquez-design.com
--- End Message ---
--- Begin Message ---why not just make the 'id' field in the table auto_increment? tyler ----- Original Message ----- From: "Steve Marquez" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Cc: "PHP eMail List" <[EMAIL PROTECTED]> Sent: Friday, June 06, 2003 2:40 PM Subject: [PHP] Duplicate records > Hello. > > I am adding a record to a MySQL Database using PHP. I have the records > listed by the field: $id_num. > > I want the DB to be updated only with new id numbers, and return an error if > there is a duplicate number already in the DB. > > Here is the code I am using: > > <?php > > $insert_data = "INSERT into articles > > Values ( '<a href=\"upload_form.php?id_num=$id_num\">edit</a>', '<a > href=\"delete.php?id_num=$id_num\">delete</a>', '$id_num', '$title', > '$author', '$article_contents', '$start_date', '' );"; > > $response = mysql_query( $insert_data, $dbh ); > > > $get_table_data = "SELECT * FROM ccfs"; > $response = mysql_query( $get_table_data, $dbh ); > > ?> > > Can anyone help me? Hope this makes sense. > > Thanks! > > Steve Marquez > Marquez Design > [EMAIL PROTECTED] > > www.marquez-design.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
--- End Message ---
--- Begin Message ---Hello Steve, Do a select on the record before you insert it. If the record does not exist in the database (i.e. mysql_num_rows () == 0) than it is safe to do the insert. John -----Original Message----- From: Steve Marquez [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 3:41 PM To: MySQL List Cc: PHP eMail List Subject: Duplicate records Hello. I am adding a record to a MySQL Database using PHP. I have the records listed by the field: $id_num. I want the DB to be updated only with new id numbers, and return an error if there is a duplicate number already in the DB. Here is the code I am using: <?php $insert_data = "INSERT into articles Values ( '<a href=\"upload_form.php?id_num=$id_num\">edit</a>', '<a href=\"delete.php?id_num=$id_num\">delete</a>', '$id_num', '$title', '$author', '$article_contents', '$start_date', '' );"; $response = mysql_query( $insert_data, $dbh ); $get_table_data = "SELECT * FROM ccfs"; $response = mysql_query( $get_table_data, $dbh ); ?> Can anyone help me? Hope this makes sense. Thanks! Steve Marquez Marquez Design [EMAIL PROTECTED] www.marquez-design.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---> I am adding a record to a MySQL Database using PHP. I have the records > listed by the field: $id_num. > > I want the DB to be updated only with new id numbers, and return an error > if > there is a duplicate number already in the DB. So make the "id_num" column UNIQUE or a PRIMARY KEY. Then you will get an error if you insert a duplicate value. Find the error by using mysql_error(). ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---At 2003-04-12 16:33 -0400, Jack Dempsey wrote: >you can also make a copy of the file with a .phps extension, and if you have >it configured, the source code will show up, nicely colorized, etc... Before I read about the .phps extension (which probably stands for php source), I used: ln -s mysource.php mysource.php.txt This makes clear that it's actually a .php file, but it should be shown as a regular .txt file. I think that the advantage of this method is that the number of new extensions that are needed stays more limited. Otherwise each script language (.pl, .py) needs it's own source code extension (.pls., .pys) and in fact the file isn't different, it just has to be handled differently. Perhaps it would be better if it had been coded in the protocol, so the http:// part. Perhaps it would also have been better when .html files would have been automatically generated from .php files. So if you ask for index.html or index.htm and there is an index.php file it would be executed by the server and it's output would be send instead. The output is namely really HTML code. It would then also be possible to look at the source code under it's actual name with the .php extension. (Of course only when the file would have the proper permissions.) Greetings, Jaap >> -----Original Message----- >> From: Frappy John [mailto:[EMAIL PROTECTED] >> Sent: Saturday, April 12, 2003 4:21 PM >> To: [EMAIL PROTECTED] >> Cc: Pag >> Subject: Re: [PHP] Show php code >> >> >> > How can i make a print to the screen of php (or even >> > html) code without executing it? >> >> If you want to display an entire source file via your >> server, the simplest way is to rename your .php file with a >> .txt extension or, if you want to retain the file as >> working php, make a symbolic link to it: >> >> ln -s mysource.php mysource.txt >> >> Most servers are configured to treat a .txt file as plain >> text and include a mime header to that effect. Most >> browsers will honor the header. (If your file *begins* with >> an <html> or <?xml> tag, however, some browsers will format >> it despite the header. So start with <?php> or plain text. ) >> >> If, however, you want to include the source as part of a >> formatted HTML page, you will have to replace all the "<"s >> and ">"s with "<" and ">". A regular expression >> should do the trick. >> >> A quick and dirty workaround (to avoid learning regex :) is >> to include your code in a <form><textarea>. That seems to >> come through in raw format. >> >> (The HTML <code> tag you tried to use is for formatting >> purposes only, i.e. to make the code look like code [i.i.e. >> printed in a crude lineprinter font :] It's not specific >> to any programming language.) >> >> --John >> >> >> On Saturday 12 April 2003 12:47 am, Pag wrote: >> > HI again, >> > >> > How can i make a print to the screen of php (or even >> > html) code without executing it? I mean, i want to >> > display some php/html code on the site without the >> > browser interpreting it. >> > I tried using, >> > >> > <CODE> >> > insert html/php here >> > </CODE> >> > >> > but doesnt work. >> > >> > Thanks. >> > >> > Pag >> >> -- >> 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
--- End Message ---
--- Begin Message ---Hi all, How do I open a new window from php? Thanks Adriaan
--- End Message ---
--- Begin Message ---How about: echo "<a href='something.php' TARGET='_blank'>Link</a>"; Well, I guess that is really HTML, but with the idea that PHP is server side only you would need a client side method of opening windows. So, HTML, Javascript, pick your method.... -Brad Adriaan Nel wrote: > Hi all, > > How do I open a new window from php? > > Thanks > Adriaan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---> From: Adriaan Nel [mailto:[EMAIL PROTECTED] > > How do I open a new window from php? Click on File and then New. That will open a new text window for you to type PHP code. Or are you asking an HTML/Javascript question on a PHP list?? ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---Hi, again! I did not see my question as yet so I will repost it. I have had help writing HTML code to display the results of my PHP--> McSQL actions. But when I attempt to show the DATE and q40 (comments) with the HTML code below, all I see on screen is: ] in the upper left corner. URL: http://DakotaCom.net/~glomc/forms/Adj03.html (A poll on part-time faculty) Here's the code for the display that is not working... But the "]" may refer to earlier code in this long php file. I did not send the whole file, only the HTML part. /* Printing results in HTML */ /* COMMENTED 2002-05-02 print "<table>\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { print "\t<tr>\n"; foreach ($line as $col_value) { print "\t\t<td>$col_value</td>\n"; } print "\t</tr>\n"; } print "</table>\n"; */ while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { printf(" <div class=\"colorfield\"> <table> <tr><th>DATE</th><th>COMMENTS</th></tr>\n <tr><td>%s</td><td>%s</td></tr> </table> </div> <br /> <br />\n", $row['added']); $row['q40']); } /* Free resultset */ mysql_free_result($result); /* Close the database connection */ mysql_close($link); ?> </body> </html>
--- End Message ---
--- Begin Message ---I will send my whole php file to anybpody willing to help me display this one long answer question. Some previous helpers added some stuff that isn't being used, but I don't know how to get rid of it. Gloria "Gloria L. McMillan" wrote: > Hi, again! > > I did not see my question as yet so I will repost it. > > I have had help writing HTML code to display the results of my PHP--> McSQL actions. > > But when I attempt to show the DATE and q40 (comments) with the HTML code below, > all I see on screen is: ] in the upper left corner. > > URL: http://DakotaCom.net/~glomc/forms/Adj03.html (A poll on part-time faculty) > > Here's the code for the display that is not working... > But the "]" may refer to earlier code in this long php file. > I did not send the whole file, only the HTML part. > > /* Printing results in HTML */ > > /* COMMENTED 2002-05-02 > print "<table>\n"; > while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { > print "\t<tr>\n"; > foreach ($line as $col_value) { > print "\t\t<td>$col_value</td>\n"; > } > print "\t</tr>\n"; > } > print "</table>\n"; > */ > while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { > printf(" > <div class=\"colorfield\"> > <table> > <tr><th>DATE</th><th>COMMENTS</th></tr>\n > > <tr><td>%s</td><td>%s</td></tr> > > </table> > > </div> > <br /> > <br />\n", > $row['added']); > $row['q40']); > > } > > /* Free resultset */ > > mysql_free_result($result); > > /* Close the database connection */ > > mysql_close($link); > > ?> > > </body> > </html>
--- End Message ---
--- Begin Message ---On Fri, 2003-06-06 at 14:32, Gloria L. McMillan wrote: > Hi, again! > > I did not see my question as yet so I will repost it. > > I have had help writing HTML code to display the results of my PHP--> McSQL actions. > > But when I attempt to show the DATE and q40 (comments) with the HTML code below, > all I see on screen is: ] in the upper left corner. You should probably be seeing a parse error...see below. > URL: http://DakotaCom.net/~glomc/forms/Adj03.html (A poll on part-time faculty) > > Here's the code for the display that is not working... > But the "]" may refer to earlier code in this long php file. > I did not send the whole file, only the HTML part. > > /* Printing results in HTML */ > > > /* COMMENTED 2002-05-02 > print "<table>\n"; > while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { > print "\t<tr>\n"; > foreach ($line as $col_value) { > print "\t\t<td>$col_value</td>\n"; > } > print "\t</tr>\n"; > } > print "</table>\n"; > */ > while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { > printf(" > <div class=\"colorfield\"> > <table> > <tr><th>DATE</th><th>COMMENTS</th></tr>\n > > <tr><td>%s</td><td>%s</td></tr> > > </table> > > </div> > <br /> > <br />\n", > $row['added']); > $row['q40']); The ); closes the printf(), but the next line continues on to attempt to add more arguments. You would either need to do this: $row['added'], $row['q40']); ...or, better yet, something like this, so you aren't printing out the whole table for each row in the results: echo " <div class=\"colorfield\"> <table> <tr><th>DATE</th><th>COMMENTS</th></tr>\n "; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo " <tr><td>{$row['time_stamp']}</td><td>{$row['heading']}</td></tr>\n"; } echo " </table> </div> "; Hope this helps, Torben > } > > /* Free resultset */ > > mysql_free_result($result); > > > /* Close the database connection */ > > mysql_close($link); > > ?> > > > </body> > </html> -- Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--- End Message ---
--- Begin Message ---On Fri, 2003-06-06 at 18:45, Lars Torben Wilson wrote: [snip] > while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { > echo " > <tr><td>{$row['time_stamp']}</td><td>{$row['heading']}</td></tr>\n"; > } Whoops...replace 'time_stamp' with 'added' and 'heading' with 'q40', of course. :) Sorry, Torben -- Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--- End Message ---
--- Begin Message ---I know there is a lot of expertise on running web servers in this group. So, I'm going to ask a couple of questions. I am currently a public web server with an iptables firewall. A security consultant has suggested that we buy a separate firewall for the firewall instead of running iptables. He recommended a Symantec VelociRaptor or one of their firewall appliances. Does this sound like good advice? Are there any other models we sould look at? thanks, Luis R. Lebron
--- End Message ---
--- Begin Message ---Hi, I'm currently setting up a form for CC processing. At the moment I am able to send the required flags to authorize the CC transaction, but then I do not know how I go about parsing the returned headers. After processing the transaction the merchant returns either HTTP 200 (ok) along with values or HTTP 400(ERRROR) with a string indicating reason for error. So how would I go about parsing these in my script?
--- End Message ---
--- Begin Message ---chances are, if it's possible it'd be a plugin or script on the PGP homepage. try there. or maybe try http://php.resourceindex.com/ they may have something of use to you.... -Ryan >>> Ben Cheng<[EMAIL PROTECTED]> 06/06/03 08:54AM >>> Any way in PHP to grab form info and then encrypt it with PGP before sending it out as an email? -Ben
--- End Message ---
--- Begin Message ---Hi, again. I got one suggestion but it did not work for displaying the results from a 40 item poll. I only want to display item 40: long answer. My php is cluttered with somebody's select routine that I am not using. Here is that poll: http://DakotaCom.net/~glomc/forms/Adj03.html All I get from the call to the Adj03.php file is the single symbol of: ] I will be happy to exchange help for proofreading since I am a college instructor of writing. Thanks, Gloria McMillan
--- End Message ---
--- Begin Message ---Gloria, Glad to help, but I'd need to see the code that failing. Hugh ----- Original Message ----- From: "Gloria L. McMillan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 06, 2003 4:53 PM Subject: [PHP] Problem Display of data > Hi, again. > > I got one suggestion but it did not work for displaying the results from a 40 item poll. > > I only want to display item 40: long answer. > > My php is cluttered with somebody's select routine that I am not using. > > Here is that poll: http://DakotaCom.net/~glomc/forms/Adj03.html > > All I get from the call to the Adj03.php file is the single symbol of: ] > > I will be happy to exchange help for proofreading since I am a college instructor of > writing. > > Thanks, > > Gloria McMillan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---> I got one suggestion but it did not work for displaying the results from a > 40 item poll. > > I only want to display item 40: long answer. > > My php is cluttered with somebody's select routine that I am not using. > > Here is that poll: http://DakotaCom.net/~glomc/forms/Adj03.html > > All I get from the call to the Adj03.php file is the single symbol of: ] > > I will be happy to exchange help for proofreading since I am a college > instructor of > writing. I have no idea what you're talking about. Where is this ] character? Where is your PHP code? Why are you giving us a link to an HTML file that when submitted does nothing? A little help here... ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
--- End Message ---