Jump to content

Function variables help


Eggzorcist

Recommended Posts

yes it would pal.....

 

 

 

<?php

$a="Hi there i like php <br>";
$b="php rocks <br>";
$c="apache and php are the best <br>";
$d="i use mysql database it wicked <br>";

function name($a,$b,$c,$d){

$a=mysql_real_escape_string($_POST['a']);
$b=mysql_real_escape_string($_POST['b']);
$c=mysql_real_escape_string($_POST['c']);
$d=mysql_real_escape_string($_POST['d']);

}

function name($a,$b,$c,$d);

?>

all you are doing is passing the values to the function, you need to run mysql_... on all of them.  Also, functions have their own variable scope.  You need to actually return the values, make the vars global, or pass by reference, in order for the changes to take effect.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.