So, I've been reading up on Functions and I like them! However, I need some help using variables in functions, since it's kind of confusing.
I just made these functions:
<?php
function Protect($var){
$var = mysql_real_escape_string(htmlentities(stripslashes($var)));
}
function Preserve($var){
$content = nl2br(str_replace(" ", " ", $var));
}
?>
Neither of them work. Dunno why.
From what I understand...
If I do this:
function HelloThere($var){
Then when I use the function I can go...
HelloThere($hello);
And the $hello variable will be substituted for $var from when I defined the function. Am I not right, confusing, or misled? Please help!!!
Thanks.
PS I originally had this, but it didn't work:
<?php
function Protect($var){
$variable = $var;
$protect1 = mysql_real_escape_string($variable);
$protect2 = htmlentities($protect1);
$protect3 = stripslashes($protect2);
}
function Preserve($var){
$content = nl2br(str_replace(" ", " ", $var));
}
?>
Do While statement
hi guys,This may sound trivial but im new to php and as part of an assignmenti have to construct the 10 green bottles song using the do while statement. I can do the statement but it is itengrating
with clause
hi all, i have a big query that usually access the same table more than once. for example, i have something like this
need help in update query
hi i have a dynamic form. i need help in how can i use update query when values from dynamic form get pass to php file.currently when i press submit it displays this and does not update fieldsCode:
Image resize
Hi again fellersI managed to sort out the issues with the folder, Final hurdle is this: Code: function ResizeJPEG($filename, $width, $height){ list($width_orig, $height_orig) =
Wrong Info sent Using $get in form
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls help and it works ok but when i have multiple files it doesnt send the correct info.What im tryin
EXplanation help
Hey all,I am still fairly new to PHP programming and I am trying to put together a page where you select search terms from a drop down menu and it keeps the menu at your search choice in the menu
PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.How would I exactly install the "PECL uploadprogress"?http://pecl.php.net/package/uploadprogress---There are
Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redirect the user to another page. Is this even possible?
writing a screen scraper
Hello,I'm writing a screen scraper application and want to be able to get absolute addresses for images from relative links.So a link like this: Code: <img
Creating a function
Basically i wanna put all this code in a seperate file Code: <?php $query = "select product.ProductID, product.ProductName, product.ProductCategory,