Creating a WordPress Plugin – Form Submission Fails when passed value of 00×00

I am writing a pretty simple plugin. I notice that when I submit a form with a text field with a value that is 2 or more digits followed by an x then followed by two or more digits that the form doesn’t submit it redirects me to the index page. I get an apache error log message : [error] [client ::1] script ‘/Applications/MAMP/htdocs/index.php’ not found or unable to stat but that is all of the info I can find.

To narrow down the problem, I made a super basic form that runs in the admin section with only one field. When it is submitted it calls a javascript alert to show the $_POST value. This works all day long UNTIL I enter 00×00 or any digits really with an x between them, 123×123, 999999999×999999999 etc…

Read More

In it’s intended use this field would have a dimension like 120×120 but for what ever reason the x is causing something weird to happen. Any ideas?

Here is the stripped down basic example, added to an admin menu page

<?php
if(isset($_POST['update'])){
echo '<script type="text/javascript">', 'alert("' . $_POST['image_url'] . '");',     '</script>';   
}
?>
<form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']);?>">
<input name="image_url" id="image_url" type="text" maxlength="200" value="00x00"/>
<input name="update" type="submit" id="update" value="Submit" />
</form>

Related posts

Leave a Reply