Jump to content

Goose

Members
  • Posts

    78
  • Joined

  • Last visited

Contact Methods

  • AIM
    Alternate+Adam
  • Website URL
    http://www.thewebnerd.com

Profile Information

  • Gender
    Not Telling
  • Location
    Oregon

Goose's Achievements

Member

Member (2/5)

0

Reputation

  1. That's exactly what I was looking for. Thanks!!!
  2. By default AddThis uses the current URL for liking, tweeting, bookmarking, etc.. If you are not using the current URL you must provide that parameter specifically when you make your AddThis links. See their support page here: http://www.addthis.com/help/url-and-title
  3. Sounds like a javascript problem, and I am guessing it has something to do with the IDs getting used more than once, or something along those lines.
  4. Lines 12 and 13 are the repeating lines. If you insert that code in between the curly brackets on line 11 and 14, those will repeat. It will look something like this: while($row = mysql_fetch_assoc($result)) { echo "Name: {$row['name']} <br>"; echo "Subject: {$row['title']} <br><br>"; ?> <a href="javascript:;" onclick="document.getElementById('<?php echo $row['id']; ?>').style.display='block'; window.open('http://www.google.co.uk');"><img src="../../graphics/Click here.png" border="0" /></a> <div id="<?php echo $row['id']; ?>" style="display:none;"> ...your text here </div> <?php }
  5. You should be able to replace the ..... with <?php echo $id; ?> Does that not work? Also, on line 8, which says "$id = $row{"id"};", that should look like this: $id = $row["id"]; You should use square braces when notating an array. Lastly, you are trying to store the value of $row['id'] into the variable $id, but when you are doing that assignment the variable $row is not defined yet.
  6. This solution isn't using regular expressions, but I think it might be quicker. If you are sure that you will have that pattern you showed above you can do this: $pos = strpos($yourString, ' '); if($pos !== false){ $yourNewString = substr($yourString, $pos + 1); }
  7. I am working on a website that depends on a complex cookie being set. In an effort to fix problems before they become big problems, I want to monitor that the cookie is getting set correctly with a cron job. I can setup the cron job just fine, but I can't figure out how to get the value of the cookie. By visiting the main site the cookie is set automatically, and I've also made a special script on that server that only gets me that cookie value and spits it out. I am trying to use cURL to call the main page, and then right after that, call the get-cookie.php page which should then have cookie data to display. Here is how I am trying to do it now: <?php $c = curl_init(); // making the initial call to the real website curl_setopt($c, CURLOPT_URL, 'http://domain.com'); curl_setopt($c, CURLOPT_HEADER, false); curl_exec($c); curl_close($c); $c = curl_init(); // now making a call to the script that spits out the cookie curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_URL, 'http://domain.com/get-cookie.php'); curl_setopt($c, CURLOPT_HEADER, false); $output = curl_exec($c); curl_close($c); echo 'output: ' . $output . "\n\n"; ?> I've tried a few different things here, but so far no luck. Anyone have any ideas on how I can make this work? Thanks so much!
  8. Well, after doing some more research I found this awesome JavaScript library that does exactly this: http://cufon.shoqolate.com/generate/
  9. I was hoping that there would be a way to do it in PHP, as I don't want to enable the shell() command on my server, but if no one can think of a way, I may have to do that.
  10. Have you tried the fputcsv function? All you have to do is pass in a file handler and an array of data and it should be good to go.
  11. I would like to dynamically generate text filled in with a gradient using some graphics library. Currently I've gotten Image Magick to do most of what I want (using non-standard fonts, centering, etc.) but I still haven't figured out the gradient part. Does anyone know how to make Image Magick fill the text with a gradient color or know of another library I can do this with? Thanks! <?php $canvas = new Imagick(); $text = $_GET['text']; if(empty($text)){ $text = "Unknown"; } // sanitize, remove non-words and non-spaces $text = preg_replace("/[^\S ]/","", $text); $draw = new ImagickDraw(); // set font $draw->setFont("DejaVuSerif.ttf"); $draw->setFontSize(32); $draw->setFillColor('#ffffff'); // center the $draw object $draw->setGravity(Imagick::GRAVITY_CENTER); $canvas->newImage(400,50, 'none'); // draw the text onto the canvas $canvas->annotateImage($draw, 0, 0, 0, $text); // png is 1337 $canvas->setImageFormat('png'); header("Content-Type: image/png"); echo $canvas; ?> When I call this script passing in the phrase "this is a test", I get the following image:
  12. Cool, well that is all great information. I will try using sessions instead. If anyone can point me to a good tutorial (I haven't looked yet, but will do the regulars (check php freaks and google)), that would be awesome. Thanks again all.
  13. Great information. I hope some more people post their thoughts.
×
×
  • 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.