Jump to content

lehula

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lehula's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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
  2. i'll try that, but i doubt that will work, cause that is creating two loops.
  3. I want to echo the array $tables[1] and array $tables[2]. I have && signs to show what I'm trying to do. This obviously doesn't work, but how can I get it to work? preg_match_all('/(<table id="friendtable(..).{150,180}font-size:.?.?.?.?pt">)<a/', $text, $tables); foreach($tables[1] as $whole && $tables[2] as $number) { echo $whole; echo $number; }
  4. I am using php to pull information from a website. I am getting information from all the images and postions of the images. Now I'm trying to pull the information of this div and list it's style attributes in an array so I can put the information in input boxes. I imagine I could use stristr and strpos to cut out the information, but it seems like there would be a better way to do that.
  5. I'm trying to get the attributes of the following div. <div style="position:absolute; background-image:url("http://"); left:484; top:568; overflow:auto;background-color:; color: FFFFFF; height:400; width:300; font-size:16pt; text-align: center; font-family:Monotype Corsiva; border-color:000000; border-width:6px; border-style: solid;z-index:2px; background-repeat:repeat; background-position:top left; opacity:1;filter: alpha(opacity=100)"></div> what the best way I should go about this? I've only been tinkering with php for about 2 months. thanks
  6. is there an equivelent to Javascripts getAttribute() in php?
  7. I did a search on the best way to get attritubes from an object and one of the suggestion was getAttribute(). It says its a php function. not just javascript
  8. I've been searching the web for a good example on how to use getAttribute() for php, but I can't find one. I found one, but it was talking about loading a file and nodes and a class...... Can I just use getAttribute to easily get the colors and height and width of this div. Or is there another way to put them in an array. Any help at all would be appreciated. Thanks. <div id="test" style="position:absolute; background-image:url("http://"); left:484; top:568; overflow:auto;background-color:; color: FFFFFF; height:400; width:300;font-size:16pt; text-align: center; font-family:Monotype Corsiva;border-color:000000; border-width:6px; border-style: solid;z-index:2px; background-repeat:repeat; background-position:top left; opacity:1; filter: alpha(opacity=100)"></div>
  9. I can't get it to work, any help from anyone would be great
  10. thanks for the help, but it's not retrieving any images with that. Ill keep trying.
  11. I'm retrieving all images in a section of my source code. I want it to skip all the images that have the id="blocker". I've tried using strpos to search for the id in the image src. I then try to skip the image with that id by using the 'continue' expression, but it's not working. Can someone help me out? Thanks. //retrieve all images within the above string preg_match_all('#<img\s[^>]*src\s*=\s*[\'"]?([^\'"\s>]+)[\'"]?[\s>]#i', $matches[0], $images); foreach($images[1] as $image) { $ider = 'id="blocker"'; $pos = strpos($image, $ider); if ($pos === true) { continue;} else { echo "document.getElementById('randompic".$h."').src=\"".$image."\";"; echo "document.getElementById(\"picaddress".$h."\").value = \"".$image."\";"; echo "document.getElementById('randompic".$h."').style.visibility = \"visible\";"; echo "document.getElementById(\"randomcheck".$h."\").checked = \"true\";"; echo "document.getElementById('randompreview".$h."').src=\"".$image."\";"; $h++;} }
×
×
  • Create New...

Important Information

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.