Jump to content

phpvolution

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpvolution's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Barand, always great info.
  2. Hey Mike, just pass the variable with the link: [code] <?php $page = file_get_contents("page.php"); preg_match('!<title>(.*?)</title>!is', $page, $match); $title = $match[1]; ?> <a href="emailpage.php?title=<?=$title?>">e-mail this article to a friend</a> [/code] that should do it
  3. Edit: actually now that I think about it. At the time of the if-statement comparison, your $brokerage variable is still translated as {listing_field_ListingOfficeID_value}, not a number. but when you echo it it is then parsed into your ID such as 999. So that is a pretty complex problem, and I'm not sure how you can code a work around for it. I may have to tinker some more to figure that out :p
  4. I just lately got back into PHP and am extremely rusty, so bare with me. I need to create a script that will go through a folder of images and crop each one to a certain dimension. More specifically, these are all scanned images that are all the same dimensions and need to all be cropped the same size. So instead of going through hundreds or thousands of images manually I thought this would save me a bunch of time if I automated it. [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] I'm not sure where to start as I haven't dealt with cropping yet, and I'm not sure how I can cycle through all the images in a folder. If anyone could provide some direction on how to do this, it would be greatly helpful! And for the record the image dimensions are: 1276 x 1754 pixels and need to be cropped to: 915 x 1560 pixels I'd also like to resize them after cropping but I figure that'd be asking a little much, are there any great tutorials out there on this?
  5. Thanks for pointing that out, 6.75 was being rounded up instead of down also, so I went with an If statement to handle that. [code] if(substr($x,1) > .75) { $y = round($x*2)/2; } else { $y = floor($x*2)/2; } [/code] Seems to work. thanks.
  6. The main thing I do is code for MSIE and Firefox as that takes care of probably 95% of your visitors. That's frustrating enough to get identical appearance on both browsers, so I wont even bother with AOL, Netscape etc. I'm sure they'd have close resemblence on others if you can get the code to work on the big 2. The biggest issue i've found is with <div>'s, it's pushed as the replacement for <table>'s now, but even the big sites still use tables throughout. They seem to display much more consistantantly across the browsers.
  7. Thanks, my brain doesn't seem to be functioning! [code] $x = floor($x*2)/2; [/code] voila.
  8. Haven't been here in a while. Great idea to merge the forums, I was always looking for the forum with the most active users before so that my question would get answered sooner ;)
  9. Check your DB structure, those numbers could be stored as characters or text, that's usually the case because it looks like it's sorting that way. Make sure they are stored as integers.
  10. [code] $r2 = mysql_query("SELECT * FROM album_tracks WHERE at_album = '$aId' ORDER BY at_order ASC") or die(mysql_error()); [/code] ASC or DESC, I forget which way each goes =P
  11. preg_match() but I'm horrid with regular expressions so hopefully someone can type that up quick.
  12. I've looked for a while to find an answer on this and haven't come up with anything. I have a number, say 6.7 I want it to round in increments of .5, and to the nearest. I'm trying to make a php version of the formula I used in excel, which was the floor() function.. only in excel I used: =FLOOR(SUM(I4:L4)/4,0.5) So 6.7 should be 6.5, 6.75 should still be 6.5, 6.76 should be 7. And so on. Any ideas on how I can do this?
×
×
  • 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.