Hello,
I want to create my own script like www.anonym.to but with few additional features i want to use database, i believe its very easy to make but the problem i don't know php, i can write in visual basic and c++ but not php,
What do i want?? to make explaining easier i wrote a program in visual basic exactly i like i want it, download it from here, it will tell u everything
http://netmasterz.net/anonymizer.rar


I don't want the link to redirect automatically i want to store the links in database. So please if you can either create this script for me or guide me in the following:

  1. How to write in the database
  2. how to read from database
  3. when using the url http://domain.com/link=66 how can i read line 66 from the database??
  4. how to hyperlink a text by the link in the database??

but please i have very simple background on php, if anyone can create this for me i will be really thankful and you can ask whatever code or program u want in visual basic from me in case u want

I'm waiting to here from anyone,
regards and thanx in advance

If you are new to php, perhaps some simple documentation will explain the basics of php. For mysql, check out http://www.tizag.com/mysqlTutorial/ and on the left side of the page are links to tutorials of each part of using mysql. Also you can get advanced documentation from http://www.php.net And if you are wondering what program to use, a text editor like notepad will do the job and just save the files with the php extension. The documentation should answer at least half those questions.

Ok, i will try to write it if i stop anywhere i will ask in this thread

thanx for the links my friend

Hi there, ok writing on database is very easy, but i don't know the following:--
1- When storing the links in the database, i want to get new link like this, domain.com/?link=89
where 89 represent row number where the link is stored??
2- when surfing the link, how can i read row 89 from the database and hyper a link with that link,

Please any reply, it will be really appreciated
regards

Hi there, ok writing on database is very easy, but i don't know the following:--
1- When storing the links in the database, i want to get new link like this, domain.com/?link=89
where 89 represent row number where the link is stored??
2- when surfing the link, how can i read row 89 from the database and hyper a link with that link,

Please any reply, it will be really appreciated
regards

Although I don't directly know how to go straight to line 89, I do know that you could use a while loop then break the loop at line 89 then perform the actions with the fetched data. So try the following code to fetch each field of row 89 as an array.

<?
$result=mysql_query("SELECT * FROM `table`") or die(mysql_error());
$rownum=0;
while ($row=mysql_fetch_array($result))
    {
    $rownum+=1;
    if ($rownum==89) //change 89 to row number to retrieve
        {
        break;
        }
    }
//now if you have a column named field1 and want to display
//its value on line 89 use the following
echo $row['field1'];
?>

Hi there, ok writing on database is very easy, but i don't know the following:--
1- When storing the links in the database, i want to get new link like this, domain.com/?link=89
where 89 represent row number where the link is stored??
2- when surfing the link, how can i read row 89 from the database and hyper a link with that link,

Please any reply, it will be really appreciated
regards

If I may offer my suggestion. I think there may be a better way to go about the DB selection. If you create a column in your DB titled `ID`. I think this would be better than just reading a line number, this way if you change or remove a line in the database, it wont mess up your links.

Here is the PHP code I'd use.

<?
$result=mysql_query("SELECT * FROM `table` WHERE ID=$_GET['link']") 
or die(mysql_error());
while ($row=mysql_fetch_array($result))
    {
$link = "<a href=\"".$row['link']."\">".$row['link']."</a>";

//If you create a column named `link_name` you could uncomment
//the next line and comment the above line

//$link = "<a href=\"".$row['link']."\">".$row['link_name']."</a>";
}
//now if you have a column named link and want to display
//its value as a link, use the following

echo $link;
?>

This could echo something like... (First Example)
<a href="http://www.daniweb.com/forums/forum17.html">http://www.daniweb.com/forums/forum17.html</a>
Or something like... (Second Example)
<a href="http://www.daniweb.com/forums/forum17.html">DaniWeb PHP Forum</a>

Hope this was of some help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.