Monday, 12 August 2013

Other variable value null when change new one

Other variable value null when change new one

I am making admin panel for own site.
I have five input fields they all goes with post method into the variable
and these variables call into the image src.
Here is Demo
If all input fields fill with image links then work fine after that if l
change only one link so than other pictures lost.
PHP & HTML
<form action="" method="post">
<input type="url" name="img1"/>
<input type="url" name="img2"/>
</form>
<?php
if($_SERVER['REQUEST_METHOD'] == "POST") {
$img1=$_POST['img-one'];
$img2=$_POST['img-two'];
?>
<div><img id="admin-image-pack-2" alt="null" src="<?php echo
$img1; ?>"/><img id="admin-image-pack-2" alt="null" src="<?php
echo $img2; ?>"/>

No comments:

Post a Comment