<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>DiigIT Top Articles</title>
<description>DiigIT</description>
<link>http://www.diigit.com/</link>
<lastBuildDate>Thu, 09 Jul 2009 23:52:12 PDT</lastBuildDate>
<generator>DiigIT.com</generator>
<copyright>Copyright 2005-08, DiigIT</copyright>
<language>en</language>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/DiigitTopArticles" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Updating DB</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/c26KQmw8zIQ/having-problems-updating-db.html</link>
      <description>ltpgtIm getting an error in my syntax Ive looked over my code multiple times but its just not happening Can anyone offer any adviceltbr gtltbr gtvar  floorPOSTvarltbr gtdisctitle  trimPOSTdisctitleltbr gtstudio  trimPOSTstudioltbr gtcountry  trimPOSTcountryltbr gtregion  trimPOSTregionltbr gtrelease  trimPOSTreleaseltbr gtnodiscs  trimPOSTnodiscsltbr gtupc  trimPOSTupcltbr gtltbr gtdisctitle  addslashesdisctitleltbr gtstudio  addslashesstudioltbr gtcountry  addslashescountryltbr gtltbr gtquery  ampquotUPDATE discsetltbr gtSET disctitle  disctitleltbr gtstudio  studioltbr gtcountry  countryltbr gtregion  regionltbr gtrelease  releaseltbr gtnodiscs  nodiscsltbr gtupc  upcltbr gtdaterevised  updatedltbr gtWHERE discsetid  varampquotltbr gtresult  mysqlqueryquery or diemysqlerrorltpgtltpgtThank youltbr gtltpgt  ltpgtHelloltpgtltpgtIt would be much easier if you told us the error message and line number Then we can just paste the code into our editors and see the problem without having to upload it to a server for testingltbr gtltbr gtAnyway just a guess  look at your line in the query ltbr gtnodiscs  nodiscsltbr gtShoud this be ltbr gtnodiscs  nodiscs  ltbr gtltbr gtAnd this ltbr gtWHERE discsetid  varampquotltbr gtltbr gtHope this helpsltpgt ltpgtHere is the error code that Im getting Unfortunately Ive added the  ltbr gtaround nodiscsltbr gtand it is still giving me the same errorltbr gtltbr gtYou have an error in your SQL syntax check the manual that corresponds to yourltbr gtMySQLltbr gtserver version for the right syntax to use near release  20080316 nodiscsltbr gt 2 upcltbr gt 0908877661234 daterevi at line 6ltbr gtltbr gtAny ideasltpgt ltpgtChange the ampquotor dieampquot to this below and rerun and send us the outputltbr gtor dieampquotquerynampquotmysqlerrorltpgt ltpgtThis is what it says when I made the change to the codeltbr gtltbr gtUPDATE discset SET disctitle  General Release studio  Sony Picturesltbr gtcountry  USAltbr gtregion  A release  20080316 nodiscs  2 upc  0908877661234ltbr gtdaterevisedltbr gt 20080321 201918 WHERE discsetid  100000000 You have an error in yourltbr gtSQLltbr gtsyntax check the manual that corresponds to your MySQL server version for theltbr gtrightltbr gtsyntax to use near release  20080316 nodiscs  2 upc ltbr gt0908877661234ltbr gtdatere at line 6ltbr gtltbr gtIts either region or release The A shouldnt be a problem It looks likeltbr gtits the date Why would that be giving problemsltbr gtltpgt ltpgtIt is likely a case where ampquotreleaseampquot is a MySQL keyword whether used or not Try placing it in back ticks often on the keyboard in the upper left on theltbr gtsame key as the tildeltbr gtltbr gtrelease  valueltbr gtltbr gtBackticks around the field name and single quotes around the valueltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yfeVRSxuN6WIVquCcCnOfPraPZY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yfeVRSxuN6WIVquCcCnOfPraPZY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yfeVRSxuN6WIVquCcCnOfPraPZY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yfeVRSxuN6WIVquCcCnOfPraPZY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/c26KQmw8zIQ" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:32:07 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/having-problems-updating-db.html</feedburner:origLink></item>

<item>
      <title>Configurable php code</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/TtKMWSvAUp8/configurable-php-code.html</link>
      <description>ltpgtI think I have a ampquotc99shampquot totally configurable takeoveryourserver php codeltbr gtltbr gtIve been sitting on this for a while now wondering what to do with it as its far too complicated for me to understandltbr gtltbr gtA while ago I was experimenting and left a php file writable but luckily not executable Within a hour it had a massive 197 KB of php code in itltbr gtltpgtltpgtthanksltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EEiwFdenbjCTJneK_JVP6h3XU1M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EEiwFdenbjCTJneK_JVP6h3XU1M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EEiwFdenbjCTJneK_JVP6h3XU1M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EEiwFdenbjCTJneK_JVP6h3XU1M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/TtKMWSvAUp8" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:27:41 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/configurable-php-code.html</feedburner:origLink></item>

<item>
      <title>404 for FF and Opera</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/_A7ihc2M8xM/404-ff-opera.html</link>
      <description>ltpgtIs there a way to fake a 404 in FF and Operaltbr gtheaderHTTP10 404 Not Found works in IE but not in the othersltbr gtltbr gtThe only way Ive tried is to copy FFs 404 error message and stick it after the header IE obeys the header and ingores the rest as the html is less that the required length of code for a custom error messageltbr gtltbr gtampltphpltbr gtheaderHTTP10 404 Not Foundltbr gtampgtltbr gtamplthtmlampgtampltheadampgtltbr gtltbr gtamplttitleampgt404 Not Foundamplttitleampgtltbr gtampltheadampgtampltbodyampgtltbr gtamplth1ampgtNot Foundamplth1ampgtltbr gtampltpampgtThe requested URL was not found on this serverampltpampgtltbr gtamplthr ampgtltbr gtltbr gtampltaddressampgtApache2048 Win32 Server at localhost Port 80ampltaddressampgtltbr gtampltbodyampgtamplthtmlampgtltbr gtltbr gtI read that headerStatus 404 Not found should work but it didnt for meltbr gtThanksltpgt  ltpgtHiltpgtltpgtSorry I didnt understand quite how Id impliment thatltbr gtIm no expert at phpltbr gtltbr gtampltphpltbr gtobstartltbr gtheaderHTTP10 404 Not Foundltbr gtampgtltbr gtltbr gtWould I use obflush ltbr gtltbr gtWhat I want to do is generate a 404 error message in all browsers even though the page is actually there If the request is a hacker or spammer I dont want to feed him my custom 404 error page at 20 KB telling him what to do I want to feed him a 404 error page if that is possibleltbr gtltbr gtI dont want search engines to index the page anyway so sending a genuine 404 header is okltbr gtThanksltpgt ltpgtobstart and obflush wont be needed if the ampltphp is on the first line at the first character position with no leading spaces or other characters and your header function call is before any print or echo statementsltbr gtltbr gtThat said normally you would use something likeltbr gtltbr gtheaderampquotHTTP10 404 Not Foundrnrnampquotltbr gtltbr gtNote the double quotes needed to process the carriage return and newline charactersltbr gtltbr gtIn the past I have found that IE wont display a custom 404 message unless there are some arbitrary number say 400500 of bytes in the custom 404 page I normally create these on an Apache server using a htaccess file in the web space and a statement likeltbr gtltbr gtErrorDocument 404 404htmlltbr gtltbr gtor some reference to a PHP or other file in the root web directory  These often fail on IE if they dont have enough content  I sometimes did a loop and filled up the HTML with ampltbrampgt tags or somethingltpgt ltpgtandltbr gtIf you create a fileltbr gtampltphpltbr gtheaderHTTP10 404 Not Foundltbr gtampgtltbr gtltbr gtor evenltbr gtampltphpltbr gtheaderampquotHTTP10 404 Not Foundrnrnampquotltbr gtampgtltbr gtltbr gtAnd call it with IE it displays the standard 404 error pageltbr gtIf you call it with either FF or Opera it displays a blank pageltbr gtAs FF and Opera have found the page it seems that they ignore the headerltbr gtalthough it will probably still be sentltbr gtThe only way the 404 error page comes up in FF and Opera it seems is if thereltbr gtis a genuine no page foundltbr gtltbr gtSo I may have to use a fake reproduction for FF and Operaltbr gtltbr gtIE needs I think its 256 or 1024 bytes to show a custom pageltbr gtI actually use that to my advantage so genuine users get a informative pageltbr gtbut someone who includes ampquotampquot ampquotampquot or ampquotampampampquot and a few other things gets a blank pageltbr gtin my custom error routineltbr gtltbr gtIf you exit immediately or before 256 bytes  from header IE displays itsltbr gtstandard 404 pageltbr gtMore that 256 or 1024 I cant remember it will display your custom pageltbr gtIt seems that Microsoft did have a reason for doing thisltbr gtRegardsltpgt ltpgtthe web pages containing an ErrorDocument statement that points to a PHP page with your custom handler for the 404 ie 404php  You could have the program look at the full URL and take appropriate actions depending on your ingenuityltbr gtltbr gtThe minimum number of bytes for a custom error page displaying in IE is a well known problem  You just need to fill it up with large HTML comments amplt ampgt or tags that dont print anything  Its inconvenient but so is working with IE in many respects  FF should show even small custom error pagesltbr gtltbr gtOf course the htaccess technique requires Apache and some configuration details which allow you to use itltbr gtltpgt ltpgtAll my custom error pages include the sites header title image links and footer which is approx 12Kltbr gtIf it has ampquotampquot ampquotampampampquot ampquotampquot ampquotampquot ampquotvtiampquot etc and a bunch of other common hacks they get a blank pageltbr gthttpwwwcirclecitycouknonexistantpagephpltbr gthttpwwwcirclecitycouknonexistantpagephpxyznastycodeltbr gtTry the 2 links with IE then with either FF or Operaltbr gtltbr gtThe problem was how to bring up FF or Operas 404 error page IE does exactly as I want it toltbr gtltbr gtIn my experience with hackers they very rarely use IE It would have been nice to feed them a genuine error page instead of a blank pageltbr gtltbr gtAny new attempts would probably give up and leave but if they see a blank page they know theyve got somewhere and will probably try some moreltbr gtltbr gtOne thing Ive just thought of is redirecting to a nonexistant pageltbr gtRegardsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zv5Ao58dOZswBR5_dESX2zUqOIQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zv5Ao58dOZswBR5_dESX2zUqOIQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zv5Ao58dOZswBR5_dESX2zUqOIQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zv5Ao58dOZswBR5_dESX2zUqOIQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/_A7ihc2M8xM" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:26:25 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/404-ff-opera.html</feedburner:origLink></item>

<item>
      <title>Scriptaculous: dragable elements goes to outside of Container DIV in IE</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/_zDtXKF82B8/scriptaculous-dragable-elements-goes-outside-container-div.html</link>
      <description>ltpgtHiltpgtltpgtI have Container DIV with overflow ampquotautoampquot and there are some divs inside the container DIV those are dragable But the problem is theltbr gtcontainer overflow is not working IE but it works in mozilla It just goes outside of the container when overflow occurs I also observedltbr gtthat it works fine when I remove DIVltbr gtltbr gtThanks in advanceltpgt  ltpgtHiltpgtltpgtI have Container DIV with overflow ampquotautoampquot and there are some divs inside the container DIV those are dragable But the problem is the container overflow is not working IE but it works in mozilla It just goes outside of the container when overflow occurs I also observed that it works fine when I remove DIVltbr gtltbr gtThanks in advanceltbr gtIm taking the not so wild guess that youre setting the style properties with CSS in which case try reading httpwwwpositioniseverythingnet to find start withltbr gtltbr gtAs youve found out not all browsers interpret your code the same and IE has been the big bad proprietary abrusier pun intended for quite a while However theres hope IE8 is supposed to interpret code more standards compliant that the current iterations of Mozilla  httpblogsmsdncomieltbr gtltbr gtltbr gtltbr gtltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xtxB9ctsauvoEdum_w_PvrsB5Kw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtxB9ctsauvoEdum_w_PvrsB5Kw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xtxB9ctsauvoEdum_w_PvrsB5Kw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtxB9ctsauvoEdum_w_PvrsB5Kw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/_zDtXKF82B8" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:19:30 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/scriptaculous-dragable-elements-goes-outside-container-div.html</feedburner:origLink></item>

<item>
      <title>Convert urls to docs</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/hh-RgfXaUF4/convert-urls-docs.html</link>
      <description>ltpgtHi Expertsltbr gtltbr gtI need to convert urls to documentsltbr gtltbr gtCan you please check it in httpwwwcelltonetcomurltodocphpltbr gtltbr gtIn the above page addltbr gtltbr gthttpwwwyahoocomltbr gtltbr gthttpwwwgooglecomltbr gtltbr gtin text boxThen click on ampquotcreate docampquotIt opens one document file with seperate urls in each pageI am receving one extra page at the end of the documentltbr gtltbr gtCan you please check my code onceltbr gtltbr gtstrtrimREQUESTurls getting urlsltbr gtfp  fopenampquothome2celltonepublichtmlurltodocdocampquot wltbr gtstrexplodeampquothttpwwwampquotstrltbr gtfori1iampltcountstri ltbr gtfwritefpampquothttpwwwampquotstriltbr gtificountstrltbr gtfwritefp ampquotx0Crnampquotltbr gtltbr gtfwritefp strltbr gtfclosefpltbr gtheaderContenttype applicationmswordltbr gtheaderContentDisposition attachment filenameampquoturltodocdocampquotltbr gtreadfilehome2celltonepublichtmlurltodocdocltbr gtltbr gtOne more doubt isltbr gtltbr gtFor example if I put the yahoo site the whole page of the site should appear in the doc  How can i do like thatltbr gtltbr gtThanksltpgt  ltpgtSeperate urls in each pageI am receving one extra page at the end of the documentltbr gtltbr gtHow can i do like thatltbr gtltbr gtI see array printed in the doc file so the data from the web page isnt getting printed correctlyltbr gtltbr gtOk I might not understand this code but it seems to me that if you put the urls in a string then it isnt an array and therefore you dont need a for loopltbr gtltbr gtI think I would write the string to a the file and preserve the string breaks close the file and then offer it up to be downloadedltpgt ltpgtHi Expertsltbr gtltbr gtI need to convert urls to documentsltbr gtltbr gtCan you please check it in httpwwwcelltone tcomurltodoc phpltbr gtltbr gtIn the above page addltbr gtltbr gthttpwwwyahoo comltbr gtltbr gthttpwwwgoogle comltbr gtltbr gtin text boxThen click on ampquotcreate docampquotIt opens one document file with seperate urls in each pageI am receving one extra page at the end of the documentltbr gtltbr gtCan you please check my code onceltbr gtltbr gtstrtrim REQUEST urls  getting urlsltbr gtfp  fopenampquothome2 celltone publichtml urltodoc docampquot wltbr gtstrexplode ampquothttpwwwampquotstrltbr gtfori1iamplt countstr i ltbr gtfwritefpampquothttpwwwampquotstriltbr gtificount strltbr gtfwritefp ampquotx0Crnampquotltbr gtltbr gtfwritefp strltbr gtfclosefpltbr gtheaderContent type application mswordltbr gtheaderContent Disposition attachment filenameampquoturltodoc docampquotltbr gtreadfilehome2 celltone publichtml urltodoc docltbr gtltbr gtOne more doubt isltbr gtltbr gtFor example if I put the yahoo site the whole page of the site should appear in the doc How can i do like thatltbr gtltbr gtThanksltpgt ltpgtErrorsltbr gtWarning fopenphpnet applecom weathercom functionfopen failedltbr gtto open stream No such file or directory inltbr gthome2celltonepublichtmlurltodoc1php on line 6ltbr gtltbr gtWarning streamgetcontents expects parameter 1 to be resourceltbr gtboolean given in home2celltonepublichtmlurltodoc1php on line 7ltbr gtltbr gtWarning fclose supplied argument is not a valid stream resource inltbr gthome2celltonepublichtmlurltodoc1php on line 8ltbr gtltbr gtWarning Cannot modify header information  headers already sent byltbr gtoutput started at home2celltonepublichtmlurltodoc1php6 inltbr gthome2celltonepublichtmlurltodoc1php on line 12ltbr gtltbr gtWarning Cannot modify header information  headers already sent byltbr gtoutput started at home2celltonepublichtmlurltodoc1php6 inltbr gthome2celltonepublichtmlurltodoc1php on line 13ltpgt ltpgtHiltbr gtltbr gtIf u want the whole page in a text documentwith images and all you need to use web spideringltbr gtltbr gtA class called snoopy is avaliableplease check on the net for that It will gebntrate all the webpage htmlAll u need is to kepp that in  a variable andltbr gtwrite that in a fileltbr gtltbr gtRegardsltpgt ltpgtWhat the OP is doing is having a user type something in a text box and then you submit the form and then download what you typed as a text documentltbr gtltbr gtThe problem first was the data wasnt being written down properlyltbr gtltbr gtNext the code was throwing quite a few errorsltbr gtltbr gtWaiting for those to be fixed nowltpgt ltpgthiltbr gtltbr gtIf u want the whole page in a text documentwith images and all you need to use web spideringltbr gtltbr gtA class called snoopy is avaliableplease check on the net for that It will gebntrate all the webpage htmlAll u need is to kepp that in a variable and write that in a fileltbr gtltbr gtRegardsltpgt ltpgtI receive a DOC file with just a word inside ampquotArrayampquotltbr gtltbr gtHow can I solve this ltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jX2J7uSbxvH0Tush6F_46Irt6E0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jX2J7uSbxvH0Tush6F_46Irt6E0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jX2J7uSbxvH0Tush6F_46Irt6E0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jX2J7uSbxvH0Tush6F_46Irt6E0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/hh-RgfXaUF4" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:14:49 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/convert-urls-docs.html</feedburner:origLink></item>

<item>
      <title>Sharing code between Classes</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/Q_5X7KE5rto/sharing-code-between-classes.html</link>
      <description>ltpgtI have two classes which behave similarly but in the context of this application should certainly be kept separate if only to allow future updatesltbr gtltbr gtBoth of these classes have a function which is shared  they both need to use it and it could well change in the future  But in the scheme of things this function needs access to parts of both classes so should be inside each classltbr gtltbr gtWhat I have come up with is thisltbr gtfunction sharedfunctionltbr gtrequireonce sharedphpltbr gtltbr gtltbr gtand of course in sharedphp is just the code that should be ampquotcut and pastedampquot into each function  without the ampquotfunctionampquot etc Now this works its elegant and I cant think why it would be wrong The two classes are complex and work and I dont really want to change them But using this way of coding just doesnt seem right to me it feels like a hackltbr gtltbr gtAny comments anyoneltpgt  ltpgtHiltbr gtltbr gtIt sounds like a work for inheretence from a parent class Try the keyword extendsltbr gtExampleltbr gtltbr gtclass ExtendClass extends SimpleClass ltbr gt Redefine the parent methodltbr gtfunction displayVar ltbr gtecho ampquotExtending classnampquotltbr gtltbr gtltbr gtMore on the topicltbr gthttpwwwphpnetmanualenlanguageoop5basicphpltbr gtltbr gtregardsltpgt ltpgtI would usually use inheritance to make a new class which I was going to change so as to keep the original class in place  I dont see how your suggestion would work in my caseltbr gtltbr gtI have a classA and a classB which both do similar things but with totally different code  I now want to add FunctionC to both but keep it ampquotin one placeampquot to allow for code changes in the futureltbr gtltbr gtWhat would I be extendingltpgt ltpgtIts not really extending as the keyword suggests maybe its better to say inheretence Probably will be more familiar in this maner if you worked withltbr gtsome real OOP languages You create a class lets say classC which holds the FunctionC and everything else that is the same in classA and classB any other function orltbr gtvariable Then the classA and classB can inherit the propertiesvariables and methodsfunctions from classCltbr gtltbr gtexampleltbr gtltbr gtclass classC ltbr gtfunction FunctionC ltbr gtsome code for functionltbr gtltbr gtltbr gtltbr gtclass classA extends classC ltbr gt code for classAltbr gtltbr gtltbr gtclass classB extends classC ltbr gt code for classBltbr gtltbr gtltbr gtIn this situation both classA and classB will have the FunctionC which is defined in one place which was the point of the whole thingltbr gtltbr gtYou can define variables that are used in that function in the classC so if you in the future foregot what is classC and use it you dont get notices about undefined variablesltbr gtltbr gtA more concreate exampleltbr gtltbr gtampltphpltbr gtclass vehicle ltbr gtvar wheels  4ltbr gtltbr gtfunction numOfWheels ltbr gtreturn thisampgtwheelsltbr gtltbr gtltbr gtltbr gtclass motorbike extends vehicle ltbr gtvar wheels  2ltbr gtltbr gtltbr gtclass car extends vehicle ltbr gtvar wheels  4ltbr gtltbr gtltbr gtclass truck extends vehicle ltbr gtvar wheels  8ltbr gtltbr gtltbr gtbike  new motorbikeltbr gtcar  new carltbr gttruck  new truckltbr gtltbr gtecho bikeampgtnumOfWheelsampquotampltbr ampgtampquotltbr gtecho carampgtnumOfWheelsampquotampltbr ampgtampquotltbr gtecho truckampgtnumOfWheelsampquotampltbr ampgtampquotltbr gtampgtltbr gtltbr gtResultltbr gtltbr gt2ltbr gt4ltbr gt8ltbr gtltbr gtIts example for the school and those could be any variables and the function could do anythingltbr gtHope it helpsltbr gtltbr gtregardsltpgt ltpgtI considered this before writing but it would be ampquotthe tail wagging the dogampquot and to me it doesnt make sense when going back to edit the code in the future  Both classA and classB are not really extensions of the function so it wouldnt make logical sense when you read the codeltbr gtltbr gtAlso both classA and classB are already extended from other classesltbr gtltbr gtI think simplest is to leave it as it isltpgt ltpgtIf PHP had multiple inheritance that would be the cleanest solution One is to move the common functions into a separate class and create an instance variable of that class in classA and classBltbr gtltbr gtOr you could go back to the classes from which classA and classB are derived lets call them class1 and class2 respectively and refactor them to inherit from classC Or create an instance variable of classC in class1 and class2ltbr gtltbr gtIn any case you need to at least add comments to where you make the changes If you decide to keep the separate implementations in classA and classB please do yourself and the next dev a favor and add a comment about the other function in the other class Nothing like fixing a bug in one place and finding you should have fixed it in anotherltbr gtltbr gtGood luck whatever decision you make you will regret somewhere down the line 8ltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OeWDfcsmyb0xs81uOcC-p8T-ITU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OeWDfcsmyb0xs81uOcC-p8T-ITU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OeWDfcsmyb0xs81uOcC-p8T-ITU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OeWDfcsmyb0xs81uOcC-p8T-ITU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/Q_5X7KE5rto" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:05:40 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/sharing-code-between-classes.html</feedburner:origLink></item>

<item>
      <title>Stopping automated spam</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/S2fdnGgs4rU/stopping-automated-spam.html</link>
      <description>ltpgtHiltpgtltpgtIve been plagued with automated spam every 10 mins 24 x 7 for over 6 mths now Even though I was filtering most of it out displaying a fancy Contact Page was wasting my bandwidthltbr gtltbr gtThis has put a total stop to it as they dont get to the actual Contact Page so I thought Id post itltbr gtltbr gtcontactphpltbr gtampltphpltbr gtsessionstartltbr gterrorreporting0ltbr gtSESSIONindex  index  mtrandltbr gtSESSIONtoken  md5indexltbr gtif issetPOSTmessage exitltbr gtheaderLocation msgformphpltbr gtampgtltbr gtltbr gtmsgformphpltbr gtltbr gtampltphpltbr gtsessionstartltbr gterrorreporting0ltbr gtindex  SESSIONindexltbr gttoken  SESSIONtokenltbr gtif token  md5index exitltbr gt Rest of your Contact Page process hereltbr gtampgtltbr gtltbr gtAs ampquotmsgformphpampquot only excepts POST if message is set in ampquotcontactphpampquot its automated spam so exit with no message No need to bother checking any other inputsltbr gtltbr gtampquotmsgformphpampquot cant be accessed directly without the correct session variablesltbr gtltbr gtHopefully this may help someone or maybe improve itltbr gtCant remember were I got random session trick from but just to say I didntltbr gtthink it upltbr gtRegardsltpgt  ltpgtHiltbr gtltbr gtFunny never happened to me butltbr gtDid you consider the possibility of someone abusing your script to send spam to others using your script In some forms used to submit data to be sent in an email spammers are able to add an extra recipient using say the subject field So they send a message to someone and additionally it gets sent to you as well Spammers use this to avoid an ISP closing their mailserver avoid being traced or whatever Spammers hardly ever take the trouble to send you spam every 10 minutes 247 That you receive it may be theltbr gtresult of your form being abused 247ltbr gtltbr gtAnyway nice way to prevent people access to the submitted page worth remembering Its a bit like a simplified captcha but you might do without the token me thinks just verifying if SESSIONindex has been set would do the trick already isnt it Like in the code belowltbr gtltbr gtcontactphpltbr gtampltphpltbr gtsessionstartltbr gterrorreporting0ltbr gtSESSIONindex  index  mtrandltbr gtSESSIONtoken  md5indexltbr gtif issetPOSTmessage ltbr gtunset SESSIONindexltbr gtexitltbr gtltbr gtheaderLocation msgformphpltbr gtampgtltbr gtmsgformphpltbr gtampltphpltbr gtsessionstartltbr gterrorreporting0ltbr gtif issetSESSIONindex exitltbr gt Rest of your Contact Page process hereltbr gtampgtltpgt ltpgtgood point try adding a single line to your code to remove any n chars from the subject line this will prevent spammers from abusing your site to send email to other people and you can see their ampquottrickampquot right in the subject line of any emails you might get from themltbr gtltbr gtI get plenty of spam but spam assassin takes care of at least 95 of itltpgt ltpgtampltphpltbr gtsessionstartltbr gterrorreporting0ltbr gtSESSIONindex  index  mtrandltbr gtSESSIONtoken  md5indexltbr gtif POST  GETltbr gtltbr gtecho Error 400  Bad Requestltbr gtexitltbr gtltbr gtheaderLocation postphpltbr gtampgtltbr gtltbr gtI dont accept GET but thought Id include it anyway The Bad Request is just to make them think theyve hit a brick wall which they have If any POST or GET is set it exits and doesnt get to the actual contact pageltbr gtltbr gtIf anyone is thinking of making a Contact Me page do not name it as such as spammers search for these Use a meta tag ampquotnoindexampquot and put it in your robotstxt so it isnt indexed by search engines Google is great for spammersltbr gtltbr gtI did have a very nice CAPTCHA on my contact page random slanting az09 own font random background lines etc but I received a few complaints that it wasnt compliant with partially sighted or blind surfers which I agree withltbr gtltbr gtThe CAPTCHA is no longer needed now which I have removedltbr gthttpwwwcirclecitycoukeditorltbr gtIs anyone can break it it will help me improve itltbr gtltbr gtIts a very long story but one spammer the one who is still hammering at my site actually threatened me through my contact me page He hit my site every 30 secs for nearly a month presumably to try and bring my site down He didnt succeed but it got me worried This is not the only spammer Ive been involved withltbr gtltbr gtMy contact page doesnt actually send an email as such It saves the message and all the details to a database table and emails me that I message has been leftltbr gtltbr gtI have common input checking for all the site which is really strict allowing only the characters needed for Name Email and Messageltbr gtltbr gtI also have a swear filter and a spam filter Any more than 2 links gets kicked off The swear filter is interesting as it will detect cunt but not Scunthorpe as this is a UK townltbr gtltbr gtIf you read thisltbr gthttpwwwcirclecitycoukscamsscam1phpltbr gtltbr gtYoull realise my my site is getting attacked But I wont take it offltbr gtltbr gtI laughted by socks of when I made him wait at the airport As my site is a hobby site I can take these risks Still learningltbr gtRegardsltpgt ltpgtIf you are going to send the text of a response code why not go all the way and send a code that the browser will interpret  Here is an example of a 301 I foundltbr gtltbr gt Permanent redirectionltbr gtheaderampquotHTTP11 301 Moved Permanentlyampquotltbr gtheaderampquotLocation httpwwwexamplecomampquotltbr gtexitltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mHVz2GdO1s_mDkxtDbjmj4iIaCs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mHVz2GdO1s_mDkxtDbjmj4iIaCs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mHVz2GdO1s_mDkxtDbjmj4iIaCs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mHVz2GdO1s_mDkxtDbjmj4iIaCs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/S2fdnGgs4rU" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:59:22 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/stopping-automated-spam.html</feedburner:origLink></item>

<item>
      <title>Migration to Vdeck 3.0 broke SwiftMail - it just hangs</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/c4D7z_ZxHHo/migration-vdeck-30-broke-swiftmail-just-hangs.html</link>
      <description>ltpgtSwiftMail is a PHP mailing application  It is a rather complex set of PHP scriptsltbr gtTo get it working on my old vdeck server I had to comment out the lstat command from SwiftConnectionSendMailphp  Now I have new vdeck 30 server and I dont know what is different but the SwiftMail app hangs foreverltbr gtltbr gtNow is where it get really weirdltbr gtltbr gtAt the end of the global section not a class not a function I put the following linesltbr gtltbr gtecho ampquotdid itampquotltbr gtexitltbr gtltbr gtThe only thing after those lines is theltbr gtclass SwiftConnectionSendmail extends SwiftConnectionBaseltbr gtltbr gtIn other words the only thing left in the script after that is the big class that the lines above my inserted exit already got done loading  So why does the script hang unless I insert that exitltbr gtltbr gtIm hoping someone knows what could cause SwiftMail to hang  But if not at least what would causebany script to hang unless I put an exit at the END of the executable section of itltbr gtltbr gtIll write to SwiftMails author and ask him  He might know  If I get an answer Ill let you knowltbr gtltbr gtThanksltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xp4dWXyLF3XbbfX8hWnveUpEOrA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xp4dWXyLF3XbbfX8hWnveUpEOrA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xp4dWXyLF3XbbfX8hWnveUpEOrA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xp4dWXyLF3XbbfX8hWnveUpEOrA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/c4D7z_ZxHHo" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:53:20 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/migration-vdeck-30-broke-swiftmail-just-hangs.html</feedburner:origLink></item>

<item>
      <title>Hosting limitation issue</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/celyGZ2HaG0/hosting-limitation-issue.html</link>
      <description>ltpgtHello Allltbr gtltbr gtThe hosting company that I use is 85 per year but I creating a truly dynamic website and Im having issues  There is a port that is closed port 1863 and it closed because the hosting plan I have is a shared hosting plan  To upgrade with the same hosting company it will cost 45 per month  Im looking for a less expensive alternativeltbr gtltbr gtI have an email extractor program integrated to the site but it only works for two types of email accounts  It will not work for gmailltbr gtAOL MSN etc because of security issues and the limitations with the hosting package Ive selectedltbr gtltbr gtIf anyone knows of an inexpensive hosting plan without this kind of limitation please replyltbr gtltbr gtThanksltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uTcwwN8aOxG_U_1KJ9wR4ZPSXh4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uTcwwN8aOxG_U_1KJ9wR4ZPSXh4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uTcwwN8aOxG_U_1KJ9wR4ZPSXh4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uTcwwN8aOxG_U_1KJ9wR4ZPSXh4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/celyGZ2HaG0" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:50:01 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/hosting-limitation-issue.html</feedburner:origLink></item>

<item>
      <title>Eliminating Query White Spaces</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/ae4dTxfoEiA/eliminating-query-white-spaces.html</link>
      <description>ltpgtI have a table with a column named vendname  This column isnt completely populated so as I query the column within the table to populate a pull down on a query page there are many white spaces  My intent is to eventually have all of those empty table cells populated but until then would really like to eliminate the white spaces and hoped I might get some ideas here  As it currently stands I have approximately 50 rows with 15 vendname rows populated and a whole bunch of white space that shows up on the pull down queryltbr gtltbr gtMy code isltbr gtltbr gtampltphpltbr gthostName  ampquotlocalhostampquotltbr gtuserName  ampquotampquotltbr gtpassword  ampquotampquotltbr gtdbName  ampquotapprovalsampquotltbr gttable  ampquotapprovalstblampquotltbr gtltbr gtmysqlconnecthostName userName password or dieampquotUnable to connect to host hostNameampquotltbr gtltbr gtmysqlselectdbdbName or dieampquotUnable to select database dbNameampquotltbr gtltbr gtquery  ampquotSELECT DISTINCT vendnameltbr gtFROM tableampquotltbr gtresult  mysqlqueryqueryltbr gtltbr gtnumber  mysqlnumrowsresultltbr gtltbr gtfor i0 iampltnumber i ltbr gtvendname  mysqlresultresultiampquotvendnameampquotltbr gtprint ampquotampltoption valueampquotvendnameampquotampgtvendnameampltoptionampgtampquotltbr gtltbr gtltbr gtmysqlcloseltbr gtampgtltbr gtltbr gtany help is greatly appreciatedltpgt  ltbr gtltbr gtltbr gtltbr gtltbr gtltbr gtltbr gtltbr gtltbr gtltbr gtInstead of iterating through each number from 1 to the maximum number of rowsltbr gtwhy not use a while loopltbrgtwhile rowdata  mysqlfetchassocresultltbr gtltbr gt  vendname  trimrowdatavendnameltbr gt   check to see if the value is not emptyltbr gt  if vendnameltbr gt  ltbr gt   printfampquotampltoption valueampquotsampquotampgtsampltoptionampgtampquot vendname vendnameltbr gt  ltbr gtltbrgtAlso if you want your vendor names to be unique and alphabetical perhaps youltbr gtdont you can change your query toltbr gtltbr gtSELECT vendname FROM table GROUP BY vendnameltbr gtltbr gtThis will select unique values from the vendname column and then sort themltbr gtalphabeticallyltbr gtltbr gtJamesltbrgtltbr gt ltbr gtVery nice  Works great  Thank you very much James  ltbr gtltbr gtJohnltbrgtampgt Instead of iterating through each number from 1 to the maximumltbr gtnumber of rowsltbr gtltbr gtperhaps youltbr gtltbr gtsort themltbr gt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pliS2OpB-98GYgfET_6qHxCYk1g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pliS2OpB-98GYgfET_6qHxCYk1g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pliS2OpB-98GYgfET_6qHxCYk1g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pliS2OpB-98GYgfET_6qHxCYk1g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/ae4dTxfoEiA" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:48:42 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/eliminating-query-white-spaces.html</feedburner:origLink></item>

<item>
      <title>Setting HTML as variable</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/ZfU25PvFeVU/setting-html-variable.html</link>
      <description>ltpgtI want to set a variable that will include HTML code and MySQL query results Is this possibleltpgt  ltpgtYes  Instead of using print or echo simply build up a big variable  This can contain any variables or dynamic content you desireltbr gtltbr gtout  ampquotampquotltbr gtout  ampquotfirst lineampltbr ampgtnampquotltbr gtout  ampquotsecond lineampltbr ampgtnampquotltbr gtltbr gtTo send the output to the browser simplyltbr gtltbr gtprint outltbr gtltbr gtYou can also play games with output buffering  ob functions  but these require that your opening PHP tag be on the first line first character position  I dont think it will work if you start to send output to the browser  It may not be as picky as header setcookie etc which write to the HTTP headersltpgt ltpgtThanks What if I want to pass out to another page I tried that and since my out has code in it the page is reading it as code and not as a variable in a linkltpgt ltpgtMost of the time PHP is used to generate custom HTML  Some of that custom content is determined by the logic of the program and some may come from a database query or other resourceltbr gtltbr gtIf you are generating a block of content text  HTML you can best pass it from one page to another using session variablesltbr gtltbr gtThe basic procedure in PHP is to start your opening PHP tag ampltphp start on the first line on the first character position  Then do a sessionstartltbr gtbuild up your out variable and save it in a session variableltbr gtltbr gtltbr gtampltphpltbr gtsessionstartltbr gtout  ampquotampquotltbr gtout  ampquotfirst lineampltbr ampgtnampquotltbr gtout  ampquotsecond lineampltbr ampgtnampquotltbr gt ltbr gtSESSIONhtml  outltbr gtampgtltbr gtltbr gtThe underscores are not part of the file of course  Its important that you do not do any print or echo statements before you save the value in the SESSIONltbr gtsupergloballtbr gtltbr gtIn your second page you do something similarltbr gtltbr gtampltphpltbr gtsessionstartltbr gthtml  SESSIONhtmlltbr gtltbr gtprint htmlltbr gtampgtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7000rUuAvdjk_HtXbIkdKmRykbs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7000rUuAvdjk_HtXbIkdKmRykbs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7000rUuAvdjk_HtXbIkdKmRykbs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7000rUuAvdjk_HtXbIkdKmRykbs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/ZfU25PvFeVU" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:47:16 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/setting-html-variable.html</feedburner:origLink></item>

<item>
      <title>Books and Web pages to learn PHP</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/52icS_37dk0/books-web-pages-learn-php-newbie-question.html</link>
      <description>ltpgtHiltpgtltpgtSince you are new I will take this opportunity to suggest that you supply informative subject lines  I took the liberty to modify the subject in this reply so it will be more likely to get a response than ampquotNewbie Questionampquot or ampquotHelpampquot mightltbr gtltbr gtUltimately there isnt a single best PHP book for everyone  Usually you have to pick up a book and see which one ampquotspeaks to youampquot  it provides examples and explanations you can understand and hopefully examples you want to work onltbr gtltbr gtI like the Peachpit books by Ullman for learning PHP  There are titles like PHP FOR THE WORLD WIDE WEB PHP ampamp MYSQL FOR THE WORLD WIDE WEB and PHP ADVANCED FOR THE WORLD WIDE WEB  They are inexpensive and have pretty goodltbr gtexamplesltbr gtltbr gtIf youve done some programming before in another language you may simply be interested in ampquotHow can I  in PHPampquot  For this the cookbook style books may be helpful  Theres one from OReilly and one from Sams which are each goodltbr gtltbr gtAs far as web sites go the httpwwww3schoolscom site has a PHP section along with HTML CSS JS etc  You can also find things inltbr gtltbr gthttpwwwwebmonkeycom and other sites which may be relevant for youltbr gtltbr gtWhen looking for free or lowpriced programs you can install on your server look to httpwwwhotscriptscom which has programs in PHP and other languagesltbr gtltbr gtMost hosting accounts will run Linux or Unix with Apache PHP ampamp MySQL  It usually works best if you develop and test in the same sort of environment You can set up a Linux system with out huge difficulties and it is a good learning experience  I dont recommend using Windows or IIS for PHP development  It can be done but it is more of a headache and security nightmare than it is worthltbr gtltbr gtRemember that PHP scripts are different than HTML pages  You cant simply open a PHP page in your browser with a direct link to the filesystem on your machine  Instead you need to test by processing the script through Apache Often this is done by using a URL like httplocalhostscriptphp or equivalent  The scriptphp file needs to be in a particular place for your web server program to see it  The specifics depend on your host or home installationltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iIwOM3F6ZvatNoeGymZbFUkLMZs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iIwOM3F6ZvatNoeGymZbFUkLMZs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iIwOM3F6ZvatNoeGymZbFUkLMZs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iIwOM3F6ZvatNoeGymZbFUkLMZs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/52icS_37dk0" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:42:42 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/books-web-pages-learn-php-newbie-question.html</feedburner:origLink></item>

<item>
      <title>Gettin proper data</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/LYcKwJHKQ3Y/gettin-proper-data.html</link>
      <description>ltpgtHiltpgtltpgti need to have a record pull data that count is less then 30 in all the records but i need to have it less then 20 in one of the records Possible in one record setltbr gtltbr gtwhat i haveltbr gtltbr gtSELECT ltbr gtFROM sessionaltbr gtWHERE sessionacountamplt30ltbr gtltbr gtampltphpltbr gtmysqlselectdbdatabasewellness wellnessltbr gtquerywellnesssessionacount  ampquotSELECT  FROM sessiona WHEREltbr gtsessionacountamplt30ampquotltbr gtwellnesssessionacount  mysqlqueryquerywellnesssessionacountltbr gtwellness or diemysqlerrorltbr gtrowwellnesssessionacount  mysqlfetchassocwellnesssessionacountltbr gttotalRowswellnesssessionacount  mysqlnumrowswellnesssessionacountltbr gtampgtltbr gtbut in one of the records count can needs to be amplt20ltbr gtltbr gtis there a way to do AND so and so is less then 20ltbr gtltbr gtThanksltpgt  ltpgtcountamplt20  You say that you want this to be in a single record set  I guess by this you mean the same result for the query  You can use UNION to combine two queries into a single record set IF the columns are the sameltbr gtltbr gtq  ampquotSELECT  FROM tablea WHERE countamplt30ltbr gtUNIONltbr gtSELECT  FROM tableb WHERE countamplt20ampquotltbr gtltbr gtThis example assumes that tablea and tableb have the same columnsltbr gtltbr gtMaybe if we knew a little more about your data and goals we could be more helpfulltbr gtltpgt ltpgtmysqlfetchassocwellnesssessionacountltbr gtmysqlnumrowswellnesssessionacountltbr gtltbr gtI guess byltbr gtltbr gtcombine twoltbr gtltbr gtmoreltbr gtltbr gtltbr gtHeres little more information on thisltbr gtltbr gtThere are 12 classes ppl are choosing from a drop down menu that is populated by this recordset  Once they select and hit register it places them into that class and adds 1 to a count fieldltbr gtltbr gtWhen 30 ppl are signed up it should no longer appear in the drop down menu that part is easy the problem is all the classes except the one can have 30 ppl  The one expection class is only allowed to have 20 ppl in itltbr gtltbr gtHope this helpsltpgt ltpgtOK  What do your tables look like  Usually youd have one table for each class description one for each student with their info and one for the studentclass relationship  Youd use a join to link the tables along shared keysltbr gtltbr gtcoursesltbr gtltbr gtcourseid   INT PRIMARY KEY AUTOINCREMENTltbr gtcoursename VARCHAR255ltbr gtmaximum    INTltbr gtltbr gtltbr gtstudentsltbr gtltbr gtstudentid  INT PRIMARY KEY AUTOINCREMENTltbr gtfirstname  VARCHAR255ltbr gtlastname   VARCHAR255ltbr gtemail      VARCHAR255ltbr gtltbr gtltbr gtstudentcoursesltbr gtltbr gtstudentid  INTltbr gtcourseid   INTltbr gtltbr gtIf this is the way you have it you need to count the number of students in a given classltbr gtltbr gtSELECT ccourseid ccoursenameltbr gtFROM   courses c LEFT JOIN studentcourses scltbr gtON     sccourseidccourseidltbr gtGROUP  BY ccourseidltbr gtHAVING COUNT amplt cmaxltbr gtltbr gtI tested this with a small set of data  My field names are shorter than my example aboveltbr gtltbr gtmysqlampgt desc jkcoursesltbr gtltbr gt Field  Type          Null  Key  Default  Extra          ltbr gtltbr gt cid    int11       NO    PRI  NULL     autoincrement ltbr gt cname  varchar255  YES        NULL                    ltbr gt cmax   int11       YES        NULL                    ltbr gtltbr gt3 rows in set 000 secltbr gtltbr gtmysqlampgt select  from jkcoursesltbr gtltbr gt cid  cname  cmax ltbr gtltbr gt   1  PHP       3 ltbr gt   2  MySQL     3 ltbr gt   3  HTML      2 ltbr gtltbr gt3 rows in set 000 secltbr gtltbr gtmysqlampgt desc jkstudentsltbr gtltbr gt Field  Type          Null  Key  Default  Extra          ltbr gtltbr gt sid    int11       NO    PRI  NULL     autoincrement ltbr gt sname  varchar255  YES        NULL                    ltbr gt email  varchar255  YES        NULL                    ltbr gtltbr gt3 rows in set 000 secltbr gtltbr gtmysqlampgt select  from jkstudentsltbr gtltbr gt sid  sname  email ltbr gtltbr gt   1  JK           ltbr gt   2  KK           ltbr gt   3  GL           ltbr gt   4  AL           ltbr gt   5  LL           ltbr gt   6  MF           ltbr gtltbr gt6 rows in set 000 secltbr gtltbr gtmysqlampgt desc jkstudentcoursesltbr gtltbr gt Field  Type     Null  Key  Default  Extra ltbr gtltbr gt sid    int11  YES        NULL           ltbr gt cid    int11  YES        NULL           ltbr gtltbr gt2 rows in set 000 secltbr gtltbr gtmysqlampgt select  from jkstudentcoursesltbr gtltbr gt sid   cid  ltbr gtltbr gt    1     1 ltbr gt    2     1 ltbr gt    3     1 ltbr gt    1     2 ltbr gt    2     2 ltbr gtltbr gt5 rows in set 000 secltbr gtltbr gtmysqlampgt select  from jkcourses c jkstudentcourses sc where ccidsccidltbr gtgroup by ccid having countampltccmaxltbr gtltbr gt cid  cname  cmax  sid   cid  ltbr gtltbr gt   2  MySQL     3     1     2 ltbr gtltbr gt1 row in set 000 secltbr gtltbr gtHence 3 students are signed up for PHP the max for this course  Only 2 students signed up for MySQL 1 less than the max so it shows up  However HTML has no students signed up and it is not showing up  Now we need a LEFT JOIN to link the tables even if there are no matching rows in the second tableltbr gtltbr gtmysqlampgt select  from jkcourses c LEFT JOIN jkstudentcourses sc ONltbr gtccidsccid group by ccid having countampltccmaxltbr gtltbr gt cid  cname  cmax  sid   cid  ltbr gtltbr gt   2  MySQL     3     1     2 ltbr gt   3  HTML      2  NULL  NULL ltbr gtltbr gtltbr gtNow we have a list of the courses for which the number of students is below the maximum for the courseltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gqk1QjWmnN6ROJc2n5SFa8iGxrw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gqk1QjWmnN6ROJc2n5SFa8iGxrw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gqk1QjWmnN6ROJc2n5SFa8iGxrw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gqk1QjWmnN6ROJc2n5SFa8iGxrw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/LYcKwJHKQ3Y" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:39:53 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/gettin-proper-data.html</feedburner:origLink></item>

<item>
      <title>Cpanel SubDomain creation through PHP script.</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/_8LskRBC-dM/cpanel-subdomain-creation-through-php-script.html</link>
      <description>ltpgtHiltbr gtltbr gtCpanel 11 provides facility to create Subdomains on different folderltbr gtltbr gtIf I want to create onemydomaincom I can host it under zzzzone or any other folderltbr gtltbr gtWhen I passed it through cpanel SubDomain creation form it generating an URL like belowltbr gtltbr gthttpmydomaincom2082frontendsgsubdomaindoadddomainhtmldomainoneampamprltbr gtootdomainmydomaincomampampdirpublichtml2Fzzzz2Foneltbr gtltbr gtLater I changed one to two from this URL and run it So I got another SubDomain as twomydomaincom hosting at zzzztwo folder  I got this SubDomain without passing data through cpanel SubDomain creation formltbr gtltbr gtNow I need to create several hundreds of Subdomains under my main domain I can make above type URL by using spreadsheet program such as excel But getting executed these URL one by one will take more time and effort I expect it can be run through some php scriptsltbr gtltbr gtI expect experts support on this issueltbr gtltbr gtWith thanks in advanceltpgt  ltpgtI dont think you will be able to do what you are hoping for I have never worked with Cpanel however I am pretty sure opening the link without logging in first will do nothing but give you a session errorltbr gtltbr gtIf somehow they dont authenticate the user when clicking on the link which would be a security nightmare you could do something like thisltbr gtltbr gtnum  arrayonetwothreefourltbr gturl1 ltbr gthttpmydomaincom2082frontendsgsubdomaindoadddomainhtmldomainltbr gturl2  ampamprootdomainmydomaincomampampdirpublichtml2Fzzzz2Foneltbr gtforeachnum as nltbr gtf  fopenurl1nurl2rltbr gtfclosefltbr gtltbr gtltbr gtGood Luckltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_psHsQwVoNgu_RGWshs3JWbknZU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_psHsQwVoNgu_RGWshs3JWbknZU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_psHsQwVoNgu_RGWshs3JWbknZU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_psHsQwVoNgu_RGWshs3JWbknZU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/_8LskRBC-dM" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:35:37 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/cpanel-subdomain-creation-through-php-script.html</feedburner:origLink></item>

<item>
      <title>Inventory PHP</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/QZfM2zMtTpY/inventory-php.html</link>
      <description>ltpgtHiltpgtltpgtis there any good inventory PHP examples anywhere ampgtltpgtltpgtthanksltbr gtampnbspltpgt  ltpgtI assume you are referring to an inventory software Try this one httpwwwnolaprocomindex5html Its open source ampamp well supportedltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7Ofu2jva8lzDaXLlwEn14_n1okY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7Ofu2jva8lzDaXLlwEn14_n1okY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7Ofu2jva8lzDaXLlwEn14_n1okY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7Ofu2jva8lzDaXLlwEn14_n1okY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/QZfM2zMtTpY" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:33:43 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/inventory-php.html</feedburner:origLink></item>

<item>
      <title>Slashes showing up after insert from form</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/OV6bX9vd2io/slashes-showing-after-insert-from-form.html</link>
      <description>ltpgtHiltpgtltpgtWhen I insert into my database from a form there are slashes added before quotes What do I need to do to get rid of thisltpgt  ltpgtHiltbr gtltbr gtIt sound like you have problems with magic quotes Open your phpini file and search for magicquotes and turn them all off This way youll have total control over your data ltbr gtltbr gtregardsltpgt ltpgtAssuming that you have an int primary key named id you could do something like thisltbr gtltbr gtq  mysqlqueryampquotSELECT  FROM table WHERE column LIKE ampquotltbr gtwhilerow  mysqlfetchassocqltbr gtforeachrow as k ampgt v v  strreplaceampquotampquotvltbr gtmysqlqueryUPDATE table SET implodeampquotk  vampquotWHERE id ltbr gtrowid or diemysqlerrorltbr gtltbr gtltbr gtThere are probably easier ways of doing this but this is the first off the top of my headltbr gtltbr gtFYI I have not tested or debugged this codeltpgt ltpgtAs already noted this is an issue with the magicquotes parameter  If you expect to stay on the same server with the same configuration you can modify each value with a stripslashes function which will remove backslashes  The opposite function is addslashesltbr gtltbr gtWhen inserting data into MySQL you often surround the data with single quotes though double quotes will work on MySQL and use the backslash before a single quote character in the stringltbr gtltbr gtIf you want to make your code more portable you can use something likeltbr gtltbr gtfunction fixslashinltbr gtltbr gtout  inigetmagicquotes  stripslashesin  inltbr gtreturn outltbr gtltbr gtltpgt ltpgtforeachPOST as thisitemltbr gtltbr gtPOSTthisitem  stripslashesPOSTthisitemltbr gtltbr gtltbr gtor ltbr gtforeachPOST as keyampgtvalueltbr gtltbr gtPOSTkey  stripslashesvalueltbr gtltbr gtltbr gtto make compatable with different server configs ltbr gtifgetmagicquotesgpcltbr gtltbr gtforeachPOST as keyampgtvalueltbr gtltbr gtPOSTkey  stripslashesvalueltbr gtltbr gtltbr gtltbr gtsame for alternate ltbr gtifgetmagicquotesgpcltbr gtltbr gtforeachPOST as thisitemltbr gtltbr gtPOSTthisitem  stripslashesPOSTthisitemltbr gtltbr gtltbr gtltbr gtHope this helpsltpgt ltpgtYour solutions all insert the name of the submit button rather than pass the form dataltbr gtltbr gtIve found that I have access to the ini file But there is no entry for magic quotes Is this the best way to fix the problem What do I need to add to do thisltbr gtltpgt ltpgtHelloltpgtltpgtThat sounds like a typo I will run it in WAMP and check itltbr gtltbr gtI have assumed that you are using ltbr gtampltform methodampquotpostampquot ltbr gtltbr gtThe ampquotsubmitampquot element will be processed just as the other elements are but that shouldnt matter as the remaining code of yours wont try to add theltbr gtltbr gtampquotsubmitampquot value to the data baseltbr gtltbr gtHow are you accessing the form data ltbr gtltbr gtx  POSTelement nameltbr gtorltbr gtx  SERVERPOSTelement nameltbr gtltbr gtltpgt ltpgtHave you looked at the contents of the POST arrayltbr gtltbr gtprintfampquotampltpreampgtsampltpreampgtampquot printrPOST trueltbr gtltbr gtThe variable name and button label value of the submit button is clearly one of the pieces of data which is submittedltbr gtltbr gtNone of the code he provided inserts into your database table  If the wrong variable and value is being inserted that code must be examinedltbr gtltbr gtThis is the line in the phpini file which controls Magic Quotesltbr gtltbr gtmagicquotesgpc  Onltbr gtltbr gtIf you do find you can change the file you will also have to restart Apache for it to be effectiveltbr gtltbr gtIt is probably easier to put an iniset function call at the top of yourltbr gtscript if you want to turn off magicquotesgpcltbr gtltbr gtinisetampquotmagicquotesgpcampquot 0ltbr gtltbr gtYou may find that you dont have permission to change this parameter and it could throw an errorltbr gtltbr gtYou can code around this  It is not necessary to change this common configuration valueltpgt ltpgtHelloltpgtltpgtI tested with the code below I dont have magic quotes enabled but this should work for youltbr gtltbr gtJust put the small block of code below into your script before any POST variables are usedltbr gtltbr gtifgetmagicquotesgpcltbr gtltbr gtforeachPOST as key ampgt valueltbr gtltbr gtPOSTkey  stripslashesvalueltbr gtltbr gtltbr gtltbr gtIf the above does not work then try this insteadltbr gtforeachPOST as key ampgt valueltbr gtltbr gtPOSTkey  stripslashesvalueltbr gtltbr gtBelow again is the script that I used to testltbr gtltbr gtamplthtmlampgtltbr gtampltheadampgtltbr gtltbr gtampltheadampgtltbr gtampltbodyampgtltbr gtampltphpltbr gtifissetPOSTsubmitltbr gtltbr gtampgtltbr gtampltform actionampquotampltphp echoSERVERPHPSELF ampgtampquot methodampquotpostampquotampgtltbr gtampltinput typeampquottextampquot nameampquotitem1ampquot valueampquotdoubleampquotampgtampltbrampgtltbr gtltbr gtampltinput typeampquottextampquot nameampquotitem2ampquot valueampquotsingleampquotampgtampltbrampgtltbr gtampltinput typeampquottextampquot nameampquotitem3ampquot valueampquotbackslashampquotampgtampltbrampgtltbr gtltbr gtampltinput typeampquottextampquot nameampquotitem4ampquot valueampquotslashampquotampgtampltbrampgtltbr gtampltinput typeampquottextampquot nameampquotitem5ampquot valueampquotescapeampquotampgtampltbrampgtltbr gtltbr gtampltinput typeampquotsubmitampquot nameampquotsubmitampquot valueampquotTestampquotampgtltbr gtampltformampgtltbr gtampltphpltbr gtltbr gtifissetPOSTsubmitltbr gtltbr gtforeachPOST as key ampgt valueltbr gtltbr gtPOSTkey  stripslashesvalueltbr gtechoPOST  key      POSTkey  ampltbrampgt  ampquotnampquotltbr gtltbr gtltbr gtampgtltbr gtltbr gtampltbodyampgtltbr gtamplthtmlampgtltpgt ltbrgtI have come back to read your original question againltbr gtltbr gtSome SQL databases require escape characters  before quotes on SOME fieldltbr gttypesltbr gtltbr gtIF your field type does NOT require escapes then you have two option ltbr gt1 Remove them on incoming dataltbr gtHTML ampgt strislashes ampgt mysqlltbr gt2 remove them on outgoing dataltbr gtmysql ampgt stripslashes ampgt HTMLltbr gtltbr gtIF your field type DOES require escapes then the only option is to removeltbr gtthem on the outgoing sideltbr gtltbr gtThe slashes issue for form data is a completely different issue to theltbr gtslashes issue for mysqlltbrgt ltbr gtltbr gtltbr gtquotes What doltbr gtltbr gtAs somebody else mentioned you have a magicquotes problem  nastyltbr gtlittle invention but it will be gone in PHP6  finally  anywayltbr gtltbr gtI am using the following function in my scripts to remove magic quotesltbr gtI save it to a file called magicquotesphp and then include the file atltbr gtthe top of every script I runltbr gt requireonce magicquotesphpltbrgtampltphpltbr gtThis is here to deal with MagicQuotes sourceltbr gthttpusphpcommanualensecuritymagicquotesdisablingphpltbr gtltbr gtif getmagicquotesgpc ltbr gt     function stripslashesdeepvalueltbr gt     ltbr gt         value  isarrayvalue ltbr gt                     arraymapstripslashesdeep value ltbr gt                     stripslashesvalueltbr gtltbr gt         return valueltbr gt     ltbr gtltbr gt     POST  arraymapstripslashesdeep POSTltbr gt     GET  arraymapstripslashesdeep GETltbr gt     COOKIE  arraymapstripslashesdeep COOKIEltbr gt     REQUEST  arraymapstripslashesdeep REQUESTltbr gtltbr gtltbr gtltbr gtif getmagicquotesgpc ltbr gt     echoampquotPHP Magic Quotes are enabled on your system Please disableltbr gtthis option in your phpini file or your webhosting configuration pageampquotltbr gt if getmagicquotesgpcltbr gtltbr gtampgtltbr gtltbr gtI test all my input fields with the strings below to test for databaseltbr gthandling and proper html translation problemsltbr gtltbr gtslashsquotedquoteampquotsecocotibtiltbr gtampltPHP dieYou are in trouble if the script ends right here ampgtltbr gtfromTO1234567890fromTOampampltbr gtampltbampgtThis should not be boldamplthtmlampgtltbr gtThere is only one slash here  and one backslash  but there is no spoonltbr gtBrakesPHPorSQL ampltPHP  AND 1  1ampquotAND 1  1ltbrgtltbr gt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HzsY3DgGEj-57EDWULYm0iClhM0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HzsY3DgGEj-57EDWULYm0iClhM0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HzsY3DgGEj-57EDWULYm0iClhM0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HzsY3DgGEj-57EDWULYm0iClhM0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/OV6bX9vd2io" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:32:03 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/slashes-showing-after-insert-from-form.html</feedburner:origLink></item>

<item>
      <title>Novice</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/4f05YvXAksE/novice-followup-question.html</link>
      <description>ltpgtHiltpgtltpgtI changed the extension on my file from htm to phpltbr gtI get the messageltbr gtInternal Server Errorltbr gtThe server encountered an internal error or misconfiguration and wasltbr gtunable to complete your requestltbr gtltbr gtPlease contact the server administrator zzzzz and inform them of the time the error occurred and anything you might have doneltbr gtthat may have caused the errorltbr gtltbr gtMore information about this error may be available in the server error logltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3JE2kcPmQe2OeWmu_xeSpOzdbJ4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3JE2kcPmQe2OeWmu_xeSpOzdbJ4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3JE2kcPmQe2OeWmu_xeSpOzdbJ4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3JE2kcPmQe2OeWmu_xeSpOzdbJ4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/4f05YvXAksE" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:24:31 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/novice-followup-question.html</feedburner:origLink></item>

<item>
      <title>Novice to PHP needs help</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/V-q-OMhGFMA/novice-php-needs-help.html</link>
      <description>ltpgtHiltpgtltpgtI have a computer with Windows XP professional but no IIS I downloaded Apache Server 22 and Php Configuring the httpd to use LoadModule did not work It kept saying the file was not found I added the codeltbr gtltbr gtScriptAlias php ampquotcprogram filesphpampquotltbr gtAddType applicationxhttpdphp phpltbr gtAction applicationxhttpdphp ampquotphpphpexeampquotltbr gtampltDirectory ampquotCProgram Filesphpampquotampgtltbr gtAllowOverride Noneltbr gtOptions Noneltbr gtOrder allowdenyltbr gtAllow from allltbr gtltbr gtampltDirectoryampgtltbr gtltbr gtApache started and I can read a html file from LocalHost but php code does not runltbr gtampltHTMLampgtltbr gtampltBODYampgtltbr gtampltphp printHello worldn ampgtltbr gtampltBODYampgtltbr gtampltHTMLampgtltpgt  ltpgtHiltbr gtltbr gtFor novice user I would recommend WAMP instead of configuring everything separately It a user friendly install of everything you need to start to work with the php I stands for WindowsApacheMySQLPHP So youll get all of them by entering some important date about the installation and web server and by clicking nextnextnextltbr gtltbr gtMore infoltbr gtltbr gthttpwwwwampservercomenltbr gtltbr gtregardsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nx_63WTurzkM350Z6ktVv_QqJ2g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nx_63WTurzkM350Z6ktVv_QqJ2g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nx_63WTurzkM350Z6ktVv_QqJ2g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nx_63WTurzkM350Z6ktVv_QqJ2g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/V-q-OMhGFMA" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:23:12 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/novice-php-needs-help.html</feedburner:origLink></item>

<item>
      <title>ftp script</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/hkwGFk_lbHI/ftp-script.html</link>
      <description>ltpgtHiltpgtltpgtIm working on a ftp script and right now Im just learning from the script on the php siteltbr gtltbr gtThis lineltbr gtltbr gtupload  ftpputconnectionid destinationfile source FTPBINARYltbr gtltbr gtIm having trouble with destinationfileltbr gtltbr gtdestination file is the remote file pathltbr gtSo I assume that to beltbr gtftpservernamecomltbr gt rootltbr gtimages images directoryltbr gtltbr gtso I put destinationfile  ampquotimagesampquotltbr gtWarning ftpput functionftpput Cant open that file Is a directory in ftpuploadscriptphp on line 23ltbr gtFTP upload has failedltbr gtltbr gtI did try images for the destination but that was a invalid path itltbr gtsaid So I tried images and the same for thatltbr gtltbr gtI just dont understand what its asking forltbr gtltpgt  ltpgtHelloltpgtltpgtThe server name or IP address should be used when you open the port connection along with the username and password The remote file path is not needed or accepted when you are opening the connectionltbr gtltbr gtA relative path may work depending on the FTP config ie images or publichtmlimages or you may need to find the full path ie usrwwwuseresservernameaccounthomepublichtmlimages A relative path cannot start with a backslashltbr gtltbr gtThe destination must also have the file name ie wwwhomepublichtmlmypicjpg as this can be different to the source file nameltbr gtltbr gtAnother problem you will see at times is sym links The publichtml may not actually be a folder but just a sym link to another folder like a shortcut in Windows It is best to use the real file past Although Apache may follow sym links for http it may not follow them for ftp depending on the local config This is especially true for shared serversltbr gtltbr gtApache treats folders and files in a similar way Opening a read stream to a folder returns a directory listing and opening a read stream to file returns the data in the fileltbr gtltbr gtHope tis helpsltpgt ltpgtupload  ftpputconnectionid destinationfile source FTPBINARYltbr gtltbr gtIm having trouble with destinationfileltbr gtltbr gtdestination file is the remote file pathltbr gtSo I assume that to beltbr gtftpservernamecomltbr gt rootltbr gtimages images directoryltbr gtltbr gtso I put destinationfile  ampquotimagesampquotltbr gtWarning ftpput functionftpput Cant open that file Is altbr gtdirectory in ftpuploadscriptphp on line 23ltbr gtFTP upload has failedltbr gtHey Wade I think that the destinationfile  needs to be the actualltbr gtfilenameltbr gtltbr gtdestinationfile  MYFILEtxtltbr gtIts the remote FILE not the remote directoryltbr gtltbr gtbool ftpput  resource ftpstream  string remotefile  stringltbr gtlocalfile  int mode  int startpos  ltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yzKsGD8FNV90vak0AYZtTgWzqu8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yzKsGD8FNV90vak0AYZtTgWzqu8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yzKsGD8FNV90vak0AYZtTgWzqu8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yzKsGD8FNV90vak0AYZtTgWzqu8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/hkwGFk_lbHI" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:18:03 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/ftp-script.html</feedburner:origLink></item>

<item>
      <title>Strict Standards: strtotime()</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/eHGATYd_ryY/strict-standards-strtotime.html</link>
      <description>ltpgtHiltpgtltpgtim getting this error in my PHP can someone help me in getting rid of it    thanksltbr gtltbr gtStrict Standards strtotime functionstrtotime It is not safe to rely on the systems timezone settings Please use the datetimezone setting the TZ environment variable or the datedefaulttimezoneset function In case you used any of those methods and you are still getting this warning you most likely misspelled the timezone identifier We selected AmericaChicago for 60no DST instead in cInetpubwwwrootphpmyadmintblpropertiesstructurephp on line 665ltbr gtltbr gtStrict Standards strftime functionstrftime It is not safe to rely on the systems timezone settings Please use the datetimezone setting the TZ environment variable or the datedefaulttimezoneset function In case you used any of those methods and you are still getting this warning you most likely misspelled the timezone identifier We selected AmericaChicago for 60no DST instead in cInetpubwwwrootphpmyadminlibrariescommonlibphp on line 1761ltbr gtltbr gtStrict Standards strftime functionstrftime It is not safe to rely on the systems timezone settings Please use the datetimezone setting the TZ environment variable or the datedefaulttimezoneset function In case you used any of those methods and you are still getting this warning you most likely misspelled the timezone identifier We selected AmericaChicago for 60no DST instead in cInetpubwwwrootphpmyadminlibrariescommonlibphp on line 1762ltbr gtltbr gtStrict Standards strftime functionstrftime It is not safe to rely on the systems timezone settings Please use the datetimezone setting the TZ environment variable or the datedefaulttimezoneset function In case you used any of those methods and you are still getting this warning you most likely misspelled the timezone identifier We selected AmericaChicago for 60no DST instead in cInetpubwwwrootphpmyadminlibrariescommonlibphp on line 1764 Mar 24 2008 at 0705 AMltpgt  ltpgtIt would appear that your errorreporting level is too comprehensive ie EALL and you might need to select another value which will block warnings See more detail at httpphpneterrorreportingltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LFjNJas18oc9EStN_p5oIEf0v2o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LFjNJas18oc9EStN_p5oIEf0v2o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LFjNJas18oc9EStN_p5oIEf0v2o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LFjNJas18oc9EStN_p5oIEf0v2o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/eHGATYd_ryY" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:14:43 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/strict-standards-strtotime.html</feedburner:origLink></item>

<item>
      <title>Parse Error: Syntax Error, unexpected T_STRING</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/g_oXJMG39ho/parse-error-syntax-error-unexpected-tstring.html</link>
      <description>ltpgtWhile transferring some files in my new site layout I encountered this errorltbr gtltbr gtParse error syntax error unexpected TSTRING in  on line 54ltbr gtltbr gtIve done nothing different in transferring the data and this error is only in this one fileltbr gtltbr gtThanks in advanceltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OvfrY6QZGUGlQcLargeHxWP_z48/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OvfrY6QZGUGlQcLargeHxWP_z48/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OvfrY6QZGUGlQcLargeHxWP_z48/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OvfrY6QZGUGlQcLargeHxWP_z48/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/g_oXJMG39ho" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 22:11:36 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/parse-error-syntax-error-unexpected-tstring.html</feedburner:origLink></item>

<item>
      <title>Inserting a decimal</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/eaKY9iMF9G4/inserting-decimal.html</link>
      <description>ltpgtHiltbr gtltbr gtI am trying to insert a decimal point two places from the right end of a string so 100 would become 100  I have tried using numberformat andltbr gtprintf but I get 10000ltbr gtltbr gtAny suggestionsltbr gtltbr gtThanksltpgt  ltpgtIf your starting number is ALWAYS a whole number you can divide by 100ltbr gtltbr gtOr would you sometimes haveltbr gtltbr gt677   and want to get 677  for exampleltpgt ltbr gtThanks I had come up with the same solution  dividing by 100 andltbr gtthen using sprintfltbrgtampgtltbr gtltbr gtltbr gtend ofltbr gtnumberformat andltbr gtltbr gt100ltbr gtltbr gt ltbrgtstring  substrstring 0 strlenstring  2    substrstringltbr gtstrlenstring 1 2ltbrgtltbr gt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hcDyj-DkhboAsYnXSVJDFsEBPqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hcDyj-DkhboAsYnXSVJDFsEBPqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hcDyj-DkhboAsYnXSVJDFsEBPqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hcDyj-DkhboAsYnXSVJDFsEBPqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/eaKY9iMF9G4" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:38:26 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/inserting-decimal.html</feedburner:origLink></item>

<item>
      <title>Image Watermarking with PHP</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/5wpzm0pEvMw/image-watermarking-php.html</link>
      <description>ltpgtHiltpgtltpgtIm starting a new project with a security firm and Im trying to simply a lot of their horrific ways of doing thingsltbr gtltbr gtOne of the things I thought about is how they watermark their security images They use a piece of software that costs thousands per year in licensing fees just to watermark images So I started to look into doing this with phpltbr gtltbr gtI quickly came across many different tutorials on this but I quickly realized that they were applying a static watermarkltbr gtltbr gtWhat Im working on right now is for every image that is taken I must imprint the time date and location of the image in the bottom right hand cornerltbr gtltbr gtI ran some more searches but Im not coming up with anythingltbr gtltbr gtAnyone got any tutorial links for something like thisltbr gtltpgt  ltpgtYou can do this with the GD library preferably 20 and PHP functions or ImageMagick with some command line tools ie use PHP functions like system or exec with very good validation of the variables you pass to the command lineltbr gtltpgt ltpgtVery easy did one like that for wwwfrimachnl but ltbr gtltbr gtI am applying a static watermark here as well However the principle remains the sameltbr gtltbr gtBasically consists of generating an overlay image then generating on the fly an image that is a combination of the real image with the overlay So instead of using always the same overlay you need to generate on the fly the overlay as wellltbr gtltbr gtImprint also the name of the user say ampquotgenerated for Wadeampquot in the overlay Then if a protected image shows up somewhere on the internet it is obvious which user was responsible for leaking it Best is to use a ampquothandwritingampquot style font for this as the shape of the characters is more irregular making it more difficult to photoshop it outltbr gtltbr gtNot really but there are tons of tutorials available on the internet Below is what I useltbr gtltbr gtfunction watermarkimageImage Dir Repeat  true ltbr gt original fromltbr gthttpwwwfedeblogcomarfilesviewphpiWatermarkwatermarkphpltbr gt modificated by Liem Bahneman liem fromltbr gtltbr gthttprsbahnemancomwmphphtmlltbr gt modificated by Marc Boncz to be called as standardised functionltbr gtltbr gt global variables defined in configincphpltbr gtglobal ImageDir JPGQualityltbr gtltbr gt set some variablesltbr gtWatermarkImage  ampquotwatermarkpngampquotltbr gtWatermark   ImageDirWatermarkImageltbr gtOverlay   imagecreatefrompngWatermarkltbr gtExtension  substrImage 3ltbr gtStop   falseltbr gtltbr gt create the first layer of the new imageltbr gtswitch strtolowerExtension ltbr gtcase gifltbr gtStop  NewImage  imagecreatefromgifDirImageltbr gtbreakltbr gtcase pngltbr gtStop  NewImage  imagecreatefrompngDirImageltbr gtbreakltbr gtcase jpgltbr gtStop  NewImage  imagecreatefromjpegDirImageltbr gtbreakltbr gtdefaultltbr gtStop  trueltbr gtbreakltbr gtltbr gtltbr gt copy the watermarklayer into thisltbr gtif Stop ltbr gtifRepeat ltbr gt line below places watermark exactly in the middle of new imageltbr gtimagecopyNewImage Overlayltbr gtimagesxNewImage2imagesxOverlay2ltbr gtimagesyNewImage2imagesyOverlay2 0 0 imagesxOverlayltbr gtimagesyOverlayltbr gtWaterless   imagesyNewImage  imagesyOverlayltbr gtRest   ceilWaterlessimagesyOverlay2ltbr gt multiple watermarks tiled on image from center to bordersltbr gtforn1 nampltRest n ltbr gtimagecopyNewImage Overlayltbr gtimagesxNewImage2imagesxOverlay2ltbr gtimagesyNewImage2imagesyOverlay2imagesyOverlayn 0 0ltbr gtimagesxOverlay imagesyOverlayltbr gtimagecopyNewImage Overlayltbr gtimagesxNewImage2imagesxOverlay2ltbr gtimagesyNewImage2imagesyOverlay2imagesyOverlayn 0 0ltbr gtimagesxOverlay imagesyOverlayltbr gtltbr gt else ltbr gt line below places image in bottom right cornerltbr gtimagecopyNewImage Overlay imagesxNewImageimagesxOverlayltbr gtimagesyNewImageimagesyOverlay 0 0 imagesxOverlayltbr gtimagesyOverlayltbr gtltbr gt save the newly created imageltbr gtswitch strtolowerExtension ltbr gtcase gifltbr gtimageGIFNewImage DirImage JPGQualityltbr gtbreakltbr gtcase pngltbr gtimagePNGNewImage DirImage JPGQualityltbr gtbreakltbr gtcase jpgltbr gtimageJPEGNewImage DirImage JPGQualityltbr gtbreakltbr gtdefaultltbr gtbreakltbr gtltbr gtimagedestroyNewImageltbr gtltbr gtimagedestroyOverlayltbr gtltbr gtltbr gtTo obtain what you want you might change the call toltbr gtltbr gtfunction watermarkimageImage Dir Repeat  true Dynamictrueltbr gtltbr gtand then change the lineltbr gtltbr gtWatermark   ImageDirWatermarkImageltbr gtltbr gtto something likeltbr gtltbr gtWatermark ltbr gtDynamicImageDirgeneratewatermarkImageDirWatermarkImageltbr gtltbr gtwhere generatewatermark is a call to a function that will generate anltbr gtimage containing ampquotgenerated 23032008 115613 for Wade Smartampquot in altbr gtdifficult to obscure fontltbr gtltbr gtuse something likeltbr gtltbr gtfunction generatewatermark ltbr gt global variables defined in configincphpltbr gtglobal IncludeDate IncludeTime IncludeUserltbr gtltbr gt construct watermark textltbr gtWatermarkText  ampquotgenerated ampquotltbr gtWatermarkText  IncludeDatedateampquot ampquotampquotampquotltbr gtWatermarkText  IncludeTimetimeampquot ampquotampquotampquotltbr gtWatermerkText  IncludeUserSESSIONampquotUsernameampquotampquotampquotltbr gtltbr gt generate an image from thisltbr gtdo GD imagelibrary stuffltbr gtltbr gtreturn Watermarkltbr gtltbr gtltbr gtThat way you will have two flexible functions that without too complicated modifications you can use in sites of other customers as well when needed no use to code the same application twice just put them in a general functions repository Using functions with standardised function calls whenever you find time to improve the functions you just create a newer version of your funcions repository which you can distribute to your older clients as well thus always providing them with uptodate functionaltyltbr gtltpgt ltpgtThanks for that code  Before I saw your post I found another script so I tried that one and two others and none of them are working It must be that I do not understand how to use themltbr gtltbr gtampltphpltbr gtinisetdisplayerrors 1ltbr gterrorreportingEALLltbr gtheaderampquotContentTypeimagepngampquotltbr gtimghandle  imagecreatefrompngampquotbannerboypngampquotltbr gtcolor  imagecolorallocateimghandle 100 100 100ltbr gtip  SERVERampquotREMOTEADDRampquotltbr gtimagestringimghandle 3 10 9 ampquotWades IP ipampquot colorltbr gtimagepngimghandleltbr gtimagedestroyimghandleltbr gtampgtltbr gtltbr gtand titled it ipaddrphpltbr gtltbr gtand then on another page I called itltbr gtltbr gtampltimg srcampquotipaddrphpampquot ampgtltbr gtltbr gtbut I have no image and show no errorsltpgt ltpgtWhen using the header function it is often necessary to include the carriage return and linefeeds  Capitalization and spacing are sometimes an issueltbr gtltbr gtheaderampquotContentTypeimagepngampquotltbr gtltbr gtshould beltbr gtltbr gtheaderampquotContenttype imagepngrnrnampquotltbr gtltbr gtAlso the way you have SERVER uses parens instead of brackets  With parens PHP will think it is a function and it will not workltbr gtltbr gtip  SERVERampquotREMOTEADDRampquotltbr gtltbr gtshould beltbr gtltbr gtip  SERVERampquotREMOTEADDRampquotltbr gtltbr gtThe way you had it it could throw an undefined function error or simply put an empty string in ipltbr gtltbr gtI guess you have your source image ampquotbannerboypngampquot in the same directory as your PHP script and the imagecalling pageltbr gtltbr gtIf your script does throw an error you will not get any useful output Firefox might say the image cannot be displayed if you go to the script directly  Your error settings will send output to the browser if thrown and the header function will not work  Perhaps this is OK  You will get the ampquotheaders already sentampquot error if something is displayedltbr gtltbr gtNaturally the opening PHP tag must be on the first line and start at the first character position to ensure that the header function will work when it is error freeltpgt ltpgtI made the changes I suggested and it runs on my server with my imageltbr gtltbr gthttpwwwkeelinecommarcphpltbr gtltbr gtHere is the code as I have itltbr gtltbr gtampltphpltbr gtinisetdisplayerrors 1ltbr gterrorreportingEALLltbr gtheaderampquotContenttype imagepngampquotltbr gtimghandle  imagecreatefrompngampquotKnottsCableCarPostcard1024pngampquotltbr gtcolor  imagecolorallocateimghandle 100 100 100ltbr gtip  SERVERampquotREMOTEADDRampquotltbr gtimagestringimghandle 3 10 9 ampquotWades IP ipampquot colorltbr gtimagepngimghandleltbr gtimagedestroyimghandleltbr gtampgtltbr gtltbr gtOnce you have it working Id comment out the iniset and errorreporting functions  You will probably want to check to see that the image you are marking even exists and that it is an imageltpgt ltpgtI totally didnt even see I wrote  instead of  on the SERVER And that did fix this scriptltbr gtltbr gtI received the same error messageltbr gtthe image ampquoturlampquot cannot be displayed because it contains errorsltbr gtwhen I tried the php example Im looking for my error thereltbr gtltbr gtI like your trolley car photo I cant see the ip addr written thoughltbr gtObviously not my addr either but I cant see the writing Did it print outltpgt ltpgtI changed the colors to be mostly red  I was using the code you provided Gray is not going to show up clearly on everything of courseltbr gtltbr gtThe photo I picked was one at hand  It is a scan of a postcard showing a 1907 SF cable car when they ran in the parking lot at Knotts Berry Farm in the 1950s and 1960s  We have one of these at the Poway Midland RR and will run it in a year or two  We also just got back from SF and riding the cable cars they have there so it was on my mind  Until then well run the 1907 steam locomotive 1894 LA trolley and 1950 rail speederltbr gthttpwwwPowayMidlandRRorgltpgt ltpgtOk This is coming along Now Im working with the text portion I have a date and time on the image but I want to put a background behind the text so it can be seen better I started with this imagerectangle but getting the numbers right is driving me nutsltbr gtltbr gtMy test image is 320 x 240 Im using on imagestring a number 5 on font size placed 50 by 220ltbr gtltbr gtltbr gt  ltbr gtTop Part of Picltbr gtltbr gt  ltbr gt    ltbr gt    ltbr gt  ltbr gt  ltbr gtltbr gtltbr gtI have the box drawnltbr gt40 220 305 235ltbr gtltbr gtand I thought I could use imagefill but that doesnt do what I thought How would I go about just coloring in the boxltpgt ltpgtWorking on the final part  saving the image Im trying to save the image but Im getting that message cannot be displayed because it contains errorltbr gtmessageltbr gtltbr gtI have imagepngimghandle saveAs 0ltbr gtsaveAS  dateampquotampquottimeampquotpngampquotltpgt ltpgtGoing through the forums on several sites Im not the only one having this problem And its still confusing as some say that the second parameter is a file name and some say its a destination And it seems to work either way for many  which I dont understand that at allltbr gtltbr gtI simplified this out to justltbr gtsaveTo  ampquotnewpictsampquotltbr gtltbr gtsaveAs  ampquotNewFilepngampquotltbr gtltbr gtand triedltbr gtimagepngimghandle saveTo and imagepngimghandle saveAsltbr gtand neither work Adding in the third and four parmeter as several postsltbr gtsay you must have I added 0 NULL but that didnt help eitherltbr gtltbr gtAs for right now only imagepngimghandle seems to workltpgt ltpgtyour example worked just fineltbr gtltbr gtampltphpltbr gtheaderContenttype imagepngltbr gtimg  imagecreatefrompnghotlinkpngltbr gtcol  imagecolorallocateimg 0 0 0ltbr gtimagestringimg 5 4 1 ampquotcirclecitycoukampquot colltbr gtimagepngimgltbr gtimagedestroyimgltbr gtampgtltbr gtltbr gtThe image handle is all thats needed in imagepngltbr gtIts the imagestringimg fontsize xpos ypos textstring col that youltbr gtwould put your text variables inltbr gtltbr gtYoull want to use your own font as the max size is 5 in the default text fontltbr gtwhich is fairly smallltbr gtltbr gtOnce you get it working you can add some variables to be passed to it as theltbr gttext may overlap certain things in the images Left center right upper lowerltbr gtyou have to calculate them yourself and maybe different light and darkltbr gtcoloursltbr gtltbr gtYou can use getimagesizeimg to get the mime type and attr is really handyltbr gtIts all in the downloadable PHP manualltbr gtltbr gtAs mentioned previously youd need to check if the image existsltpgt ltpgtyou would put your text variables inltbr gtltbr gtfont which is fairly smallltbr gttext may overlap certain things in the images Left center right upper lowerltbr gtyou have to calculate them yourself and maybe different light and darkltbr gtcoloursltbr gthandyltbr gtltbr gtltbr gtThanks for the post Bob but you didnt answer the correct question I have the image overlay with the time and date in a gray box working great Im working on SAVING it now to a fileltbr gtltbr gtThe second parameter for the imagepng is to save to a locationltbr gtltbr gtAnd I finally got that worked out last night as well It turns out that this is even more finicky with permissions than I had thoughtltbr gtltbr gtI had both the folder and file set as wadesmart group wadesmart and that didnt work I changed the folder and file to wwwdata and that didnt work I changed the folder to wwwdata and left the file as owner group wadesmart and that worked That through me for a loop  but I got it workingltbr gtltpgt ltpgtoutput an image OR save an image  The same function call cannot do both  Youltbr gtwill have to call it twice  once to save and once to output the image to theltbr gtbrowserltbr gtltbr gtThe second parameter for saving the image is expecting a path and filename egltbr gtltbr gtampquotthumbsmypicpngampquot or varwwwuserthumbsmypicpngampquot  Probably the relativeltbr gtpath first example is best since it allows some flexibility and should keepltbr gtit working even if your host moves things around for your accountltbr gtltbr gtThe directory where the images will be saved must be writable by the webltbr gtserver  With Apache on Linux this may be the user named ampquotapacheampquot or ampquotnobodyampquotltbr gtor something elseltbr gtltbr gt Having a writable directory in the web space can be very dangerous becauseltbr gtit allows an outside user an opportunity to put content on your server and runltbr gtit ltbr gtltbr gtWith that in mind you may want your writable directory to be outside of yourltbr gtweb space  On my host for example my ampquothomeampquot directory has a publichtmlltbr gtdirectory which contains all of the files that can be accessed by Apachesltbr gtconfiguration  Other files and directories at the home directory level cannotltbr gtbe reached by Apache by configuration but can be accessed by PHP functions ifltbr gtgiven a proper pathltbr gtltbr gtCheck with your sysadmins about setting permissions and creating such altbr gtdirectory  You will need to have a PHP handler script which can obtain theseltbr gtfiles in a controlled ie authorized and safe mannerltbr gtltbr gtMore than likely the reason why your function does not seem to work when youltbr gtadd a second parameter is that if you give a filename only the directory whereltbr gtyour PHP script is running is not and should not be writable by Apache  Youltbr gtdont see the error message because the browser has received the imagepng MIMEltbr gttype and is expecting binary image data  This is where sending errors to a logltbr gtfile can be very helpfulltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Hfrq3b_Uap60RgKVsW9k9TyFC-Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hfrq3b_Uap60RgKVsW9k9TyFC-Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Hfrq3b_Uap60RgKVsW9k9TyFC-Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hfrq3b_Uap60RgKVsW9k9TyFC-Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/5wpzm0pEvMw" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:37:04 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/image-watermarking-php.html</feedburner:origLink></item>

<item>
      <title>Download path for free php and mysql books</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/tjpl7YZV5LM/need-download-path-free-php-mysql-books.html</link>
      <description>ltpgtHiltpgtltpgtI have no internet connection all the time so i want to download the php books and mysql books for offline working and practice Any one give me the right directionltpgtltpgtThanks in Advanceltpgt  ltpgthttpwwwphpnetdownloaddocsphpltbr gtltbr gthttpdevmysqlcomdocltpgt ltpgtltbr gttry httpwwwflazxcomltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ABNTbtGDmg40-Q2MX-xJVib-t1Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ABNTbtGDmg40-Q2MX-xJVib-t1Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ABNTbtGDmg40-Q2MX-xJVib-t1Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ABNTbtGDmg40-Q2MX-xJVib-t1Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/tjpl7YZV5LM" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:23:26 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/need-download-path-free-php-mysql-books.html</feedburner:origLink></item>

<item>
      <title>Is Memcached suitable for my RSS Agggregator site?</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/mz8Mmwsm6ms/memcached-suitable-rss-agggregator-site.html</link>
      <description>ltpgtHi Folksltbr gtltbr gtI am in the process of developing an online RSS aggregator site httpwwwkedoyacom  The site is currently in beta stage and isltbr gtpainfully slow due to large database Due to its nature Kedoya database grow by 10 MB everyday and will be 4 GB in size by the end of this yearltbr gtltbr gtMy questions are ltbr gtltbr gt Is memcached suitable for Kedoyacom ltbr gt What is the maximum size of database table that can be effectively handled by memcachedltbr gt Assuming I have a dedicated server with 20 GB of RAM can I split a big 16 GB table into 4 memcached tables 4 GB each ltbr gt Assuming I have a dedicated server with 20 GB of RAM can I load 4 big tables 4 GB each into 4 memcached tables 4 GB each ltbr gtltbr gtThx a millionltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lByOJH6UlMtwh-DkVSQ9V5xnXac/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lByOJH6UlMtwh-DkVSQ9V5xnXac/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lByOJH6UlMtwh-DkVSQ9V5xnXac/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lByOJH6UlMtwh-DkVSQ9V5xnXac/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/mz8Mmwsm6ms" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:21:39 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/memcached-suitable-rss-agggregator-site.html</feedburner:origLink></item>

<item>
      <title>More on Excel to mysql</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/_Too0DzSgKs/more-excel-mysql.html</link>
      <description>ltpgtHiltpgtltpgtsoim still learning and probably have undertaken a large and laborious idea but I want to recreate box scores from NBA games but in a slightly different format that is availalable onlineltbr gtltbr gtIve got it down to a quick conversion from the web version to the excel version each takes less than 3 minutes to convert and the answers today were helpful but I have a few more questionsltbr gtltbr gtIs there a way to load into mysql either using my sql or php and setting all the foreign keys to the same fieldor do i have to have the foreign key designation already in the excel spread sheetltbr gtltbr gtLine Scores from box score will have multiple foreign key relationships to players to gamesso its kind of imoprtant to know here to methanks in advanceltbr gtampnbspltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NEE9zFZJ0_BF_x3q-Dj4T_SJ6M0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NEE9zFZJ0_BF_x3q-Dj4T_SJ6M0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NEE9zFZJ0_BF_x3q-Dj4T_SJ6M0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NEE9zFZJ0_BF_x3q-Dj4T_SJ6M0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/_Too0DzSgKs" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:20:23 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/more-excel-mysql.html</feedburner:origLink></item>

<item>
      <title>Mysql table storage efficiency</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/XiEVGEdv0bI/mysql-table-storage-efficiency.html</link>
      <description>ltpgtHiltpgtltpgtAs far as table size considerations and storage efficiency I have the following questionltbr gtltbr gtI would like to store articles in mysql tableltbr gtltbr gtI will display only the title on one pageltbr gtonly title and first two sentences in two more pagesltbr gtthe whole article i will display in one page only if the user cliks to seeltbr gtallltbr gtltbr gtbased on thisltbr gtltbr gt1 apart from title and first two sentences should i store the rest of theltbr gtwhole article which is a lot more text in the same table or in another tableltbr gtor in another file or how of course i prefer to store the whole article in oneltbr gtrow of one table but i am wondering if that way is efficientltbr gtltbr gt2 when storing sentences or paragraphs of the article should i just assignltbr gtTEXT variable to those columns it looks like the easiest way but as far asltbr gttable size is it efficient for example limiting a columnsize with varchar orltbr gtsomething like that is it more efficient or is there a trim function orltbr gtsomething like that to help storing efficiencyltbr gtltbr gt3displaying articles with php would that make a difference or not based onltbr gtwhat i choseltbr gtltbr gtThanksltbr gtampnbspltpgt  ltpgtThe datatype called text is about as efficient as varchar  The number of bytes required to store the content is the length plus just one byte for varchar and two bytes for text  The maximum length of a text is 64kltbr gtltbr gtStoring ampquotJamesampquot in a varchar10 is the same as varchar255ltbr gtltbr gtYou may decide to store the teaser separately or include a nonprinting marker to separate the teaser from the rest of the article  Your program that retrieves the content can parse the text to get the teaser from the entire story  It probably wont take much space to store the teaser separately if you find it easierltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/c78P8fQGXGAKdoMOXfbFXUk8XfI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c78P8fQGXGAKdoMOXfbFXUk8XfI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/c78P8fQGXGAKdoMOXfbFXUk8XfI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c78P8fQGXGAKdoMOXfbFXUk8XfI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/XiEVGEdv0bI" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:18:45 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/mysql-table-storage-efficiency.html</feedburner:origLink></item>

<item>
      <title>Excel to mysql</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/BMMniYkzkHs/excel-mysql.html</link>
      <description>ltpgtHello Allltbr gtltbr gtI have a bunch of mailing list in MS Excel format  I want to upload them into my MySQL database  What is the best way to do this  Iveltbr gtseen converter software has anyone used any before and are any of them freeltbr gtltbr gtThanks in advance for your assistanceltpgt  ltpgtSave them in text format in Excel  They will be tabdelimited files  From there you have a much better chance of importing them into MySQL tables you have defined  Look at the MySQL command LOAD DATA INTO and note the properties such as SEPARATED BY and so onltpgt ltbrgtIf you have phpmyadmin then you can save then as CSV Coma Separated Valuesltbr gtand the directly import them to an existing table with phpmyadminltbr gtltbr gtDo a test one first with an unused tableltbrgtltbr gt ltpgtHiltbr gtltbr gtI prefer to save the file in CSV format and read the file with PHPltbr gtfopen fclose etcltbr gtThen format the read data and insert into your database accordingltbr gtyour objectiveltbr gtltbr gtthanksltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oWSaNmBEcPjze8jb6muDZZ9JxD8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oWSaNmBEcPjze8jb6muDZZ9JxD8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oWSaNmBEcPjze8jb6muDZZ9JxD8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oWSaNmBEcPjze8jb6muDZZ9JxD8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/BMMniYkzkHs" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:16:50 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/excel-mysql.html</feedburner:origLink></item>

<item>
      <title>CRON Error</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/q7Z_vYcfI6M/cron-error.html</link>
      <description>ltpgtHi Allltbr gtltbr gtOn my server PHP version 4xx runs by default so I use the following in altbr gthtaccess file to force version 5xxltbr gtltbr gthtaccessltbr gtAddHandler applicationxhttpdphp5 phpltbr gtltbr gtI am running the following script and it runs fine in a browser  withoutltbr gterrors and it is sending email as expected and deleting files BUT I get theltbr gtfollowing error when I set it as a CRONltbr gtltbr gtbinsh hometonyapublichtmlcronrelayphp Permission deniedltbr gtltbr gtThe cron command is ltbr gtltbr gt15     homedomainpublichtmlcronrelayphpltbr gtltbr gtampltphpltbr gtltbr gt mail relay  finds email processes it and send it on via emailltbr gtltbr gtto  ampquotuserampquotltbr gtfrom  ampquotuserampquotltbr gtltbr gtdirectory  homedomainmailuserdomaincomnewltbr gtltbr gtfunction getsubjectheadersltbr gtltbr gtheaders  explodeampquotnampquot headersltbr gtforeachheaders as headerltbr gtltbr gtifstrtolowersubstrheader 0 8  subjectltbr gtltbr gtsubject substrheader 8ltbr gtifsubstrsubject 0 1   ltbr gtltbr gtsubject  substrsubject 1ltbr gtltbr gtreturn subjectltbr gtltbr gtltbr gtltbr gtltbr gtlist  scandirdirectoryltbr gtltbr gtforeachlist as filenameltbr gtltbr gtifsubstrfilename 0 1  ltbr gtltbr gtcontinueltbr gtltbr gttext  filegetcontentsdirectory  filenameltbr gttext  strreplaceampquotrnampquot ampquotrampquot textltbr gttext  strreplaceampquotrampquot ampquotnampquot textltbr gtchoppos  strpostext ampquotnnampquotltbr gtheaders  substrtext 0 chopposltbr gtmessage  substrtext choppos  2ltbr gtltbr gtsubject  getsubjectheadersltbr gtregex  wwltbr gtmessage  pregreplace regex email prorected messageltbr gtltbr gtmailto subject message From  fromltbr gt  echoampquotampquot  directory  ampquotampquot  filename  ampquotampquot  subject  ampquotnampquotltbr gtunlinkdirectory  filenameltbr gtltbr gtltbr gtampgtltpgt  ltpgtYou are trying to run the relayphp as an executable which it probably is not ls l will tell you if you can decipher the abbreviationsltbr gtltbr gtHopefully you have the command line version of PHP  Most of the time it is located at usrbinphp  You can run a command likeltbr gtltbr gtwhereis phpltbr gtltbr gtto get the path  Once you have the location edit your crontab to use itltbr gtltbr gt15     usrbinphp homedomainpublichtmlcronrelayphpltpgt ltbr gtltbr gtltbr gtltbr gtTake a look on this pageltbr gthttpwwwphpnetcliltbr gtltbr gtA little bit down the page you will find the sectionltbr gtampquotThe CLI SAPI has three different ways of getting the PHP code you wantltbr gtto executeampquotltbr gtltbr gtThat should take care of your problemltbrgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0GBJ1-IqhypqFMcH8Oqee5G38es/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0GBJ1-IqhypqFMcH8Oqee5G38es/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0GBJ1-IqhypqFMcH8Oqee5G38es/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0GBJ1-IqhypqFMcH8Oqee5G38es/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/q7Z_vYcfI6M" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:10:58 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/cron-error.html</feedburner:origLink></item>

<item>
      <title>REGEX for e-mail address</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/HNAGefIsSMg/regex-email-address.html</link>
      <description>ltpgtHello Allltbr gtltbr gtI have made an email forwarder that I want to filter out email addresses It is all working except the REGEXltbr gtltbr gtI have NOT used REGEX before Can someone tell me what I am doing wrongltbr gtltbr gtThis script loads the email as a file from the local email folder on the serverltbr gtltbr gttext  filegetcontentsdirectory  filenameltbr gttext  strreplaceampquotrnampquot ampquotrampquot textltbr gttext  strreplaceampquotrampquot ampquotnampquot textltbr gtchoppos  strpostext ampquotnnampquotltbr gtheaders  substrtext 0 chopposltbr gtmessage  substrtext choppos  2ltbr gtltbr gtsubject  getsubjectheadersltbr gtregex ltbr gtltbr gtampquotaz09ampampaz09ampampaz0ltbr gt9ampltaz26d13d133diDampquotltbr gtmessage  pregreplace regex email prorected messageltbr gtltbr gtmailto subject message From  fromltbr gtltbr gtfunction getsubjectheadersltbr gtltbr gtheaders  explodeampquotnampquot headersltbr gtforeachheaders as headerltbr gtltbr gtifstrtolowersubstrheader 0 8  subjectltbr gtltbr gtsubject substrheader 8ltbr gtifsubstrsubject 0 1   ltbr gtltbr gtsubject  substrsubject 1ltbr gtltbr gtreturn subjectltbr gtltbr gtltbr gtltpgt  ltpgtampquotaz09ampampaz09ampampaz0ltbr gt9ampltaz26d13d133diDampquotltbr gtltbr gtWow  Thats one complex RegEx  I wonder how many of the characters in your square brackets are even legal for emails according to the RFC  Also you are not allowing uppercase characters and those are legalltbr gtltbr gtAs you know an email address usually follows the formltbr gtltbr gtuserltbr gtltbr gtThe server names can vary especially when subdomains or country codes are involvedltbr gtltbr gtTo keep this fairly simple at first and then build upon it lets say that the user name can contain letters numbers the dash the underscore and the dot for our friends with old CompuServe addresses  We can get the upper and lower case letters and numbers with wltbr gtltbr gt09AZaz  wltbr gtltbr gtWe need to have at least one letter before the  symbol  To PHP the  symbol is not a special character unlike Perl so we dont need to escape itltbr gtltbr gtSimilarly the server name will have at least one character after the  symbol If we allow the dot and so forth then we may not care about the separation between the server domain name and the toplevel domain eg com net org However domain names dont have underscores I believe so I wont includ it here YMMVltbr gtltbr gtwwltbr gtltbr gtThe  is an enumerator which says ampquot1 or more of the match to the leftampquotltbr gtltbr gtThe trouble with really complex RegEx rules is they can be hard to proofread One swapped or errant character and it fails  Youll have to decide if it needs to be more complex than this for some reasonltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SQB7VIJhDmoyI_EsxI1B0lV1JcU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SQB7VIJhDmoyI_EsxI1B0lV1JcU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SQB7VIJhDmoyI_EsxI1B0lV1JcU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SQB7VIJhDmoyI_EsxI1B0lV1JcU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/HNAGefIsSMg" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:08:46 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/regex-email-address.html</feedburner:origLink></item>

<item>
      <title>Append an array of arrays to an array</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/q52TDHqIolU/append-array-arrays-array.html</link>
      <description>ltpgtHi allltbr gtltbr gtHow do I append an array of arrays to an array in phpltbr gtltbr gtIf I have ltbr gtarray022ltbr gtorltbr gt022ltbr gtltbr gtand I have ltbr gtarrayarray122array222array322ltbr gtorltbr gt122ltbr gt222ltbr gt322ltbr gtltbr gtHow do I append the array of arrays to the array so that I have ltbr gtarrayarray022array122array222array322ltbr gtorltbr gt022ltbr gt122ltbr gt222ltbr gt322ltbr gtltbr gtI tried this but it doesnt workltbr gtresult  array  arraysltbr gtltbr gtAny help would be appreciatedltbr gtI am obviously doing something wrongltpgt  ltpgtHiltbr gtYou can find many functions for working with arrays hereltbr gthttpwwwphpnetmanualenrefarrayphpltbr gtltbr gtYou can useltbr gtarrays  arrayltbr gtwhich will add the array to the end of the arrays like theltbr gtarraypush functionltbr gtIf you want to add it to the beginning use arraunshift like thisltbr gtarrayunshiftarrays arrayltbr gtWhich will add the array to the beginning of arraysltbr gtltbr gtregardsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ptq_Rk4yGDOxmSK73vV2Tjp2V1w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ptq_Rk4yGDOxmSK73vV2Tjp2V1w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ptq_Rk4yGDOxmSK73vV2Tjp2V1w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ptq_Rk4yGDOxmSK73vV2Tjp2V1w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/q52TDHqIolU" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:05:57 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/append-array-arrays-array.html</feedburner:origLink></item>

<item>
      <title>Database vs table</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/wGDRi6m_NP8/database-vs-table.html</link>
      <description>ltpgtQuestion I am building a site that is mainly a news portal site about several categories of a specific subject There will be other elements too but it will be mainly a news portal site What makes more sense  to create separate databases for each category and then build news and othertables under each db or can I just use one db and build many tables under it news tables for eachltbr gtcategory and other tables for each category In the long run what makes more sense As far as backing up updating data add more tables in time writing php to pull data other aspects i can not thinnk ofAny advice This is the first time I am creating dtabases so I am having hard time to see the long termI mean medium size or big newsportal websites for example how would they do with a lot of different databases and few tables under or with few databases with many tables under Thanksltpgt  ltpgtOne database and only a few tables As I see it you only need two tables for the news portal as you want it One table for the categories and one for the news and you connect it by the id from the category table You dont need ampquotnews tables for each categoryampquot This way you can always add a new category easily by adding a new record to the category tableltbr gtltbr gtregardsltpgt ltpgtCareful with this approach if your news website is VERY busy and you expect to add thousands of articles in a very short time then you might want to create a table for every category as table size will be your enemy in a year or two or even sooner Getting information from 1 huge table will take considerably longer then retrieving information fromltbr gtmultiple small tablesltbr gtltpgt ltpgtLet me ask this wayltbr gtltbr gtAs far as the following considerations below which option is better forget the description in my previous questionltbr gtltbr gtA One database with many tables B About 10 databases with very few tablesltbr gtltbr gtCompare for each criteria below pleaseltbr gtltbr gtSearching dataltbr gtRetrieving dataltbr gtBackupltbr gtUpdatingltbr gtSecurityltbr gtFuture expansions as far as columns or tablesltbr gtltbr gtCan you please compare option A and B for each of these criterialtbr gtltbr gtThanksltpgt ltpgtHiltbr gtltbr gtltbr gtIs the only probable correct answer You do NOT want several databases providing the data for one site except in a few specific situations That is what I would do as well ltbr gtltbr gtThere would still not be the slightest reason to use more than one database Using more than one database unneccesarily complicates the joining of tables to compose the pages you want to show ONE DATABASE only Then decide based on the expectation of the site becoming very busy or not whether you want about two tables or many tablesltbr gtltbr gtIn case of using many tables I would still try to make a compromise one table for categories one general content table containing just essential information of the newsitems like title datatime submitted path to a picture whatever essentially the info needed to build the front page of the site as then one simple join will still be able to show the frontltbr gtindexing page that you want When deciding to use many tables one for each category you need a well thought of naming scheme for the newsitem detail tables as well where I would resist the temptation of using the category name instead or as well include the catID in the table name As you definitely want the table names to be unique Personally I would call them ZZnnsubject where the ZZ serves to keep all the detail tables alfabetically close handy when trying to get a listing of tables or for backing up ZZ at the end of any table listing ampquotsubjectampquot say the first six characters of the subject name stripped of all non ASCII characters and ampquotnnampquot the autonumber ID from the subjects tables Keeping nn before subject again maintains a logical sorting order when doing maintenance your site visitors wont notice after allltbr gtltbr gtampquotwhats in a nameampquotltbr gtltbr gtAnywayltbr gtampgtAs far as the following considerations below which option isltbr gtAAAAAAAAAltbr gtltbr gtThe only doubt there may be is one db with two tables or one db with many tables But again one DBltbr gtltbr gtTwo databases is already too much for running a site off only useful actually when the site has specific subsites like a forum a ampquotlatest newsampquot page user content whatever that can be considered completely separate As soon as any joining of information is involved one database onlyltbr gtltbr gtless tables easier searchingltbr gtltbr gtless tables easier to locate info generally one query less to do the trick but as John noted large table overhead may cost more than gained avoiding the extra queryltbr gtltbr gtEasier with less tables But more flexible and possibly faster with more tables as you will be able to backup only a few Anyway dont store images in BLOB fields in the table it is a backup nightmare as the tables become HUGE And jpgs being virtually uncompressable the backup archive will always be huge as wellltbr gtltbr gtI automated a call center and they record almost all calls Had I opted for storing the calls wav archives as data in BLOBS the database would have crashed already Instead I save them to disk Every once in a while every week the manager takes a DVD transfers 5 G of calls to that DVD and in the call table the calls are marked as not online and the field CDVolume is filled in On the webinterface of the business managers can either see info of a call plus a link to the sound archive or a description of on which DVD to find the recording Had all the data been stored in the table or even in a separate table not only the database probably would hgave crashed already backing up the table would have become a nightmare as well as it would have to be distributed over many DVDsltbr gtltbr gtGuess no difference hereltbr gtltbr gtNot too much difference either Either way you set up your solution you should set it up in such a way that it can be expanded indefinitely one more reason to if you use separate tables for each category include the autonumber ID in the table name That way you wont run out of possibilities for tablenamesltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nn4kEEwtxe_5kC0FRGUysJ0E1s4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nn4kEEwtxe_5kC0FRGUysJ0E1s4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nn4kEEwtxe_5kC0FRGUysJ0E1s4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nn4kEEwtxe_5kC0FRGUysJ0E1s4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/wGDRi6m_NP8" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:04:23 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/database-vs-table.html</feedburner:origLink></item>

<item>
      <title>PHP Email from Windows</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/B4y8HfRzq-U/php-email-from-windows.html</link>
      <description>ltpgtHiltpgtltpgtA guy I work with is developing a site on Windows and he has to test out the mail code PHP ampamp mail are a pain for me at least but I have no clue on windows Can someone suggest a mail server for windows that they use for testing to send and receive mailltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iWu5lECd9bAdr5D6Qigrx2RorTI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iWu5lECd9bAdr5D6Qigrx2RorTI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iWu5lECd9bAdr5D6Qigrx2RorTI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iWu5lECd9bAdr5D6Qigrx2RorTI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/B4y8HfRzq-U" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:56:36 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/php-email-from-windows.html</feedburner:origLink></item>

<item>
      <title>Run scripts in background</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/ejhxzPe_j_E/run-scripts-background.html</link>
      <description>ltpgtCan i run my php script in backgroundltbr gtltbr gtSuppose i want to connect to a server that sends me php script some messages And there is a front end GUI which will display these messages i want to write a script which sits between server and GUI ie receive messages from server and send it to GUI and runs in background countinuouslyltbr gtltbr gtAny help related to this or any idea to solve this type of problemltbr gtltbr gtThanksltpgt  ltpgtYes it does work I have written a script once which compared values in a database and removed doubles The script ran for 72 hours until it completed I ran into problems with out of RAM errors but after some tweaking it worked quite well I had to unset variables after each use You can find more information hereltbr gtltbr gthttpde3phpnetcliltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NrGWmBUAggXvwmijUNC92gvXj14/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NrGWmBUAggXvwmijUNC92gvXj14/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NrGWmBUAggXvwmijUNC92gvXj14/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NrGWmBUAggXvwmijUNC92gvXj14/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/ejhxzPe_j_E" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:55:05 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/run-scripts-background.html</feedburner:origLink></item>

<item>
      <title>RSS to e-mail</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/pveKHsbOOAI/rss-email.html</link>
      <description>ltpgtHello allltpgtltpgtI have looking for some scripts to bridge from RSS to email I can find plenty the go from email generally SMTP to RSS but none the other way aroundltbr gtltbr gtIs anyone here aware of some free simple script for thisltbr gtltbr gtHow good are PHPs XML functions with RSSltbr gtltbr gtAre there any pointers you can offer if I have to write my own scriptsltbr gtltbr gtThanksltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zqAJCpF-XslGlnMN2gzHB9EmD78/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zqAJCpF-XslGlnMN2gzHB9EmD78/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zqAJCpF-XslGlnMN2gzHB9EmD78/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zqAJCpF-XslGlnMN2gzHB9EmD78/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/pveKHsbOOAI" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:51:21 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/rss-email.html</feedburner:origLink></item>

<item>
      <title>Cache problem when generating PDF</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/L1YSyvpfdrg/cache-problem-when-generating-pdf.html</link>
      <description>ltpgtHello guysltbr gtltbr gtltbr gtWe have a report module that generates different types of reports in pdf format We used FPDF classes for thisltbr gtltbr gtThe problem is that when we try to generate one report in one computer a different pdf report is being shown I dont know if it has something to do with the cache file in the server or version no of the browserltbr gtltbr gtReport generation using other PC is working properlyltbr gtltbr gtWhat should I do I need your help Thank youltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tBLKkBk_91MjYcYRU5hd-l76ta4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tBLKkBk_91MjYcYRU5hd-l76ta4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tBLKkBk_91MjYcYRU5hd-l76ta4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tBLKkBk_91MjYcYRU5hd-l76ta4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/L1YSyvpfdrg" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:48:27 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/cache-problem-when-generating-pdf.html</feedburner:origLink></item>

<item>
      <title>Sending emails from form</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/4qj4jrQeInk/sending-emails-from-form_1.html</link>
      <description>ltpgtHello Allltbr gtltbr gtWhat should I put in the to if I want an email sent to a user whose page is being viewed  Heres the pageltbr gthttpmybusinesscirclestartlogiccomeventdetailsphpid29ltbr gtltbr gtAt the bottom there is a link ampquotSponsor this Eventampquot  Please click on the link and see the form  I want the email to go to the email address shown on the previous pageltbr gtltbr gtThanksltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/giZYkAEFS19B3FoA8qsQonFchgE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/giZYkAEFS19B3FoA8qsQonFchgE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/giZYkAEFS19B3FoA8qsQonFchgE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/giZYkAEFS19B3FoA8qsQonFchgE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/4qj4jrQeInk" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:46:45 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/sending-emails-from-form_1.html</feedburner:origLink></item>

<item>
      <title>Preg Replace</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/6iKImMBEQa4/preg-replace.html</link>
      <description>ltpgtI am trying to create some code to edit user input in particular to ensure that there is a space after a periodltbr gtltbr gtThat is I want to change ampquotHello worldHello worldampquot into ampquotHello worldltbr gtHello worldampquotltbr gtltbr gtI have got as far asltbr gtpregreplaceSi ampquot 0ampquot Hello worldHello worldltbr gtwhich gives meltbr gtampquotHello world Hello worldampquotltbr gtltbr gtCan anyone figure out the correct codeltpgt  ltpgtHiltpgtltpgtTry out this oneltbr gtltbr gtpregreplacesi ampquot 1ampquot Hello world Hello worldltbr gtltbr gtIt searches for a  comma with a nonspace character after it and replaces the whole thing with the  commaspace and the nonspace chaacter it have foundltbr gtltbr gtregardsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P68cz-dzyEm3T5IEC1CdAkQFi1M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P68cz-dzyEm3T5IEC1CdAkQFi1M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P68cz-dzyEm3T5IEC1CdAkQFi1M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P68cz-dzyEm3T5IEC1CdAkQFi1M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/6iKImMBEQa4" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:45:41 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/preg-replace.html</feedburner:origLink></item>

<item>
      <title>Cannot display images</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/X1-f7ATmkvQ/strange-problem-cannot-display-images.html</link>
      <description>ltpgtHi all ltpgtltpgtI come across a strange problem but not sure if it is related to the PHP I run a php forum and I post a post with some images which link from another site using ampltimgampgtltbr gtltbr gtBut when I read that pages  no images but the famous error cross image shown I dont know why the images cannot be shown up  so I check the page source I received and it is correct  for example ampltimg borderampquot0ampquot srcampquothttpsomesitecomsomepic jpgampquotampgt  ltbr gtltbr gtTo verify it the ampltimgampgt is correct  I then copy the page source I received and save them  as another html page and open it using theltbr gtbrowser I can then see the picture shown up correctly  so I can confirm that  the ampltimgampgt code and the image link generated by the php is correct ltbr gtltbr gtOnly the images in the post content cannot be displayed  Another images such as the forum header and footer can be displayed correctly  Any idea ltbr gtltbr gtThanks and regardsltpgt  ltpgtLinking to images in this way causes extra bandwidth on the site which is hosting the picturesltbr gtltbr gtFor this reason it is possible for the image hosting site to block your request from your site  Could the other site be doing thisltbr gtltbr gtHave you tried testing by linking to other sites pictures to establish whether this is the caseltpgt ltpgtIf you are hotlinking to a site that doesnt belongs to you the site owner will not be pleased as you are using their bandwidth and could be slowing their site downltbr gtltbr gtDepending on how its hosted it could cost the site owner a great deal of money in excess bandwidth charges If the image is posted on a message board that includes the original message in each reply 10 replies can mean it will display the image 10 times If the message board is well used this can amount to a great deal of stolen bandwidthltbr gtltbr gtThis is exactly what was happening to me a while ago and as I have a great deal of images Hotlinking was using more bandwidth than my own sites visitorsltbr gtltbr gtThe site youre trying to hotlink to is probably using an htaccess file to ban you from doing this It isnt a 100 effective and I now use other methods to stop itltbr gtltbr gtIf the site owner has a daily visitors log they will know where the hotlinking is coming from so expect some complaintsltpgt ltpgtYes   only the pictures linked from one site cannot be shown  Others site has no problems  So the problem is due to the website blocks my request to link their pictures  and I cannot do anything in the php codeltbr gtltbr gtampnbspltpgt ltbr gtltbr gtltbr gtltbr gtThere is one thing you can do allow your users to upload images to YOURltbr gtserver so that you are paying for bandwith and not the operator of theltbr gtwebsite you would be stealing fromltbr gtltbr gtCould you please post your websites URL so that I can ban you from allltbr gtmy serversltbr gtltbr gtThank youltbrgtltbr gt ltpgtNo they have decided that you are stealing bandwidth and wont allow you in there You wont be able to do anything to the code to get inltbr gtltbr gtYou need to right click download etc and keep the pictures on your own siteltbr gtltbr gtHowever if you have been banned from that site perhaps you were in breach of copyright in displaying their pictures on your site in the first placeltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TWiGxY8kg5U9tKL56AquvLbGBhU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TWiGxY8kg5U9tKL56AquvLbGBhU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TWiGxY8kg5U9tKL56AquvLbGBhU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TWiGxY8kg5U9tKL56AquvLbGBhU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/X1-f7ATmkvQ" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 04:43:33 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/strange-problem-cannot-display-images.html</feedburner:origLink></item>

<item>
      <title>Updating mysql db through a simple form</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/FLvjSRof7OI/updating-mysql-db-through-simple-form.html</link>
      <description>ltpgtHiltbr gtltbr gtThe code below takes variables vrb1 through vrb5 from a form and it is supposed to update a database It is displaying the results coming from the form on the screen so the form works correctly but this code can not update the databaseltbr gtdisplaying ampquotI could not update the databaseampquot as below  and when I check it isltbr gtreally not updated Can anybody tell me why it can not update the database Theltbr gtcolumns written here also match with database columnsltbr gtltbr gtampltphpltbr gtConnect To Databaseltbr gthostnameltbr gtusernameltbr gtpasswordltbr gtdbnameltbr gtusertabletable1ltbr gtltbr gtmysqlconnecthostnameusername password OR DIE Unable to connect toltbr gtdatabase Please try again laterltbr gtmysqlselectdbdbnameltbr gtvrb1POSTvrb1ltbr gtvrb2POSTvrb2ltbr gtvrb3POSTvrb3ltbr gtvrb4POSTvrb4ltbr gtvrb5POSTvrb5ltbr gtecho ampquotupdated database as follows ampquot  ltbr gtltbr gtecho vrb1 vrb2 vrb3 vrb4 vrb5ltbr gtqueryampquotINSERT INTO table1 iid title1 par1 par2 par3 VALUESltbr gtvrb1vrb2vrb3vrb4vrb5ampquotltbr gtmysqlqueryquery or die  I could not update the databaseltbr gtampgtltpgt  ltpgtYou havent told us anything about your table structure so we have to make a guess to attempt to help you  You can get the MySQL error by adding something like this to the die part of the statementltbr gtltbr gtor dieI could not update the databaseamplthrampgt  mysqlerror  amplthrampgt ltbr gtqueryltbr gtltbr gtThe mysqlerror function will display the last error message supplied by the MySQL serverltbr gtltbr gtMy prediction is that your column is not named ampquotiidampquot but rather ampquotidampquot  I also wonder about the ampquot1ampquot after ampquottitleampquot  Again these are issues we could more directly resolve with info about the table structure ie the output of a ampquotDESCltbr gttable1ampquot queryltbr gtltbr gtI also dont see quotes around your values and this is another problem whichltbr gtwould cause your query to failltbr gtltbr gtqueryampquotINSERT INTO table1 iid title1 par1 par2 par3 VALUESltbr gtvrb1vrb2vrb3vrb4vrb5ampquotltbr gtltbr gtI find it easy to make an error with the INSERT syntax you have  I wouldltbr gtnormally useltbr gtltbr gtqueryampquotINSERT INTO table1 SET iidvrb1 title1vrb2 par1vrb3ltbr gtpar2vrb4 par3vrb5ampquotltbr gtltbr gtThis way you have the fieldcolumn names next to their corresponding valuesltbr gtltbr gtI know you are just beginning but you will want to look at validating the data received from the form to make sure that it is the kind of information you are expecting  This form would be vulnerable to SQL Injection which could cause some nasty surprises down the roadltpgt ltpgtHiltbr gtltbr gtThe whole depends on what kind of date are you inserting in the database but I assume title is a string Strings and basically every other kind of data except integers have to be in single or double quotes when you give it in the sql syntax So basicly the line should look like thisltbr gtltbr gtqueryampquotINSERT INTO table1 iid title1 par1 par2 par3 VALUESltbr gtvrb1vrb2vrb3vrb4vrb5ampquotltbr gtltbr gtOr by escaping the double quotesltbr gtltbr gtqueryampquotINSERT INTO table1 iid title1 par1 par2 par3 VALUES vrb1ltbr gtampquotvrb2ampquotampquotvrb3ampquotampquotvrb4ampquotampquotvrb5ampquotampquotltbr gtltbr gtregardsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MJ1PBcC4nBg15g_Fr7SzxVzvotQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MJ1PBcC4nBg15g_Fr7SzxVzvotQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MJ1PBcC4nBg15g_Fr7SzxVzvotQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MJ1PBcC4nBg15g_Fr7SzxVzvotQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/FLvjSRof7OI" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:43:21 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/updating-mysql-db-through-simple-form.html</feedburner:origLink></item>

<item>
      <title>php connect to mysql</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/fvSIRTIpWCw/php-connect-mysql.html</link>
      <description>ltpgtHiltpgtltpgtI copied this from somewhere as I want to connect to mysql using php for the first time but when I execute the program below there is only blank screen I already inserted a test row to my tableltbr gtltbr gt1In the program below what does yourfield refer toltbr gtltbr gt2Isnt this supposed to display the contents of my table It is not displaying anythingltbr gtltbr gtAll I want is a simple program thatwill enable me to run sql queries ltbr gtpreferably in a form format Can someone help Thanksltbr gtltbr gtampltphpltbr gtConnect To Databaseltbr gthostnameltbr gtusernameltbr gtpasswordltbr gtdbnameltbr gtusertableltbr gtyourfield  ltbr gtmysqlconnecthostnameusername password OR DIE Unable to connect toltbr gtdatabase Please try again laterltbr gtmysqlselectdbdbnameltbr gtquery  SELECT  FROM usertableltbr gtresult  mysqlqueryqueryltbr gtifresult ltbr gtwhilerow  mysqlfetcharrayresultltbr gtname  rowyourfieldltbr gtecho Name nameltbr gtltbr gtltbr gtampgtltbr gtltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TV_hq-rt5ecmWjvCPgh8_s-dSxI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TV_hq-rt5ecmWjvCPgh8_s-dSxI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TV_hq-rt5ecmWjvCPgh8_s-dSxI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TV_hq-rt5ecmWjvCPgh8_s-dSxI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/fvSIRTIpWCw" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:35:42 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/php-connect-mysql.html</feedburner:origLink></item>

<item>
      <title>Date cant print past April 4th</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/rn3Pb3W2Xcc/date-cant-print-past-april-4th.html</link>
      <description>ltpgtHiltpgtltpgtI have been working on some code and another programmer just pointed out that the Date is not moving past April 4thltbr gtltbr gtThis code just now in a file all its ownltbr gtampltphp print dateF n Y  gi a ampgtltbr gtltbr gtproduces April 4 2008 1122 amltbr gtltbr gtwhile this codeltbr gtsystemdateltbr gtltbr gtproduces Fri Apr 11 112108 CDT 2008ltbr gtltpgt  ltpgtIn the date function a lower case ampquotnampquot shows the numeric representation for the month  You want ampquotdampquot for a 2digit with leading zeros or ampquotjampquot without leading zerosltbr gtltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sYw-7BCzJeE5tW-qseLpH_Mu-GI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sYw-7BCzJeE5tW-qseLpH_Mu-GI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sYw-7BCzJeE5tW-qseLpH_Mu-GI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sYw-7BCzJeE5tW-qseLpH_Mu-GI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/rn3Pb3W2Xcc" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:33:04 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/date-cant-print-past-april-4th.html</feedburner:origLink></item>

<item>
      <title>Enable sockets</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/QPsuMDRCVhk/enable-sockets.html</link>
      <description>ltpgtHiltpgtltpgtI am using Solaris 9 and i did installed SAMP package from Companion CD When i check the phpinfo  it shows that the sockets functions are not enabled here is there any method to enable these When i try to write socket functions in my php code it does not do any thing How to enable sockets ltpgtltpgtThanksltbr gtampnbspltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qCU1m7xVrampu7ZC68iAV8ONKWg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qCU1m7xVrampu7ZC68iAV8ONKWg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qCU1m7xVrampu7ZC68iAV8ONKWg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qCU1m7xVrampu7ZC68iAV8ONKWg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/QPsuMDRCVhk" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:30:18 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/enable-sockets.html</feedburner:origLink></item>

<item>
      <title>A Web Chat using MSN/Gtalk protocol</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/gjJhQHIJtbc/web-chat-using-msngtalk-protocol.html</link>
      <description>ltpgtHelloltbr gtltbr gtI need help to integrate PHP with MSN or other IM protocol Gtalk ICQ etc to make a web chat into a websites client My cliente will have a MSN login and when a new user login into his chat system website i have to create a new MSN user guest and all messages that this guest send on chat I need send it to the msn of my client My client will receive the message in his msn and will reply that to the user so I need get this reply and show to the user on the web contextltbr gtltbr gtltbr gtThanksltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Wip1-G5o6KCMZh9bd4-GxPPqnR8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wip1-G5o6KCMZh9bd4-GxPPqnR8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Wip1-G5o6KCMZh9bd4-GxPPqnR8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wip1-G5o6KCMZh9bd4-GxPPqnR8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/gjJhQHIJtbc" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:27:17 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/web-chat-using-msngtalk-protocol.html</feedburner:origLink></item>

<item>
      <title>Actual code for `next` &amp; `previous` record retrieval</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/biwOlSQ_V68/actual-code-next-amp-previous-record-retrieval.html</link>
      <description>ltpgtHi Allltbr gtltbr gtI know similar questions have been asked and Ive spent all day trawling through them on this and other groupsltbr gtltbr gtbut I am very very new to PHP ampamp mysql and I have been working on a test site to learn some realworld applicationltbr gtltbr gtI have a page which has an image and a text description of that imagebunder it I would like to remain on the same page and replace the image ampamp text each time a next or previous button or text link is clickedltbr gtltbr gtI have a working database and a queryltbr gtltbr gtquery  ampquotSELECT Pic Text FROM bucketofweasels ORDER BY Picid ASCltbr gtLIMIT 012ampquot ltbr gtltbr gtWhich returns the first of my images and I understand thatltbr gtltbr gtquery  ampquotSELECT Pic Text FROM bucketofweasels ORDER BY Picid ASCltbr gtLIMIT 112ampquot ltbr gtltbr gtReturns the next row  this is fine except I would like the new image ampamp text to replace the existing one But what I would like toltbr gtknow is what does the code for the next ampamp previous links look like Does the whole thing have to be in a formltbr gtltbr gtThanks all  I hope to look back and laugh at my ignorance in week or twoltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/E-NWAhg8PQHXPrMdDn3tu-q3hfM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E-NWAhg8PQHXPrMdDn3tu-q3hfM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/E-NWAhg8PQHXPrMdDn3tu-q3hfM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E-NWAhg8PQHXPrMdDn3tu-q3hfM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/biwOlSQ_V68" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:25:24 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/actual-code-next-amp-previous-record-retrieval.html</feedburner:origLink></item>

<item>
      <title>url query of a get form</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/J_D0F9_OvB0/url-query-form.html</link>
      <description>ltpgtHelloltbr gtltbr gtI have a get form in a web page Normally the resulting url of the form looks as something likeltbr gtltbr gthttpwwwwebsitecomsearchphpq1term1ampampq2term2ampampq3term3ltbr gtltbr gtId much rather have the resulting url as follows insteadltbr gthttpwwwwebsitecomsearchterm1term2term3ltbr gtltbr gtAnyone can help how I can make this happenltbr gtltbr gtThank youltpgt  ltbrgtThis is an Apache issue Read up on the MOD REWRITE function below and placeltbr gtthe directives in a file called htaccessltbr gtltbr gthttphttpdapacheorgdocs20miscrewriteguidehtmlltbr gtltbr gthttpwwwilovejackdanielscomcheatsheetsmodrewritecheatsheetltbrgtltbr gt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hVIcWqcsNaEbzWpzg_0VREOl9qY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hVIcWqcsNaEbzWpzg_0VREOl9qY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hVIcWqcsNaEbzWpzg_0VREOl9qY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hVIcWqcsNaEbzWpzg_0VREOl9qY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/J_D0F9_OvB0" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:22:14 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/url-query-form.html</feedburner:origLink></item>

<item>
      <title>Communication with other applications</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/oaNW2SQyQGI/communication-other-applications.html</link>
      <description>ltpgtHiltpgtltpgtI am new in PHP and facing a problem in using it I have an application not in php which is trying to connect on a specific IP and port 8060 After connection it will send messages on that port I want to write a php script that can communicate with that application i am working at Solaris9 Any guideltbr gtThanksltbr gtltpgt  ltpgtHiltpgtltpgtPHP is geared to the HTTP protocol ie connect  request  response  disconnectltbr gtltbr gtPHP can make outgoing port connections for more complex protocols but it is not good for complex incoming protocols It can be done but dont expect complex duplexingltbr gtltbr gtTell us what protocol you are using and perhaps we can offer more informationltbr gtltbr gtThanksltpgt ltpgtYoure looking for socket connections Hopefully this link will get you on your wayltbr gthttpus3phpnetsocketsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ysgiyuju6PnKpzYXeTv-IVASpFs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ysgiyuju6PnKpzYXeTv-IVASpFs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ysgiyuju6PnKpzYXeTv-IVASpFs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ysgiyuju6PnKpzYXeTv-IVASpFs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/oaNW2SQyQGI" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Jul 2009 01:20:59 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/communication-other-applications.html</feedburner:origLink></item>

<item>
      <title>Adding attachments to e-mails from a form</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/NexPm_EMGZk/adding-attachments-emails-from-form.html</link>
      <description>ltpgtHiltpgtltpgtas per the titleltbr gtltbr gtIve got a form where the user inputs there own name email address subject and then from 2 dropdown selection menus select the type of email being sent and who to send it toltbr gtltbr gtIve googled a few scripts but from my understanding they will only send files currently on the webserver and who its being sent to isltbr gtstaticmaybe im missing somethingltbr gtltbr gtThe Current Code httpfilesiarpcaDocumentswebsitecontacttxtltbr gtWebsite Beta Page httpmohaiarpcacontactphpltbr gtltbr gtIs there any way to allow someone to attach a file without uploading to the web serverltpgt  ltpgtQ Is there any way to allow someone to attach a file without uploading to the web serverltbr gtltbr gtA Noltbr gtltbr gtYou have to upload the file to the tmp directory first send it via email and then delete itltpgt ltpgtOk now other things ive noticed like the attachment link isnspecific such as imagejpeg would i have to make a huge if elseif tree for all different types to upload and then delete later onltpgt ltpgtHiltbr gtltbr gtThis depends on if you trust what the browser sends as a MIME typeltbr gtltbr gtIf the browser sends a MIME type then it will be in ltbr gtFILESuserfiletype however any hacker can spoof the MIME type Thisltbr gtmay be a problem depending on what sort of emails you are sendingltbr gttextattachment or HTMLattachment ie  Are the imagesor other objectsltbr gtgoing to be in the email or just an attachmentltbr gtltbr gtIf you are only allowing image type uploads then the actual MIME type can beltbr gtextracted with the parts of the GD image functionsltbr gtltbr gtFor more information google RFC2387ltpgt ltpgtText only and i believe they would only be sending excel filesltbr gtjpegs and gifs Theyd just be an attachment i do realize theltbr gtpeople receiving these emails arent the best at recognizing badltbr gtemails as ive had to reformat there computers several times becauseltbr gtof virus overrun ill check into the google idea see what that bringsltbr gtup Id try not to let any form of script run in the email sent to themltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PuPG1nDoCp5mRN8o2RE5_HqWqgU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PuPG1nDoCp5mRN8o2RE5_HqWqgU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PuPG1nDoCp5mRN8o2RE5_HqWqgU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PuPG1nDoCp5mRN8o2RE5_HqWqgU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/NexPm_EMGZk" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Jul 2009 23:55:05 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/adding-attachments-emails-from-form.html</feedburner:origLink></item>

<item>
      <title>PHP Function Reference Dashboard Widget</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/7hDUYwwpFEY/php-function-reference-dashboard-widget.html</link>
      <description>ltpgtHi allltbr gtltbr gtJust a quick note to let you everyone know that my PHP Function Reference widget for Mac OS Xs Dashboard just went to version 10 Im excited to share this news as this widget has been in beta for over 2 years no joke More information is available hereltbr gtltbr gthttpandrewhedgesnamewidgetsphpfrltbr gtltbr gtAlso its open source so if anyone here wants to contribute head over to the project home on Google Code at the following URL this is also the place to file bug reports and feature requestsltbr gthttpcodegooglecompphpfrltbr gtltbr gtEnjoyltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IZStuKNrzmj5PHAUs5AUlaCXaaQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IZStuKNrzmj5PHAUs5AUlaCXaaQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IZStuKNrzmj5PHAUs5AUlaCXaaQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IZStuKNrzmj5PHAUs5AUlaCXaaQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/7hDUYwwpFEY" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Jul 2009 23:11:16 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/php-function-reference-dashboard-widget.html</feedburner:origLink></item>

<item>
      <title>Comparing values</title>
      <link>http://feedproxy.google.com/~r/DiigitTopArticles/~3/3RVu43O5euI/comparing-values.html</link>
      <description>ltpgtSomething Ive always been meaning to askltbr gtIf going thro a large amount of data does it matter whether I compare the value to the array item or visaversaltbr gtltbr gtcolr  arrayred blue green etcltbr gtexample 1ltbr gtforeachcolr as item ltbr gtif item  blueltbr gt Do somethingltbr gtltbr gtexample 2ltbr gtforeachcolr as item ltbr gtif blue  itemltbr gt Do somethingltbr gtltbr gtltbr gtObviously example 1 is more readable But I seem to remember reading that one is more beneficial but dismissed it at the timeltbr gtThanksltpgt  ltpgtI have seen some suggest using the comparison you have in example 2 because you will get a parse error if you try to use a single equal sign assignment instead of a double equal comparison  PHP will cheerfully take the first example and if you have a single equal sign it will make the assignment and the resulting expression will be true unless the value is 0ltbr gtltbr gtLooping through an array for a value might be better served with arraysearch or arraykeys depending on whether you wantexpect only one value or multiple occurrences of the value in the search array  For an array with a dozen or 100 items it probably doesnt make a noticeable difference but larger arrays could benefit from using the optimized functions for this purposeltbr gtltpgt ltpgtAlso remember that the failsafe way to compare strings is not withltbr gt but using strcmp You might run into trouble if you compare twoltbr gtnumeric strings using   for example ampquot1ampquot  ampquot1ampquot which might notltbr gtbe what you wantltpgt ltpgtHiltpgtltpgtThanks for your replyltbr gtYes I use strcmp which is really useful but you have to be careful with itltbr gtltbr gtAn exampleltbr gtif strcmpPOSTuser SESSIONpin  0ltbr gtwill match if both variables are blankltbr gtltbr gtYou still need to check that both variables have a value and the values are what you would expect to receiveltbr gtIf theres PHP and a variable involved someone will try and do something they shouldnt  with it you can guarantee on that ltpgtltpgtRegardsltpgt
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OKCjfvp_4hiRhEYZ4xeveA2BeEA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OKCjfvp_4hiRhEYZ4xeveA2BeEA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OKCjfvp_4hiRhEYZ4xeveA2BeEA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OKCjfvp_4hiRhEYZ4xeveA2BeEA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DiigitTopArticles/~4/3RVu43O5euI" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Jul 2009 23:09:14 PDT</pubDate>
   <author><name /></author>
   <category><a href="http://.diigit.com/php-ask-questions/category/php.html">PHP</a></category>      
<feedburner:origLink>http://php.diigit.com/php-ask-questions/comparing-values.html</feedburner:origLink></item>
   </channel>
</rss>
