Jump to content

Herra

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Herra

  1. Hello, I have a file upload site for my IRC channel, and I'm using timthumb to generate thumbnails. The problem is, I allow users to upload other than image files and they obviously show as blank now on my website. Any ideas how I could show custom made thumbnails for files such as .rar? i.e. user uploads a rar file, and my site instead trying to do this: <div class='tiedosto'><a href='up/rss.rar' class='tiedosto screenshot' rel='up/rss.rar' ><img src='thumb.php?src=up/rss.rar&h=100&w=100&zc=1' alt=''></a></div> it would show this <div class='tiedosto'><a href='up/rss.rar' class='tiedosto screenshot' rel='up/rss.rar' ><img src='thumb.php?src=thumb/rar.png&h=100&w=100&zc=1' alt=''></a></div> or just <div class='tiedosto'><a href='up/rss.rar' class='tiedosto screenshot' rel='up/rss.rar' ><img src='thumb/rar.png'></a></div> Thanks.
  2. Wow thanks, that did work after some tweaking! $id = $_GET['id']; mysql_query("INSERT INTO Blog_kommentit (kayttajat , kommentti , kirjid) VALUES ('$kayttajat', '$kommentti', '$id')") or die(mysql_error());
  3. Hello, I'm trying to create a simple php blog thing, and I can't get the commenting to work.. blog.php?id=2 On that page, there is a form what is used to comment, it goes to send.php That php has this query in it: $yhteys = mysql_connect('10.5.49.32', '09A_user', 'pass'); mysql_select_db('09A_Jere', $yhteys); mysql_query("INSERT INTO `Blog_kommentit` (`kayttajat` , `kommentti` , `kirjid` ) VALUES ('$kayttajat', '$kommentti', '$id')") or die(mysql_error())$sql = "SELECT * FROM Blog_kommentit WHERE kirjid='$id' ORDER BY id";; mysql_close($yhteys); header('Location: ' . $_SERVER['HTTP_REFERER']); How can I make the $id to be previous pages id (2)? This shouldn't be anything hard and I'm kinda amazed why I am stuck in this, any help will be appreciated. If I just put $id I get this error: Cannot add or update a child row: a foreign key constraint fails (`09A_Jere/Blog_kommentit`, CONSTRAINT `kommentti_kirjoitus` FOREIGN KEY (`kirjid`) REFERENCES `Blog_kirjoitukset` (`id`)) Here is how my database works: (Kayttajat = username, kommentti = comment)
×
×
  • 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.