Jump to content

ravix76

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    West Yorkshire, United Kingdom

ravix76's Achievements

Member

Member (2/5)

0

Reputation

  1. I had a script which converted my dynamically produced pages into static HTML. This was to ease indexing and reduce server loads. Following a host move, to one which has PHP5, I can no longer get the script to work: <?php # Set Names for Static Build Pages $sourcepage = "http://www.mysitename.com/dynamicfiles/productpage.php?id=".$row['id']."; $tempfilename = "../dynamicfiles/temp_file.php"; $targetfilename = "../".$branddirectory.$productfilename; # Run PHP Conversion $htmldata = file_get_contents($sourcepage); ?> I get the error: "URL file-access is disabled in the server configuration" and after some hunting around, understand this is due to a change in PHP5, related to "allow_url_fopen". Can anyone recommend a work around or do I need to enable "allow_url_fopen"?
  2. I have a user inputted string which I which to refine for use as a filename. The string might include special characters such as £ % etc which I want to strip out or substitute. I'll then convert to lowercases, append a file extension and use it for the uploaded file / image. I having difficulty making the string safe for filename use. I essentially want to strip out any non a-z or 0-9 characters and strip out any spaces (or substitute with a dash). So "CrazyDave's Upload!" would become "crazydaves-upload.jpg" Do I need regular expressions? <-- seems like a deep topic! Thanks
  3. Thanks! New to this and thought I was going mad!
  4. I'm trying to add some Escaped Data to a MYSQL 5 Database. Variable when input is test"security I then escape it with mysql_real_escape_string (); As a test, I echo the variable before submitting to the db and it shows as test\"security But then when I view it in myPHPAdmin after submission, it appears as test"security i.e. not escaped I'm obviously wanting to protect against SQL injection and am a little baffled! Cheers Ravix
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.