Jump to content

dhope

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dhope's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I have just started creating my first class in php. I'm trying to assign $_SERVER['REMOTE_ADDR']; to a protected variable but I keep getting an error message. I'm still trying to get my head around oop php. My current code is "protected $user_ip = $_SERVER['REMOTE_ADDR'];" and the error message is "Parse error: syntax error, unexpected T_VARIABLE".
  2. I will give them a try, thanks
  3. Hi, Is there away to enable system() for one of my websites? At the moment i'm receiving the following error message "system() has been disabled for security reasons". Thanks for any help.
  4. Fixed - http://www.php.net/manual/en/security.magicquotes.disabling.php
  5. Hi, I was hoping someone could help me with HTML Purifier. When I use HTML Purifier in xampp it works perfectly, but when I use the same code on my server it strips everything. Has anyone any ideas why this is? HTML Purifier Code: $config = HTMLPurifier_Config::createDefault(); $config->set('Attr.EnableID', true); $purifier = new HTMLPurifier($config); $def = $config->getHTMLDefinition(true); $def->addAttribute('a', 'target', new HTMLPurifier_AttrDef_Enum( array('_blank','_self','_target','_top') )); $html_sidebar_form = $purifier->purify($_POST['html_sidebar_form']) XAMPP HTML: <div id="sidebar_container"><div id="sidebar_heading"><h2>Contact details</h2></div><div id="sidebar_content"><p><strong>Phone</strong>: 0845 095 1142</p></div></div><div> <div><h2>Free Quotation</h2></div><div> <a href="index.php">hello</a> <p>Name:<br /></p> <p>E-mail Address: <br /></p> <p>Phone Number: <br /></p> <p>Enquiry:<br /></p> </div></div> Server HTML: <div><div><h2>Contact details</h2></div><div><p><strong>Phone</strong>: 0845 095 1142</p></div></div><div> <div><h2>Free Quotation</h2></div><div> <p>Name:<br /></p> <p>E-mail Address: <br /></p> <p>Phone Number: <br /></p> <p>Enquiry:<br /></p> </div></div>
  6. Hi, How do you create a folder in the main dir (public_html) when you are a few folders deep? My code... mkdir("../../../../../filestore/images/$page_id/", 0644); I seem to get an error each time failing to create the folder. Is there away to go direct to the public html folder? Thanks for any help.
  7. Hi, I currently have a simple mysql statement which pulls out all of the fields between two given dates. The statement works fine until you increase the end date. Code... $start_date = "01/07/2011"; $end_date = "15/07/2011"; $result = mysql_query("SELECT * FROM sales WHERE sale_date BETWEEN '$start_date' AND '$end_date'"); ------- This works fine up until I increase the end date above the 15th then it seems to drag everything in regardless of the date. Any ideas, is there anyway I can improve this code to make it work? Thank you
  8. Hi, I know that it is possible to block access to a website during certain times, but is it possible to block access to my website during the weekends? Thank you Damian
  9. Hi, thank you for the help What would be the best way of doing this that wouldn't lead to being hacked?
  10. Hi, Is it possible to use an array to store a while loop? I am trying to retrieve some information from my database to store in an array. I am trying to store about five of my customer id's, I thought this way was possible and that I had done it before. unfortunately I am getting the following error "Fatal error: [] operator not supported for strings" if possible please can someone point me in the right direction. Is there an easy for me to store all of the ids that come from the database? My code so far... $result = mysql_query("SELECT * FROM customers WHERE $search_field = \"$search_term\"") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { $customer_id[] = $row['id']; } Thank you
  11. Thank you. Is there away to update the css/image links without changing them on the page?
  12. Hi, If possible I would like the user to see "www.mydomain.com/pages/services" and the server to call "www.mydomain.com/services.php".
  13. Hi, I currently have the following code in my .htaccess to remove the .php extension from my files. RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php How would I change this so that "www.mydomain.com/services" becomes "www.mydomain.com/page/services" I'm not really that clued up on mod_rewrite, please can someone point me in the right direction. Thank you
  14. Hi, I am creating a page editor for my site and I was wondering if there was a way to disable the javascript and flash use on a page when I load it up in the editor. At the moment when the page loads up the flash and javascript are interfering with the editor. I hope this makes sense Thanks in advance
  15. Yes, I have set a hidden field to update_towns so that I can check if the form has been submitted, i'm not sure if there is a better way of doing this. The foreach doesn't seem to loop through it just seems to print out the final checkbox that was selected.
×
×
  • 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.