I'm looking around and it looks like there is lots of good info on pulling a var from php and using it in javascript, but no the other way around. All the info I can find says to just use hidden input boxes to hold the data, then post them with a submit button. But I have like 40 images, and I want to store their 'left' 'top' width' height'. Thats a lot of hidden input boxes to write (160+). It would be nice not to have those html'd into my script. Is there anyway to get the image height and set it as php data without a input box?
Example:
NOT THIS ----->
<form method="post">
<input style="display:none" name="some image height">
<input submit>
</form>
--------------------------------------------------------------------
THIS ------->
document.getElementById("some image").height = $post_imageheight[];
I'm not sure if I explained this clearly enough. Let me know if you need more detail. thanks
php get image height without the use of input box?
Moderator: General Moderators
this could easily be done in php
run this
Index 0 = width, Index 1 = height. It even contains a string to use in your HTML.
run this
Code: Select all
print_r(getimagesize($your_image));Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.