-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
Tried about five different variations and it's still only valid on login.site.com
-
The cookie is only used for the language.
setcookie("ln",$value,time()+(3600*24*7*365),"/",".site.com",0);
-
Yeah, I figured out how to access cookies around the whole site, but how can i with sessions.
-
Didn't work.
Still only validating the session for login.site.com
-
Just do some if statements.
if($money < 0){ //error it's negative } if(abs($attack_give) > abs($defend_take)){ //attack will get too much from the other guy }
-
Nobody knows?
subdomains are:
login.site.com
register.site.com
tools.site.com
forums.site.com
etc...
-
How bout when you submit the form, where's that code.
-
$month = $_POST['BirthMonth']; $day = $_POST['BirthDay']; $year = $_POST['BirthYear']; echo "Your birthday is: " . $day "/" . $month . "/" . $year;
You can save time writing all those options by using for statements.
-
Make you have the correct permissions to delete a file, and make sure the file exists before trying to delete it.
And for the header
just do:
header("Location: $deleteGoTo");
-
$myFile = array(); for($i=1;$i<=9;$i++){ $myFile[$i] = "../images/" . $_POST['photo' . $i]; }
-
Constant is basically predefined. Like, TRUE, FALSE, those are constants, they never change. Stand alone numbers are constant they will never equal anything else.
-
CHMOD the folder of the files to 0777
-
Use a full path.
$file = "/path/to/folder/where/etc/" . $_POST['file']; //etc... # when you chmod it, chmod $handle
-
Try using rename if you're just trying to move the file.
-
Use a full directory path.
/home/you/public_html/folder
so for images:
/home/you/public_html/images
feeds:
/home/you/public_html/feeds
admin:
/home/you/public_html/admin
-
Even if you tried to echo it, it will be outputted and buffered as HTML.
-
mysql_insert_id()
Usage:
$sql = "INSERT INTO `table` ...etc"; $res = mysql_query($sql) or die(mysql_error()); $last_id = mysql_insert_id();
It corresponds with the LAST SQL Query executions.
-
Does the file have the correct permissions to be written?
-
Based off Chris's code:
for($i=1;$i<=count($your_array);$i++){ echo $i . "<br>\n"; }
-
I have recently started a new website and a lot of the content is based off subdomains.
How would I use session_set_cookie_params to make it so it basically makes the session valid throughout all the subdomains.
I have:
session_set_cookie_params(10800,'/','.mysite.com/',true); session_start();
On every page.
-
$sql = "SELECT * FROM `table` WHERE `this`='that'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0){ $bounce = 1; } if($bounce === 1){ header("Location: thisorthat.php"); }else { $row = mysql_fetch_assoc($res); //etc... }
-
for($i=1;$i<=12;$i++){ if(strlen($row['color' . $i]) > 0){ echo "<option>{$row['color'.$i]}</option>\n"; } }
-
RewriteEngine On RewriteRule ^([^-]*)$\-([^-]*)$\-property$ index.php?county=$1&townnumber=$2
-
When posting the form check to see if the value of the selection is one of the valid ones.
So if you're using a SQL query:
$sel = $_POST['sel']; if($sel){ $sql = "SELECT * FROM `table` WHERE `this`='$sel'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0){ echo "Doesn't exist"; }else { echo "Exists"; } }
session_set_cookie_params help.
in PHP Coding Help
Posted
That didn't work either :/