0

this is my form

<form name="thumbnail" action="<?php echo $_SERVER["PHP_SELF"];?>?complete=true" method="post">
            <input type="hidden" name="x1" value="" id="x1" />
            <input type="hidden" name="y1" value="" id="y1" />
            <input type="hidden" name="x2" value="" id="x2" />
            <input type="hidden" name="y2" value="" id="y2" />
            <input type="hidden" name="w" value="" id="w" />
            <input type="hidden" name="h" value="" id="h" />
            <input style="margin-top:7px;" type="submit" name="upload_thumbnail" value="Save Thumbnail" id="save_thumb" />
        </form>

and on the page i have this

<?php
 print_r($_GET);

  if($_GET["complete"] == "true"){ ?>
<script type="text/javascript">
    parent.jQuery.fancybox.close();
</script>
 <?php } ?>

but the get is always nothing..why is that when i add ?complete=true to the string

i tried GET POST but nothing....any ideas on how to do this

1
  • You have the form method as POST, which doesn't send anything to GET. Commented Mar 18, 2011 at 0:56

2 Answers 2

1

It works for me...

Array
(
    [complete] => true
)
<script type="text/javascript"> 
    parent.jQuery.fancybox.close();
</script> 

So you have a problem somewhere else.

Also, if you are going to use <?php echo $_SERVER["PHP_SELF"];?> for your form, change it to <?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?> for security.

Otherwise, I may request index.php/"%20onsubmit="alert('xss');return%20false"%20bla=" which leaves your HTML looking like....

<form name="thumbnail" action="/stuff/euler.php/" onsubmit="alert('xss');return false" bla="?complete=true" method="post"> 
Sign up to request clarification or add additional context in comments.

4 Comments

click the upload image and its an iframe and i need it to shut the iframe afte the image gets cropped
@Tamer When you get back to modal.php after uploading, it doesn't have the GET param anymore.
in the form it has <form name="thumbnail" action="/test/modal.php?complete=true" method="post">
@Tamer Because after upload, you send the header Location: http://comfortrevolution.com/test/modal.php which doesn't have the GET param. If you want to persist its state over the Location header, you will need to add it.
0

Maybe try === instead of ==

I would guess the string "true" gets evaluated as true (boolean)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.