Hi All,
Below are two files, one being the index page, and one being the functions page.
My problem is when i use a function it just gives me a blank screen. The echo at the top of the index page is simply a sanity check.
Do i have an error with my functions syntax?
index.php
<?php
echo "hello";
$user_id = $_REQUEST['processor_id'];
$amount = $_REQUEST['amount'];
$currency_user = $_REQUEST['currency_user'];
$method = $_REQUEST['payment_method'];
$email = $_REQUEST['email'];
echo "your user id is " . $user_id;
echo "<br>";
echo $email;
include "myFunctions.php";
getConnection();
/getPea();
?>
functions.php
<?php
// connect to the database
function getConnection(){
$usr = "usr";
$pwd = "pw";
$db = "db";
$host = "localhost";
$cid = mysql_connect($host,$usr,$pwd);
mysql_select_db($db, $cid);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n");
}
}
getPea(){
$SQL = "SELECT * FROM tbl_registration WHERE user_id = '$user_id'";
$result = mysql_query($SQL);
$row = mysql_fetch_assoc($result);
echo $row['register_type'];
}
?>