I'd like to redirect a page if the session times out, which is the best method to accomplish this?
Should it be done in the php.ini or the .htaccess file or using the php header(location) on each page?
I have an if statement inside a function that is checking to see if a session has been set
function addNewUser
if (isset($_SESSION['hasrun'])){
do this
}else{
do this
}
The error I get is:
Parse error: parse error, expecting `'('' ... on line 143 which is the first line of the if statement...
This might be a bit of a nube question but here goes.
I have 2 variables I'm multipying
$totalCommission = $numSales * $commissions;
This runs in a foreach loop so let's say I have 2 sales at 9.25 which adds up to $18.50, why is the zero stripped off when I output $totalCommission?
I have what looks to be a very simple problem but I can't seem to see the issue
$q = "SELECT * FROM subscriptions WHERE userID = '".$_SESSION['userid']."'";
$result = $database->query($q);
/* Error occurred, return given name by default */
$num_rows = mysql_numrows($result)...
Hi I have an existing registration form that won't submit after simply adding a primary key to the table. Shouldn't the column just auto_increment as new registrations come in?
The session file is an SSI
function deleteSubscriptions(){
global $database;
$q="DELETE FROM subscriptions WHERE userID = ('".$_SESSION['userid']."' AND promoCode = '".$_GET['pc']."')";
if (!mysql_query($q))
{
die('Error: ' . mysql_error($q));
}
}
Is there anything wrong with the syntax?
While in dev I just used the generic "root" user with no password.
Now that I'm ready to launch I want to switch to a different user or at the very least add a password to the root user.
After adding a password to the root user in the DB and editing the wp-config file accordingly the connection...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.