Reply to Re: [PHP] from database to links

Your name:

Reply:


Posted by George B on 08/24/05 19:40

Richard Lynch wrote:
> On Tue, August 23, 2005 3:52 pm, George B wrote:
>
>>You know on forums when you make a topic right away it makes like a
>>new
>>link to your topic. How do you do that in PHP?
>
>
> <?php
> //Untested code:
> if (isset($_POST['new_topic'])){
> $new_topic = $_POST['new_topic'];
> $new_topic = mysql_escape_string($new_topic);
> $query = "insert into topics (topic) values ('$new_topic')";
> $insert = mysql_query($query) or die (mysql_error());
> $topic_id = mysql_insert_id();
> echo "<a
> href=\"topics.php?topic_id=$topic_id\">$_POST[new_topic]</a>";
> }
> ?>
>
> http://php.net/mysql_insert_id
> is probably the piece of the puzzle you were missing.
>
How did you get this in your link?

topics.php?topic_id=$topic_id

I cant figure.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация