Search Results

Search found 4 results on 1 pages for 'kitenski'.

Page 1/1 | 1 

  • Ampersand in link description text?

    - by kitenski
    I am validating my site using validator.w3.org and have an issue where there is a & in my link description text. ie this is taken from the source <a class='tag' href='/php/iphone software.php?function=developer&amp;dev=witch%26wizards+inc.&amp;store=143441'>witch&wizards inc.</a> Which gives me this error in the validator Line 188, Column 540: cannot generate system identifier for general entity "wizards" …6wizards+inc.&store=143441'witch&wizards inc. If I urlencode the description then the validation passes, but the user then sees the text displayed urlencoded, ie Developer witch%26wizards+inc. However I believe it's much more user friendly if this was displayed unencoded, ie Developer witch&wizards inc. Is there a way to pass validation but still have user friendly text displayed? Thanks, Greg

    Read the article

  • Using CURL within a loop to download a file, 1st one works, 2nd one times out

    - by kitenski
    Morning all, I am using CURL to download an image file within a loop. The first time it runs fine and I see the image appear in the directory. The second time it fails with a timeout, despite it being a valid URL. Can anyone suggest why it always fails on the 2nd time and how to fix it? The snippet of code is: // download image $extension = "gif"; $ch = curl_init(); curl_setopt($ch, CURLOPT_TIMEOUT, 90); curl_setopt($ch, CURLOPT_URL, $imgurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); echo $imgurl . " attempting to open URL "; $i = curl_exec($ch); if ( $i==false ) { echo curl_errno($ch).' '.curl_error($ch); } $image_name=time().'.'.$extension; $f = fopen('/fulldirectorypath/' . $image_name ,'w+'); fwrite($f,$i); fclose($f); I have put an echo in there to display the $IMGURL, to check it is valid, and upped the timeout to 90 secs, but it still fails. This is what I see on screen: http://images.eu-xmedia.de/thumbnails/34555861/5676051/pt=pic,lang=2,origfile=yes/image.gif attempting to open URL 28 Operation timed out after 90 seconds with 0 bytes received an empty file is created in my directory. thanks alot, Greg

    Read the article

  • How can I convert German characters during XML read and PHP write into mysql?

    - by kitenski
    Morning, I am inputting data from an XML file into my database, but have any isse with German words (that are in the XML by mistake) For example the word für appears in my XML as für and thus appears the same in my database. I know I could do a simple search/replace for that exact phrase, but I was wondering if there was a smarter way to do it as I can't predict if any other German words may one day appear in the XML? ADDING SOME MORE DETAIL The XML source says: and in my PHP I have $domString = utf8_encode($dom-saveXML($element)); If I look into the XML file before I start reading it, it has - <title> - <![CDATA[ CoPilot Live v8 Europa für Android 8.0.0.644 ]]> </title> Thanks. Greg

    Read the article

  • Multiple case or switch commands in php?

    - by kitenski
    Good Afternoon, I am trying to assign some variables to a listing which has a main category and a subcategory. This works fine for most of the variables, however in each sub category there are some fields which are other. ie Main Category 1 has sub category database, development and other Main Category 2 has sub category email, internet and other Main Category 3 has sub category graphics and other. So my first case statement is as follows which works fine. switch ($main_cat) { case "Main Category 1": $main="79"; break; case "Main Category 2": $main="83"; break; case "Main Category 3": $main="87"; break; } However I am struggling as to how to handle other. This stops the whole page loading with no error message switch ($second_cat) { case "Database": $second="145"; break; case "Development": $second="146"; break; case "Other": if ($main_cat) == 'Main Category 1' { $second="147";} break; } This doesn't work at all, second is not changed. switch ($second_cat) { case "Database": $second="145"; break; case "Development": $second="146"; break; case "Other": switch ($main_cat) { case "Main Category 1": $second="147"; break; } }

    Read the article

1