A
Anonymous
Guest
Hi
I have form in my website, and all php actions are in separate file.
I would like print in div of my website message when my condition form actions file returns true. Something like that
php fie with actions for form :
my index page ( I set htaccess to treat html as php)
I have form in my website, and all php actions are in separate file.
I would like print in div of my website message when my condition form actions file returns true. Something like that
php fie with actions for form :
Code:
$file_name = $_FILES['uploaded-file']["name"][$i];
if ($_FILES['uploaded-file']['size'][$i] > $max_size) {
$message = $file_name . "is too big";
//action here to remember/send $message value;
header("Location:".$_SERVER[HTTP_REFERER]."#file-size-error"); //redirect to html element
die();
}
my index page ( I set htaccess to treat html as php)
Code:
<div id ="file-size-error" class="file-error">
<?php
if(isset($_POST['message'])){ //print message from $message here
echo $_POST['message'];
}
?>
</div>