Jump to content

linardzb

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by linardzb

  1. Shared hosting: MySQL Server version: 5.0.92-50-log WebServer: MySQL client version: 5.1.66 which provides Info NOTE: Your PHP MySQL library version 5.1.66 differs from your MySQL server version 5.0.92. This may cause unpredictable behavior. Which I checked, and aparently it needs to updated via: yum update php Local Server: MySQL Server version: 5.5.8-log WebServer Apache/2.2.17 (Win32) PHP/5.3.5 MySQL client version: mysqlnd 5.0.7-dev - 091210 Yhank you for the help
  2. Hey, just got my hands on local host, and it seems that the code <?php $objBusiness = new Business(); $business = $objBusiness->getBusiness(); ?> is working, whereas on on shared hosting still not working, any thoughts? Cheers
  3. Thanks Jessica, thats exactly the case, trying to sort this out for ages, Cheers
  4. To Jessica, Right, where do I look for the php.ini file to change it, and how do I debug that parse error? Hope it make sense now
  5. This is Directory access code: <?php if(!isset($_SESSION)) { session_start(); } // site domain name with http defined("SITE_URL") || define("SITE_URL", "http://".$_SERVER['SERVER_NAME']); // directory separator defined("DS") || define("DS", DIRECTORY_SEPARATOR); // root path defined("ROOT_PATH") || define("ROOT_PATH", realpath(dirname(__FILE__) . DS."..".DS)); // classes folder defined("CLASSES_DIR") || define("CLASSES_DIR", "classes"); // pages directory defined("PAGES_DIR") || define("PAGES_DIR", "pages"); // modules folder defined("MOD_DIR") || define("MOD_DIR", "mod"); // inc folder defined("INC_DIR") || define("INC_DIR", "inc"); // templates folder defined("TEMPLATE_DIR") || define("TEMPLATE_DIR", "template"); // emails path defined("EMAILS_PATH") || define("EMAILS_PATH", ROOT_PATH.DS."emails"); // catalogue images path defined("CATALOGUE_PATH") || define("CATALOGUE_PATH", ROOT_PATH.DS."media".DS."catalogue"); // add all above directories to the include path set_include_path(implode(PATH_SEPARATOR, array( realpath(ROOT_PATH.DS.CLASSES_DIR), realpath(ROOT_PATH.DS.PAGES_DIR), realpath(ROOT_PATH.DS.MOD_DIR), realpath(ROOT_PATH.DS.INC_DIR), realpath(ROOT_PATH.DS.TEMPLATE_DIR), get_include_path() )));
  6. Thanks Jessica, The one option I could find out was /usr/local/php52/etc/php.ini, but it is not on my server, is it on host? Sorry for dumb question.
  7. Thank you PFMaBiSmAd, I tried to run the code you suggested in _header.php and index.php, seems not be working.
  8. Sorry for dumb question, shall I throw it in index.php or _header.php ? cheers
  9. I double checked the path to files, and it all seems fine.
  10. Thanks for looking in, the problem is that PHP does not throw any error, it is just hosting internal server error.
  11. Hi, Im having a nightmare (very newbie to PHP) to display a webpge which changes the title dinamically with PHP scripts that Im sure are correct. Instead it gives me ERROR 500. As well as hosting provider is not sure if my directory structure is correct, again Im very positive it is correct, trying to sort this bugger out for ages. I will add a png file for directory overview. Can someone please have alook at this example: http://www.origin-designs.co.uk/ 1. All goes wrong when I add this script to my _header.php: <?php $objBusiness = new Business(); $business = $objBusiness->getBusiness(); ?> 2. This is Business class script: <?php class Business extends Application { private $_table = 'business'; public function getBusiness() { $sql = "SELECT * FROM `{$this->_table}` WHERE `id` = 1"; return $this->db->fetchOne($sql); } public function getVatRate() { $business = $this->getBusiness(); return $business['vat_rate']; } public function updateBusiness($vars = null) { if (!empty($vars)) { $this->db->prepareUpdate($vars); return $this->db->update($this->_table, 1); } } } will provide you with further information if needed. Many thanks.
  12. Right, there is no error message at all, it is just not running the code properly. It sort of reloads the page and thats it.Thanks
  13. linardzb

    Forms

    Hi, my php code seems to be not working, perhaps someone can spot the problem. May thanks. <?php //Make sure that PATH_INFO is set, and not ORIG_PATH_INFO as some hosts seem to use. if (isset ($_SERVER['ORIG_PATH_INFO']) && $_SERVER['ORIG_PATH_INFO'] != $_SERVER['PHP_SELF']) { $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; } if (!empty ($_SERVER['PATH_INFO']) && strrpos ($_SERVER['PHP_SELF'], $_SERVER['PATH_INFO'])) { $_SERVER['PHP_SELF'] = substr ($_SERVER['PHP_SELF'], 0, -(strlen ($_SERVER['PATH_INFO']))); } ?> <?php $error = false; $sent = false; if(isset($_POST['name'])) { if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['comments'])) { $error = true; } else { $to = "[email protected]"; $name = trim($_POST['name']); $email = trim($_POST['email']); $comments = trim($_POST['comments']); $subject = "Contact Form"; $messages = "Name: $name \r\n Email: $email \r\n Comments: $comments"; $headers .= 'From: '.$name.' <'.$email.'>' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From:" . $name . "\r\n"; $mailsent = mail($to, $subject, $messages, $headers); if($mailsent) { $sent = true; } } } ?>
  14. Hi, tried your superglobal approach, nothing, im xrossed now, been trying to fix this for 2 whole days, people seem to be offering solutions, but nothing comes out of it. Thanks anyway
  15. Thank you for the sanitation snippet.
  16. Hi, Im trying to submit the email through the online contact page http://www.origin-designs.co.uk/. I cannot receive emails through it, im not sure where is the problem with the code. It seems to be working fine for other people through fiddle or some other tool. I'm providing the code for the form too. any feedback welcome, cheers <?php $error = false; $sent = false; if(isset($_POST['name'])) { if(empty($_Post['name']) || empty($_POST['email']) || empty($_POST['comments'])) { $error = true; } else { $to = "[email protected]"; $name = trim($_POST['name']); $email = trim($_POST['email']); $comments = trim($_POST['comments']); $subject = "Contact Form"; $messages = "Name: $name \r\n Email: $email \r\n Comments: $comments"; $headers = "From:" . $name; $mailsent = mail($to, $subject, $messages, $headers); if($mailsent) { $sent = true; } } } ?> And my HTML is <?php if($error == true) { ?> <p class="error"></p> <?php } if($sent == true) { ?> <p class="sent"></p> <?php } ?> <div id="form"> <form name="contact" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <fieldset> <h4>Contact Me!</h4> <label for="name">Name:</label> <input type="text" name="name" id="name"/> <label for="email"/>Email:</label> <input type="text" name="email" id="email"/> <label for="comments" id="comments">Comments:</label> <textarea name="comments" id="" width="90%"></textarea> <fieldset> <input class="btn" type="submit" name="submit" class="submit" value="Send email"/> <input class="btn" type="reset" value="Reset"/> </fieldset> </fieldset> </form>
×
×
  • 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.