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));
}
?>
MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which is running smoothly on a system in UK. I got the code and database backup from the Production
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
session_destroy();
new to phpI have a simple login and am trying to write a logout.I set a $_SESSION var to 1 if they are logged in:if(isset($_POST['logname'])){ $UserArr = chk_lgn($_POST['logname'],$_POST['passwd']);
Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with.I found this incomplete source code, and I wanted to finish it, but I have no idea what I am
Why does my crawler script suddenly end with no error?
Hi.I have written a web crawler script. It will visit a large number of URL's with cURL.After around 2-3 minutes of running, it will just stop, with no error output or notices.I have these
Save User Inputs while javascript reloading!
hi..i have written a PHP code in which i reload the page when user selects a value in dropdown...Code: function reload(form){var
Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem.
Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment that have 5 clients and 1 server. To do so, I need to be able to edit IP header to change it's
javascript in php code causes page to display white
Hi All,Odd one this, I've got the following code (below) which is a simple log in form. The client wanted a pop to inform you when you've not completed a field and an asterix to appear.This is fine.
How to Handle more than one submit button in single form?
HiI have one PHP file which contains one Form. In this form there are two Submit type Buttons<input type="submit" name="edit" value="save"> <input