I have this code that will call the page and clear it but what im trying to figure out is how to execute the code only when submit button is pressed.
<?php
$address = "example.php";
$fp = fopen("$address",'w+');
if(!$fp)
echo 'not Open';
//-----------------------------------
while(!feof($fp))
{
fputs($fp,' ',999);
}
fclose($fp);
?>
Thank you
hmm i dont see it ??
when i test echo $image1 it shows.
the only thing i can think of is
echo "$image1";
} else {
echo "$image2";
which still shows $image2
Hello i am tring to show $image1 if it exists and if not show $image2
This script shows $image1 but if i erase the image it just shows a broken image icon and doesnt go to $image2
any help in this would be great
<?php
$image0 = $_SESSION['ls_user'];
$image1 = "<img src=img/$image0.png>";
$image2 = "<img src=img/default.png>";
if ( $image1 ) {
echo $image1;
} else {
echo $image2;
}
?>
thank you
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.