Jump to content

Plain Flailing

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Plain Flailing's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the reply ChristianF. Looking through the PHPMailer documentation, the closest thing seems to be this feature: If this can in fact be used with images, then does anyone know how I'd convert the output of PHP's imagecreate() function into a compatible, correctly formatted string to be input into PHPMailer's AddStringAttachment() function? I should point out, if it's not already apparent, that my skills and knowledge are not great, so please forgive my need for a little hand holding!
  2. Using imagecreate() I'm generating a temporary image unique to each user (the result is stored in a variable called $my_img), which I then want to send the user as a PNG attachment in a plain email without having to store the image as a file on my server. I'm reasonably familiar with the mail() function but creating attachments out of system generated images doesn't seem to be widely documented. Unfortunately the answers I've found addressing this on Google have been too vague for me to grasp so I'd really appreciate some straightforward advice on how to do this. Many thanks!
  3. The aim of the following code is to display the latest thumbnails in a gallery. It should display 4 thumbnails, but only displays 3, missing out the most recent (the one that comes first in the query results). $query = "SELECT ID_PICTURE, thumbfilename FROM smf_gallery_pic ORDER BY date DESC LIMIT 4"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); echo '<b>New Pictures:</b><br />'; while($row = mysql_fetch_array($result)){ echo '<a href="http://www.mysite.com/index.php?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="http://www.mysite.com/gallery/', $row['thumbfilename'], '" /></a>'; } I have checked that the thumbnail file exists. It just isn't added to the HTML output. Anyone know what I'm doing wrong?
  4. The reason I tried it with 1 is because I read this page, which says it's a more timezone-proof method of setting a time in the past. But now I've tried this and it still doesn't work: setrawcookie("username", "", time()-3600*24, "/"); Again, with and without the "/".
  5. I've searched through a number of threads on this topic, but none have seemed to help. I'm having trouble deleting a cookie. I can set it fine like this: setrawcookie("username", $username, time()+3600); But I can't delete it like this: setrawcookie("username", "", 1); I've also tried adding a "/" in the domain parameter: setrawcookie("username", $username, time()+3600, "/"); setrawcookie("username", "", 1, "/"); If it matters, the cookie is set on the page mysite.com/login/index.php and is (theoretically) deleted on the page mysite.com/logout/index.php - could the directories be causing the problem? If not, where am I going wrong?
  6. Thanks Barand. I'm almost too embarrassed to admit the cause of the problem, but just in case it helps another idiot searching the forum later: I'd simply forgotten to update a field name in my code after changing it in the database... :-X
  7. I'm trying to code a simple webring using PHP and MySQL, but the following chunk of code... $con = mysql_connect($dbhost,$dbuser,$dbpass); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($dbname,$con); $query = "SELECT id, name, url FROM webring_sites"; $result = mysql_query($query,$con); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $allSites[$row]['id'] = $row['id']; $allSites[$row]['name'] = $row['name']; $allSites[$row]['url'] = $row['url']; } mysql_free_result($result); mysql_close($con); ...is giving me these errors: <b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/####/public_html/webring/webring.php</b> on line <b>40</b><br /> <br /> <b>Warning</b>: mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/####/public_html/webring/webring.php</b> on line <b>47</b><br /> I don't understand what the problem is with $result. Can anyone help me out?
×
×
  • 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.