
magnetica
Members-
Posts
206 -
Joined
-
Last visited
Never
Everything posted by magnetica
-
So just the images?? Do the colors work together? Is the layout ok?
-
Hi all I have spent a few weeks creating a site where people can find and buy products and read reviews from across many sites. If you've got the time take a moment to take a look and letme know what you think e.g. colors, layouts, errors, etc http://www.googlebasesearch.com/ Thanks in advance, Magnetica
-
security question regarding processing forms
magnetica replied to jeff5656's topic in PHP Coding Help
So long as you check the data with PHP then everything should be ok. The only reason someone would make a copy form is to avoid client side validating easier. Plus you can't stop them from doing so.. After you filter the input, if you are going to output any tainted data then its always customary to escape the output before display.. Filter Input then Escape Output... and all your security problem will go away. Apart from some more complex websecurity issues -
Perfect. Told you it'd be simple! Thanks alot AlexWD
-
Hi all I am grabbing the _SERVER['REQUEST_URI'] and trying to compare it but this doesnt work $currpage = $_SERVER['REQUEST_URI'];//when i echo this i get ' / ' $home = '/'; //but this doesnt work if(strpos($currpage, $home)){echo 'test works';} PS It will work if i use if($currpage == $home){echo 'test2';} Any ideas? Thanks, Magnetica
-
Goto mediafire and download a file look at the link and construct a regex expression according to their url for downloading files
-
Hi all If there a better way of setting variables within classes than taking it through the __construct and setting via $this ?? e.g. class SectionsConnect { protected $var; public function __construct($var){ $this->var= $var; } } Can you not set the variable automatically as it comes in through the __construct? Thanks Magnetica
-
Thanks alot Zanus.. Can't see it getting more complicated then the characters you have put there
-
Such as â.. What character it is could be any? Is there a function to convert of replace letters by encoding?
-
Hi all I was wondering if you are able to replace such characters as â with a in php? Regards Magnetica
-
Hi All I was wondering how important it is to unset() all your variables once used? Most of my code is object oriented so the functions discard any variables created within them. But do I have to unset() all the objects that I instantiate? Also how much will it improve on speed if I do so? Regards, Magnetica
-
You shoudln't rely on cookies here, as soon as they reliase they can't download a file because of a cookie (which most amatuerish webbies could do).... They would delete the cookie and download the file Think about maybe storing their email and name in a database or XML file or something where they havn't got access to.. Regards, Magnetica
-
$data = htmlentities($data); $data = mysql_real_escape_string($data); Also these two functions are used to escape output not filter input..
-
Definetly not!! There probably are functions to clean input but security should be application specific. You are on the right lines here but you do have to do it all manually. Best practice is to get the user input then clean it appropiatley and store it within a $clean array; $clean = array(); if (ctype_alpha($_POST['username'])) { $clean['username'] = $_POST['username']; } if (ctype_alnum($_POST['password'])) { $clean['password'] = $_POST['password']; } Obviously your checks would be more intensive.
-
Be sure that the session_start() is situated right at the beginning of the document except before the <?php tag but before any whitespace or declared variables etc.
-
Can only be used by functions! Best way here (because you want to precedural program) <?php $contactemail="notanemailatnotadomaindotcom"; if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $contactemail)) { $contactemail_validated = FALSE; //This is my own addition. } else{ $contactemail_validated = TRUE; //email is valid } ?> <ul> <?php if ($contactemail_validated == FALSE){ echo "<li class='fail'><label for='contactsubjecterror'> </label>↓ You did not input a valid email address.</li>"; } ?> </ul>
-
Ok so to clarify! Don't worry too much about the size of php scripts. Worry more so about image sizes, html page sizes etc then yea? Magnetica
-
Ok thanks. So the user wouldn't directly download the php file. php would however read the whole include/require file on the server. So would the user still have to wait for the server to download and read the whole file? Or does the file not have to download it but just find it? Thanks, Magnetica
-
Hi All Consider the following script where the 'file_containing_class.php' is say 50kb in size but $name only uses a portion of the file that is say 1kb require_once 'file_containing_class.php' $class = new Class; //$namewould be something like Tom etc $name = $class->getName(); Does the user have to download the whole php file or just the part that is being called? So here would the user download the whole 50kb or just the 1kb being called? Thanks, Magnetica
-
Thanks for the comments, always helpful. Sort of but once you search for something and click on the item, it will take you to more detailed description of the Product, Review and Articles containing info like prices, authors, sources etc before then giving you the link to the site. Ok, the fact that you were finding only reviews was probably down to what you were searching for. Try searching for 'dell laptops' or something... You found a job listing due to a bug in the scripts, which i've sorted now. Do you simply mean to put something on the front page explaining the site a bit more? Regards, Magnetica
-
Hi all Some design opinions would be greatly appreciated, still a work in progress but the search feature works. http://www.googlebasesearch.com Have a look and let me know if the design is good or not? ps. disregard the fact the images say istockphoto if you could Thanks, Magnetica
-
Hi I am currently expanding my knowledge to a more professional standard. I'm trying to read up on Relflection of classes, methods, params etc but can't find any extensive articles! Anyone point me to one? Thanks, Magnetica
-
Hi $num would be the iteration number of the loop, as to check your on a multiple of 5 in order to show your advert.
-
Hi When in the loop check if the number is divisible by 5. if ( ( $num % 5 ) == 0){ // check that number divided by 5 leaves no remainder print "Number is divisible by 5"; //show advert } Hope this helps
-
Hi Try: //there was no space here $search_words = explode (' ', $user_search); //concat error $where_list[] = "description LIKE '%" . $word . "%'";