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));
}
?>
Download Image from URL and Upload it
Ok, I have been googling for the last 1/2 hour trying to figure this out, Most likely I'm just not searching for the right thing. Here is what I want to do. I want to have a Text box which somebody
Help with lottery style system?
I'm working on a currency system for forums and it is going to have a type of lottery system built into it. Trying to figure out the best way to make the drawings work. I'm still new to cron jobs but
How to have a log of all the status a VIM document had been ?
Hi guys,
"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP that does this? I see them on Wordpress and Joomla and such but I've been trying to learn exactly how
problems with search form numerical "between" sending by php
I am trying to display the results of a search, on a sql database, on a web page. I set up html "select form" and set value to "Between x and x" I get a resource error when
Setting a default timezone?
I have read about how to change the timezone in PHPMYADMIN, but it changes back, it doesn't STAY there.If thats not possible, if I had..;$time = date("d-m-Y H-i-s" time());or.. if I had
Undefined index on my form
ok im getting Undefined index on this line.. print_r($_REQUEST['form']);below is the full script its formCode: <?phpini_set("display_errors",
need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working can someone please help me and show me what I have wrong so I can fix it heres the html form I left
change text color with a jQuery code
Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I have this htmlview plaincopy to clipboardprint?<ol> <li> <asp:TextBox
how to easy edit text, with box? Help.
Hi.I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy for her as possible to edit the text. So, I am going to make a Admin site where she can login and then I