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));
}
?>
Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year changes ?
How do I get the row number from from an sql table query
Hi allI have a table that I query and it returns a number of rows.mysql_num_rows($query) = $totalI want to have next and previous buttons, is there a way of retrieving the current row number, and can
ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patientsThe site is built off Wordpress and I'm getting the pages title using Wordpress function: Line number On/Off |
Is it possible to put an entire 500-page book in a database with PHP?
I am working on an intranet and I was wondering if its possible to code php with mysql to enter a full-text 500 page book into a database since I will be doing lots of updates to the pages? thanks
whats wrong with my code please help!!!
this is the errorWarning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line Code: <?php$srch = $_REQUEST["srch"];if (empty($srch)) {
Problem in back link
I have page where i have given javascript back link but when i click on it browser give a messageWebpage has expired
Update data to upper case in parent/child tables
Hi Gurus!
does anyone know a php script to send mail using gmails/googles free smtp server
cause i heard u can do that but i dont know how
Extracting Long text from message class with parameters
Hi,
problems with script
I made a small script wich exchanges points in my website: <?phpsession_start();include_once"config.php";$username = $_SESSION['username']; if(isset($_POST['exchange'])){$spoints =