Re: [PHP] Re: Pirate PHP books online?
There is a very very important difference. Stealing/theft is a criminal offence. Copyright infringement is not. For you to be prosecuted for copyright infringement the injured party must bring a civil case. This is a fundamental difference. The reason everyone thinks the terms theft and stealing cover it is because, as I've previously asserted, bodies like the MPAA and RIAA keep referring to it as such. Just because they do that doesn't make it any more accurate. -Stut Although on one level, I say we go with it. I'd love to see those executives at Sony who authorized the rootkits thrown in the slammer for 'breaking-and-entering' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Larry Garfield wrote: On Wednesday 18 July 2007, tedd wrote: And just because they do, doesn't make it any less accurate either. I don't care if Hitler agreed with me, there is a fundamental wrongful act of taking something that is not yours regardless of what you, and others, may call it. First "Hitler and the Nazis"[1] reference. You lose! Thanks for playing. :-) [1] http://en.wikipedia.org/wiki/Godwin's_Law Dang I didn't know that existed, thanks for the reference now I have something for all my other discussions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie Question
tedd wrote: At 6:26 PM -0400 6/23/06, Tom Ray [Lists] wrote: I've run into something rather odd with cookies today. I'm working with this admin section on a site and I'm setting a cookie that is supposed to be good for one hour. So in the cookie I have time()+3600 and all was well or that was until someone fired up IE. It seems that IE refused to set the cookie. After much swearing at IE, I found that if I set it to time()+7200 the cookie would be set. Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie said it would expire at 8PM which is correct. However, when I logged in via IE at 6PM it said the cookie would expire at 23:00 hours (11PM for those who don't know)...so my question is...why is this happening and why does IE do this? I checked in Opera, Mozilla and Netscape and they all work the same as Firefox. You answered the question yourself, you're testing IE. It sounds like M$ is trying to make time to adapt to their standard. But, you're not alone -- try Google with "IE cookies expiration" tedd BTW, I have a question: which is the preferred way to handle variables on the client side: cookies or sessions? Or are there situations where one should be used and the other should be used in these other situations. -- Online library -- http://pueblonative.110mb.com 126 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading...
BBC wrote: "Fatal error: call to a member function an o non object in /url/data.php on line 34" and the syntax is in line 34, so what can I do..? Could you point out which line is line 34? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
Jay Blanchard wrote: [snip] I am going to do some thinking (typing) out loud here because I need to come up with a solution to double-clicking on a form button issue. [/snip] Isn't there a javascript method that you could use to accomplish the same thing? Either that, or on the first click, you could disable that button. -- Online library -- http://pueblonative.110mb.com 138 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
Jay Blanchard wrote: [snip] JavaScript can't be used for such things, or at least it can't be relied upon. What if the user has disabled JavaScript? Or what if the user has specifically disabled the JavaScript behaviour you are relying on? [/snip] Egg Zachary. That was why I wanted a PHP method. Since the SESSION data is set for the activation receipt I do not have to query the database again, save for the initial query to check and see if the data exists. You're still doing two round-trips to the server, which seems very inefficent to regulate user behavior. -- Online library -- http://pueblonative.110mb.com 138 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple "if()" statements
Larry Garfield wrote: switch is fine if your elseif comparisons are equality based. If they're not equality based, then they don't map to switch as well. In other words, if you look at a logical ladder as the roots of the tree, as long as each root has the same number of forks (say each fork ends only one way), your fine with a switch. If you have one, however, that has only one condition, and another that has two, then you need an if...elseif logic tree. -- Online library -- http://pueblonative.110mb.com 138 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Functions
Two things: 1. You're not returning anything from the function. 2. You're not even using the function. [EMAIL PROTECTED] wrote: I am trying to create a function to clean up variables that are user inputted from a form. I am not getting this script to work. Can anyone help. ---Start Script--- function cleaner($var) { trim(strip_tags(ucfirst(addslashes($var; } $var = "abc's"; echo $var; ---End Script--- When I run the above script it produces nothing. Instead of a result of "Abc\'s". -- Online library -- http://pueblonative.110mb.com 138 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class ADODB - Method GenID() in MySQL
Renne Rocha wrote: Hello, I am using the ADODB class to connect to a MySQL server. I am trying to generate an ID with the method GenID(), but when I tried this: $id = $db->GenID('table'); The value of $id is equal to zero. I know that MySQL doesn't use sequences like PostgreSQL does (I've used this code in a PostgreSQL project), but in the documentation of ADODB I saw that it is possible to use it. Is there any trick about how to make it work? Thanks. Okay, I'd have to ask at this point what are you using the ID for? If you're generating it for an insert, just put null on the primary key if it's auto-increment and MySQL will do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class ADODB - Method GenID() in MySQL
Wouldn't this: $id = mysql_insert_id(); $query = "UPDATE tablename SET id=" . ($id + 1); $result = mysql_query($query); Be a little simpler. But like I said, I'm confused over the need for this in the first place, seeing as how an "auto_incremented" primary key is self-descriptive. or are you saving this somewhere else in the DB? On 7/19/06, chris smith <[EMAIL PROTECTED]> wrote: On 7/19/06, Renne Rocha <[EMAIL PROTECTED]> wrote: > Hello, > > I am using the ADODB class to connect to a MySQL server. I am trying > to generate an ID with the method GenID(), but when I tried this: > > $id = $db->GenID('table'); > > The value of $id is equal to zero. I know that MySQL doesn't use > sequences like PostgreSQL does (I've used this code in a PostgreSQL > project), but in the documentation of ADODB I saw that it is possible > to use it. Is there any trick about how to make it work? You'll need to insert a value into the table first, then you can do: $query = "UPDATE tablename SET id=LAST_INSERT_ID(id+1)"; $result = mysql_query($query); $id = mysql_insert_id(); This is in the mysql docs somewhere... -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- "I'm American, fatboy. What's your excuse?"
Re: [PHP] Basic PHP knowledge test
John Nichel wrote: What does $_POST['x'] mean? What does $ in front of a string of chars without quotes mean? That does register globals mean? Is it possible to run php as a cgi script? When it is necessary to use 'var' in php code? I would probably agree that a problem would be better. Here's an idea, have one of your HR people take some existing code and do something to it to give it a bug, then have the guy fix it, and see how close he comes to what's there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Difference between 2 time entries
|Found this on the PHP web site, you can add the conversions as the first lines in the functions. function callDuration($dateTimeBegin,$dateTimeEnd) { $dif=$dateTimeEnd - $dateTimeBegin; $hours = floor($dif / 3600); $temp_remainder = $dif - ($hours * 3600); $minutes = floor($temp_remainder / 60); $temp_remainder = $temp_remainder - ($minutes * 60); $seconds = $temp_remainder; // leading zero's - not bothered about hours $min_lead=':'; if($minutes <=9) $min_lead .= '0'; $sec_lead=':'; if($seconds <=9) $sec_lead .= '0'; // difference/duration returned as Hours:Mins:Secs e.g. 01:29:32 return $hours.$min_lead.$minutes.$sec_lead.$seconds; } | Chris Grigor wrote: Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between these 2 times?? I have looked at using the following but am not to sure function timeDiff($firstTime,$lastTime) { // convert to unix timestamps $firstTime=strtotime($firstTime); $lastTime=strtotime($lastTime); // perform subtraction to get the difference (in seconds) between times $timeDiff=$lastTime-$firstTime; // return the difference return $timeDiff; } //Usage : echo timeDiff("$start","$finish"); Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT promotion & candidates needed
Director, nah. Wait until you are promoted to Dictator of IT. That's where the real power begins. BWAHAHAHAHAH...cough. Enough maniacal laughing for now, back to work. -Original Message- From: Ligaya Turmelle [mailto:[EMAIL PROTECTED] Sent: Sunday, August 06, 2006 7:16 PM To: Jay Blanchard Cc: [php] PHP General List Subject: Re: [PHP] OT promotion & candidates needed Jay Blanchard wrote: > Good news/kinda' bad news (but not really); I am proud to say that I > have been promoted to Director of IT in my little corner of the world. Congrats on the promotion - Love the pretty title. Does it come with letters even? ;) -- life is a game... so have fun. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: non-text data
Gd, BTW, came into this late, have we gotten the old "store your images in the filesystem and save the file name in the database" argument yet? -Original Message- From: Dave Shariff Yadallee - System Administrator a.k.a. The Root of the Problem [mailto:[EMAIL PROTECTED] Sent: Sunday, August 13, 2006 10:21 PM To: Chris Cc: mysql@lists.mysql.com Subject: Re: non-text data On Mon, Aug 14, 2006 at 10:42:50AM +1000, Chris wrote: > Dave Shariff Yadallee - System Administrator a.k.a. The Root of the > Problem wrote: > >I use SELECT all from * ... and one row is a gif. > > > >How do I get that gif to appear as a gif and not text? > > In your connecting programming language. > > Mysql doesn't know or care whether it's a gif, pdf, word doc or > anything else. > > Whatever programming language you are using to connect to mysql and > fetch the data will be able to convert that binary data and display an > image. > PHP? > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] > > > -- > This message has been scanned for viruses and dangerous content by > MailScanner, and is believed to be clean. > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: non-text data
Depends on how pugnacious I'm feeling, awscrewit, you go for it. -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Sunday, August 13, 2006 10:41 PM To: John Meyer Cc: 'Dave Shariff Yadallee - System Administrator a.k.a. The Root of the Problem'; '[php] PHP General List' Subject: Re: [PHP] RE: non-text data John Meyer wrote: > Gd, > BTW, came into this late, have we gotten the old "store your images in > the filesystem and save the file name in the database" argument yet? Nope, haven't done that one yet, do you want to start it off or shall I? ;) -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] readdir() question
I have a script to list the files in a directory: And all I am getting are "1"s. I think I'm doing it right, what is the disconnect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] readdir() question
Richard Lynch wrote: > On Tue, August 15, 2006 12:04 pm, John Meyer wrote: >> I have a script to list the files in a directory: >> >> >> > $open = opendir("."); >> while ($file = readdir($open) != false) { >> ?> >> >> > } >> ?> >> >> >> >> And all I am getting are "1"s. I think I'm doing it right, what is >> the >> disconnect? > > It's not a readdir question. It's an Order of Operations question. > :-) > > $file = readdir($open) != false > > You probably believe that PHP is going to magically "know" that you > want this bit: > readdir($open) != false > to be done "first" > No, and I fixed that. What I'm wondering about is why this false !== ($dirhandle = opendir('letters')) works, but this ($dirhandle = opendir('letters')) != false does not -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] readdir() question
Richard Lynch wrote: > Do you really mean opendir() or do you mean readdir() ??? readdir(). The point is why do you need to put it as !== vs. != -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trying to create an encryption method
I'm trying to create this encryption method for puzzles (nothing super secret, just those cryptograms), but this seems to time out, can anybody point out what I'm doing wrong here: for ($i=1;$i<=26;$i++) { $normalAlphabet[$i] = chr($i); } //now, to shuffle for ($j=1;$j<=26;$j++) { do { $k = rand(1,26); } while ($k == $j || (strlen(trim($normalAlphabet[$k])) === 0)); $arEncryptedAlphabet[$j] = $normalAlphabet[$k]; $normalAlphabet[$k] = ""; } $arNormalString = str_split($normalzedString); $encryptedString = ""; for ($i=0;$i=65 && ord($arNormalString[$i])<=90) { $encryptedString = $encryptedString . $arEncryptedAlphabet[ord($arNormalString[$i]) - 64]; } else { $encryptedString = $encryptedString . $arNormalString[$i]; } } return $encryptedString; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to create an encryption method
Modified the script, and that's what I needed, thanks. Jochem Maas wrote: > $secret = "HalloWorld"; > $encoded = ""; > > $a = $b = range("a","z"); > shuffle($b); > $c = array_combine($a, $b); > > foreach (str_split(strtolower($secret)) as $v) > $encoded .= isset($c[ $v ]) ? $c[ $v ] : $v; > > var_dump($c, $secret, $encoded); > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to create an encryption method
Adapted something from this list and that worked, thanks for the help. Richard Lynch wrote: > On Sat, November 4, 2006 10:15 pm, John Meyer wrote: > >> I'm trying to create this encryption method for puzzles (nothing super >> secret, just those cryptograms), but this seems to time out, can >> anybody >> point out what I'm doing wrong here: >> > > http://php.net/shuffle > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do you do the ? mark after a filename
the ? is a delimiter between the url and the get variables, which are set by the script itself, either through forms or by scripts. Thomas Bonham wrote: > Hi All, > > I keep seeing the ? mark after many file names index.php?id=234. > > So what I would like to know is how do you make them. I have heard that > they can make a programs life sampler when doing somethings with a > database. > > Thank you, > > Thomas > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] one click - two actions?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Not to be rude or anything, but if you want to do two things with one click, wouldn't the javascript list be the place you would want to go? Mel wrote: > Could someone please help me figure out how to show some description > (where applicable) at the same time as I show an image, when I click on > a link, without repeating the entire query? > The image and the description are both in the same table in my database. > > I now show the image when I click on the link which is good, but the > description stays on at all times instead of appearing only when active. > > http://www.squareinch.net/single_page.php > > This is the code I have for the image area: > /* query 1 from client */ > $query = "SELECT * FROM client > where status='active' or status='old' > order by companyName"; > > $result = mysql_query($query) > or die ("Couldn't execute query"); > > while ($aaa = mysql_fetch_array($result,MYSQL_ASSOC)) > { > echo "{$aaa['companyName']} class='navArrow'> > \n"; > > /* query 2 from job */ > $query = "SELECT * FROM job > WHERE companyId='{$aaa['companyId']}'"; > $result2 = mysql_query($query) > or die ("Couldn't execute query2"); > > foreach($aaa as $jobType) > { > $bbb = mysql_fetch_array($result2,MYSQL_ASSOC); > echo " href='single_page.php?art=".$bbb['pix']."'>{$bbb['jobType']}\n"; > } > echo ""; > } > ?> > > > > > > > > > This is the code I have for the description area: > > /* query 1 from client */ > $query = "SELECT * FROM client > where status='active' or status='old' > order by companyName"; > > $result = mysql_query($query) > or die ("Couldn't execute query"); > > while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) > { > > /* query 2 from job */ > $query = "SELECT * FROM job > WHERE companyId='{$row['companyId']}'"; > $result2 = mysql_query($query) > or die ("Couldn't execute query2"); > $url = mysql_query($result2); > > foreach($row as $url) > { > $row = mysql_fetch_array($result2,MYSQL_ASSOC); > if ("url={$row['url']}") > echo " href='{$row['url']}'>{$row['web']}"; > } > > echo ""; > } > ?> > > > -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFFWGE2bHd4gglFmoARAnNWAJ0fs+NHm5MbNwDpm3E7Flu3giU+LQCgkF7O uCu6zhUFfviNC+aaxpNy+Vg= =NQVC -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expressions
Is there a way to make a regular expression to match on a particular way the letters are arranged? For instance, if you had a word: THAT It could match on any word in the dictionary that had the form: 1231 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expressions
Darrell Brogdon wrote: > Can you elaborate a little? Do you mean that you want certain letters > to have a numeric representation? > > -D no, what I was meaning was in relationship to each other, whether they are the same letter or not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expressions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, what I am referring to is cryptograms, where one letter is substituted for another. I would like to be able to list all the words in a dictionary that have that arrangement of their letters. Later on, I would like to be able to do an entire cryptogram that way. Dave Goodchild wrote: > Is there a way to make a regular expression to match on a particular way > the letters are arranged? For instance, if you had a word: > > THAT > > > It could match on any word in the dictionary that had the form: > > 1231 > > preg_,match('/^(\w){1}\w\w\1$/'); > > would match the above on a single line for example, where \1 refers to > the pattern captured in parentheses at the start. > > Try and be a little more specific in what you want to match, as regex is > hard enough to start with - a detailed and clear description will elicit > corresponding responses. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFFWwXkbHd4gglFmoARAooyAJ0S8R3JkLApczGxBA9FrOQQMZSGvwCgmNUX C9idJue2LWK1EL6gO6qttjg= =IqlT -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Coding...
I'd pick up a book "Web Database Applications with PHP and MySQL", otherwise known as the Platypus Book, and use that. That will teach you a lot about logins, sessions, as well as using MySQL and PHP together. As far as the database name goes, that has nothing to do with the PHP file name. Jeff wrote: > I am pretty new with PHP, but what I've learned in the last 3 weeks is > pretty good I think so far! > > What I'm looking to do is create a login script, and have people being > able to login. > > Now, I have pulled scripts from sites, and everything is working okay. > But the problem I have with pulling scripts from other sites, is that > the mysql databases are all different. > > How can I import from one database into the other, so basically all the > databases are merged into one main? > > I also know that each PHP file has to be re-done and look for the new > database name, for instance if it was user_name, and the default (Main) > database is username .. That I Have to rename all the php files that > have user_name to simply username. > > If anyone is willing to help out with the project I'm working on with > another programmer? Hopefully being very cost effective .. or free :) :) > > Thanks, > > Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading MS Excel?
On a side note, but going on the basis that the users are uploading .xls files and don't understand how to convert. Would it be better to use php's routines or to automate excel, convert it inside there, and then use the result? Leonard Burton wrote: > On 12/28/06, Jiffy Slides Leonard Burton <[EMAIL PROTECTED]> wrote: >> HI Will, >> >> > Is it possible to read Excel files and store the info to DB? If so how? >> >> It is best (well depending on the application) to save the files as >> .csv and then use fgetcsv. it will allow you to parse each line and >> cell in the file and then go from there. >> >> Take Care, >> >> -- >> Leonard Burton, N9URK >> [EMAIL PROTECTED] >> >> "The prolonged evacuation would have dramatically affected the >> survivability of the occupants." >> > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hello
Edward wrote: > How do I create a php document so that people in my nonprofit can vote > on issues online through the organization's website? > > Thanks, > > Edward > Start with PHP, add MySQL or your database of choice, mix and prepare. Serves 500+. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Truncate words in multiple paragraphs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Verdon Vaillancourt wrote: > Hi :) > > I am using the following function (that I found in the user comments on > php.net manual) for trimming the number of words accepted via a form field > > // Truncation is by word limit, not character limit. So if you limit > // to 255, then it will cut off a text item to 255 words, not 255 > characters > function trim_text ($string, $truncation=250) { > $string = preg_split("/\s+/",$string,($truncation+1)); > unset($string[(sizeof($string)-1)]); > return implode(' ',$string); > } How about $string = nl2br($string); $string = trim_text($string); $string = str_replace("","\n",$string); -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD45Hzj60GAoLuoDkRAjSqAKCxvGlJmSCVHozWBDjjZnKMEZOfSwCfenVj lRSChtsMRqRnOYdZpk5YQ0c= =Dnly -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux distributions and tools for Linux/Apache/PHP/MySQL dev
Chris Lott wrote: > Thanks for the advice-- I've run Linux without a GUI for a long time, > so I'm quite familiar with hand compilations-- but I always wondered > if I was just missing something with packaging systems that it seemed > to REQUIRE hand-compilation to get a workable development LAMP system. > Anytime I tried using packages some need seemed to force me back to > doing it by hand. > > So I guess my more specific question would have been: Are there any > distributions that actually TARGET developers and I Was curious about > desktop tools. I own Zend but tend to use Homesite and Emacs in > regular doses. Guess I will probably stick with Emacs and use Zend > more. I know enough Vim to survive, but it just isn't "me" :) > > c I've found that Quanta is pretty good for my taste. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max unique number
Philip Hallstrom wrote: >> [snip] >> How do i get a unique max number from a mysql table column? >> [/snip] >> >> SELECT MAX(number) FROM table LIMIT 1; > > That might not be unique though... I'm wondering if the original poster > is looking for AUTO_INCREMENT (ie. sequences) to ensure a unique id to > use for insertion...? > mysql_insert_id() should do the trick for an automatically incremented sequence. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where php at?
tedd wrote: > Hi: > > Related to my cron problem -- where do you get the path to php? My > phpinfo() says: > > http://www.xn--ovg.com/info.php > > reports it as: > > /usr/lib/php:/usr/local/lib/php > If you're on a linux box, have you tried "which php"? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Amazon WSDL
Hey, is it possible to use the Amazon WSDL within PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amazon WSDL
Richard Collyer wrote: > John Meyer wrote: >> Hey, is it possible to use the Amazon WSDL within PHP? >> > > Lookie what the first google entry for "Amazon WSDL php" was: > > http://www.onlamp.com/pub/a/php/2003/07/03/php_amazon_soap.html > > Richard Nice, now I need to navigate the bloody Amazon web services. Is it just me, or does it look like, just by browsing Amazon itself, you have to use Alexis to do web queries. Specifically, I'm trying to find out how to query using an ISDN. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Standard style of writing your code
Should we really have this arguement about a "standard" way of writing the code? This is PHP, an open-source project. Isn't that like asking existentialists to adopt a uniform code of conduct? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Configuring the error suppression
Is there anyway to make PHP normally suppress errors, but a piece of code that would show errors on a particular page? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Configuring the error suppression
IG wrote: John Meyer wrote: Is there anyway to make PHP normally suppress errors, but a piece of code that would show errors on a particular page? Sorry forgot to mention how you show errors on a particular page- you would use- ini_set('display_errors', '1'); But are you sure you want to do this? Showing errors to your users is NOT a good idea as it can open your server up to all kinds of security issues. Why not use the log parser idea that I said in my last mail? I didn't get that last e-mail, and I'm on a design web server, not an actual production server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Exceptions in PHP
I have the following script: try { $conn = mysql_connect("localhost","webuser","testme") or die("Could not connect"); mysql_select_db("bookcollection",$conn) or die("Could not select database"); //first, check to see if there is an author if ($_POST["neworoldauthor"] == "new") { $sql = "SELECT * FROM AUTHORS WHERE FirstName=\"" . $_POST["authorfname"] . "\" AND LastName=\"" . $_POST["authorlname"] . "\""; $retval = mysql_query($sql); if (mysql_num_rows($retval) == 0) { $sql = "INSERT INTO AUTHORS(FirstName, LastName) VALUES(\"" . $_POST["authorfname"] . "\",\"" . $_POST["authorlname"] . "\")"; mysql_query($sql); $authorID = mysql_insert_id(); } else { $row = mysql_fetch_array($retval,MYSQL_ASSOC); $authorID = $row["AuthorID"]; } } else { // it's an old author $authorID = $_POST["authors"]; } //now, check titles $sql = "SELECT * FROM TITLES WHERE TITLE_TITLE=\"" . $_POST["title"] . "\""; $retval = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($retval) == 0) { $sql = "INSERT INTO TITLES(TITLE_TITLE) VALUES(\"" . $_POST["title"] . "\")"; mysql_query($sql); $titleID = mysql_insert_id(); } else { $row = mysql_fetch_array($retval,MYSQL_ASSOC); $titleID = $row["TITLE_ID"]; } //now, insert the book $sql = "INSERT INTO BOOKS(CopyrightYear,CoverType,DatePurchased,EditionNumber,ISBNNumber,Notes,Pages,Publisher,LOCNumber) VALUES(\"" . $_POST["copyrightyear"] . "\",\"" . $_POST["covertype"] . "\",\"" . $_POST["datepurchased"] . "\"," . $_POST["editionnumber"] . ",\"" . $_POST["isbn"] . "\",\"" . addslashes($_POST["notes"]) . "\"," . (isset($_POST["numberofpages"])?$_POST["numberofpages"]:0) . ",\"" . $_POST["publisher"] . "\",\"" . $_POST["locnumber"] . "\")"; mysql_query($sql); $bookID = mysql_insert_id(); $sql = "INSERT INTO BOOK_TITLE(BOOK_ID,TITLE_ID) VALUES($bookID,$titleID)"; mysql_query($sql); $sql = "INSERT INTO AUTHOR_TITLE(AUTHOR_ID, TITLE_ID) VALUES($authorID,$titleID)"; mysql_query($sql); $sql = "INSERT INTO TITLE_GENRE(TITLE_ID,GENRE_ID) VALUES($titleID," . $_POST["genre"] . ")"; mysql_query($sql); } catch(Exception $e) { echo $e->GetMessage(); mysql_query("ROLLBACK"); } ?> I'm trying to get to the point where if the query doesn't execute, it pops out a message and rollsback any possible results. It doesn't. What's wrong on this script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Narorwed down my problem to one statement:
$sql = "INSERT INTO BOOKS(CopyrightYear,CoverType,DatePurchased,EditionNumber,ISBNNumber,Notes,Pages,Publisher,LOCNumber) VALUES(\"" . $_POST["copyrightyear"] . "\",\"" . $_POST["covertype"] . "\",\"" . $_POST["datepurchased"] . "\"," . $_POST["editionnumber"] . ",\"" . $_POST["isbn"] . "\",\"" . addslashes($_POST["notes"]) . "\"," . (isset($_POST["numberofpages"])?$_POST["numberofpages"]:0) . ",\"" . $_POST["publisher"] . "\",\"" . $_POST["locnumber"] . "\")"; Okay, when $_POST["notes"] contains quotes, it seems to break the series, ie returns an error at that point of the SQL statement, even with addslashes(), am I doing something wrong there? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO purism sucks - this is a rant for anyone who is allergic to that kind of thing...
John Nichel wrote: Do what I do, and don't do OO. ;) In other words, do what works, realizing that 99 percent of the time that you're doing indivdual sites, and ignore dogma? Hmm, what a concept! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML form
Martin Marques wrote: Sorry for the OT, but this is PHP output anyway :-) I have a bunch of code to input and modify data through an HTML form. When I modify the options, some are in text, others in textarea, and some are in select options. Now wat I did is make the current value be the selected one, but my browser doesn't seem to get it right. Here is the HTML output: Profesor titular Profesor asociado Profesor adjunto Jefe de trabajos pracáá½ticos Ayudante de cat½edra Ayudante alumno Pasante Colaborador externo But the browser doesn't show the option "Ayudante de catedra" selected by default. Am I so blind that I can't see the problem or those my firefox have a problem? Works fine on my firefox, by the way. What version of Firefox are you using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO purism sucks - this is a rant for anyone who is allergic to that kind of thing...
Robert Cummings wrote: On Thu, 2006-06-01 at 19:14, Jochem Maas wrote: Robert Cummings wrote: Ahh yes, I do like the elegance of prototypes too. They're a different kind of beast, but a very flexible one. the more I get in it the pretty it gets - javascript doesn't just give you a revolver to shoot yourself with it gives you a Doom3 chainsaw and it's shiny :-) Oh yeah... *rubs the gash in his foot*. I do firmly believe though, that if you have an iota of intelligence, then shooting yourself in the foot will lead to a strong lesson learned :) Protecting idiots from themselves just creates a problem of lots of idiots needing protection from themselves -- that should be a human resources issue, not a language issue IMHO :) Cheers, Rob. What was that joke that I heard. While regular programming gives you enough rope to hang yourself, OO lets you design the tree object. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If value is odd or not
Steven Osborn wrote: $odd = array("1","3","5","7","9"); if(inarray(substr($var,strlen($var)-1,1),$od) { //haha } else { //even } How about this if ($var % 2 == 0) { //it's even } else { //it's odd } -- Online library -- http://pueblonative.110mb.com 126 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not able to load the extensions
Apache 2.2 PHP 5.2.6 (as a module) Windows Relevant parts of php.ini ; Directory in which the loadable extensions (modules) reside. extension_dir = I:\php\ext extension=I:\php\ext\php_mssql.dll extension=I:\php\ext\php_mysql.dll Note: I did try it with just the name ("php_mysql.dll") but it doesn't seem to work either way And httpd.conf: LoadModule php5_module I:\php\php5apache2_2.dll AddType application/x-httpd-php .php PHPIniDir C:\WINDOWS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF documentation
Hi, does the PHP document come in a PDF form? -- Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar? Fletch: I don't know. I don't have any. Dr. Joseph Dolan: No children? Fletch: No, elephant books. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Re: Inserting a php file into a mysql database
On Monday 26 December 2005 8:26 am, El Bekko wrote: > > Use file_get_contents() I'd say... but you'll have the problem the file > executes :S Which is why I told him just to treat the php file like a text file (which is what it really is) and use fopen to grab the file, read its contents into a string, and insert that into the database. -- Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar? Fletch: I don't know. I don't have any. Dr. Joseph Dolan: No children? Fletch: No, elephant books. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] load testing tools
On Tuesday 27 December 2005 12:45 pm, Jared Williams wrote: > > Anyone have any opinions or suggestions on cheap/free load > > testing tools for dynamic sites? > > Microsoft WAST > > http://www.microsoft.com/technet/archive/itsolutions/intranet/downloads/web >stres.mspx > > Jared You violated one of the Ten Open Source Commandments. Thou shalt not take the name of Microsoft in good! -- Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar? Fletch: I don't know. I don't have any. Dr. Joseph Dolan: No children? Fletch: No, elephant books. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating a new file (apologies to anybody on php-db who got this)
On Tuesday 27 December 2005 4:07 pm, James Lumb wrote: > Hi, > Does anyway know whether there is a PHP function which creates a new file? > i know there is fwrite, fopen etc but is there any way of creating a new > file? Thanks, > James > fopen() will create a new file if you open it for writing and it does not exist, as per these modes: 'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. 'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. 'a' Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it. 'a+' Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. 'x' Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files. 'x+' Create and open for reading and writing; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files. -- Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar? Fletch: I don't know. I don't have any. Dr. Joseph Dolan: No children? Fletch: No, elephant books. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] To the person who told me about HTMLdoc
Do I run it as htmldoc -f pdfmanual.pdf --book in that directory with the HTML files, or what? And secondly, do I use the multiple pages or the continuous one page? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Graphically displayed number to confirm user is a human
Duncan Hill wrote: On Wednesday 04 January 2006 16:56, Dave M G wrote: First, is there a term for these kinds of images, or that kind of verification system? What would be the best search terms to look for source scripts? captcha I've been looking for this term for a while as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] input validation?
Stut wrote: Ok, you're clearly missing my point and while I don't want this to degrade into the usual pissing contest I do feel I need to clarify what I was saying. I completely agree that in this case Javascript should be used to provide the user with feedback as to how close to the limit they are. However, in your post you described the solution as either Javascript *or* PHP when the best solution is both. What I was pointing out is that while Javascript is a better solution from a usability point of view, not doing the validation with PHP is dangerous regardless of whether the length is validated using Javascript or not. I certainly don't believe that PHP is the "total solution for most situations", but when it comes to input validation you *need* to do validation on the server-side regardless of what validation you do with Javascript since you have no control over whether the Javascript gets executed. This sounds almost like the old DB vs. Application logic debate I see on several mailing lists; whether you should store more logic in the DB Server through triggers or through application logic. My point on this is that it boils down to how important that data is. If it's somebody's comments on their blog or on a post, I'd just leave it on the application _or_ trim it down to the 300 characters and input it in. bank transactions, I'd have so many triggers going it would be unreal. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Perl script passing variables to a PHP script
Hi, If I have a perl script to rip off the mp3 tag information, can I have that script then pass them into the PHP file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Perl script passing variables to a PHP script
David Dorward wrote: > John Meyer wrote: > >> Hi, If I have a perl script to rip off the mp3 tag information, can I >> have that script then pass them into the PHP file? > > PHP::Interpreter looks like it will do the job. > http://www.annocpan.org/~GSCHLOSS/PHP-Interpreter-1.0.1/lib/PHP/Interpreter.pm > Thanks, I'll be looking into that. I also went to phpclasses.org and found something that may be useful as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retrieve The Last Record in a Table
Or you could retrieve that information prior to inserting the login information, say, as soon as they type in their login name, store that, then present it. From: Jason Davidson <[EMAIL PROTECTED]> To: Harlequin <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: [PHP] Retrieve The Last Record in a Table Date: Tue, 27 Jul 2004 08:17:19 -0700 You could LIMIT 2, using the order on a column, the first record would be last, the second would be second last. Kinda dirty way to do it, however, off hand, cant think of an alternative, ill post it if i do think of one though. Jason On Tue, 27 Jul 2004 09:59:21 +0100, Harlequin <[EMAIL PROTECTED]> wrote: > Thanks for that Jason > > Any suggestions on how I would retrieve the next to last entry...? The last > time prior to this session that the user logged in...? > > -- > - > Michael Mason > Arras People > www.arraspeople.co.uk > - > "Jason Davidson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > as mentioned already, use a column in the table to order the query and > > then use LIMIT to only to return one record. Best columns to use would > > be an auto_increment or a datetime field type. > > > > Jason > > > > On Mon, 26 Jul 2004 18:27:25 +0100, Harlequin > > <[EMAIL PROTECTED]> wrote: > > > > > > > > > I would like to retrieve the last entry in a login table and present > that to > > > a user so they can verify the date we have when they last logged in. > > > > > > Is this possible...? > > > > > > -- > > > - > > > Michael Mason > > > Arras People > > > www.arraspeople.co.uk > > > - > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date difference
Hello, Is there a function to determine the difference between two dates? I am asking so I can do some date verification for COPA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql connection question
Hi, For a long time, on all of my mysql pages, I've done something like this $conn = mysql_connect($server,$username,$password) or die("Could not connect") mysql_select_db($db); I've finally put that into its own script file, moved it to my include files, and simply included it whereever I needed a connection. My question is, could this get me into trouble if multiple people access the database at the same time? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php