Can anybody help me in writing this very simple script

Reply

Join Date: Nov 2008
Posts: 4
Reputation: mr-cracker is an unknown quantity at this point 
Solved Threads: 0
mr-cracker mr-cracker is offline Offline
Newbie Poster

Can anybody help me in writing this very simple script

 
0
  #1
Nov 17th, 2008
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
Last edited by mr-cracker; Nov 17th, 2008 at 3:37 pm.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,521
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 137
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Posting Virtuoso

Re: Can anybody help me in writing this very simple script

 
0
  #2
Nov 18th, 2008
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.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*`
My favourite PC. - Oopy Doopy Do 2U2!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 4
Reputation: mr-cracker is an unknown quantity at this point 
Solved Threads: 0
mr-cracker mr-cracker is offline Offline
Newbie Poster

Re: Can anybody help me in writing this very simple script

 
0
  #3
Nov 18th, 2008
Ok, i will try to write it if i stop anywhere i will ask in this thread

thanx for the links my friend
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 4
Reputation: mr-cracker is an unknown quantity at this point 
Solved Threads: 0
mr-cracker mr-cracker is offline Offline
Newbie Poster

Re: Can anybody help me in writing this very simple script

 
0
  #4
Nov 21st, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,521
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 137
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Posting Virtuoso

Re: Can anybody help me in writing this very simple script

 
0
  #5
Nov 22nd, 2008
Originally Posted by mr-cracker View Post
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.
  1. <?
  2. $result=mysql_query("SELECT * FROM `table`") or die(mysql_error());
  3. $rownum=0;
  4. while ($row=mysql_fetch_array($result))
  5. {
  6. $rownum+=1;
  7. if ($rownum==89) //change 89 to row number to retrieve
  8. {
  9. break;
  10. }
  11. }
  12. //now if you have a column named field1 and want to display
  13. //its value on line 89 use the following
  14. echo $row['field1'];
  15. ?>
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*`
My favourite PC. - Oopy Doopy Do 2U2!
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 62
Reputation: PomonaGrange is an unknown quantity at this point 
Solved Threads: 3
PomonaGrange PomonaGrange is offline Offline
Junior Poster in Training

Re: Can anybody help me in writing this very simple script

 
0
  #6
Nov 25th, 2008
Originally Posted by mr-cracker View Post
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.

  1. <?
  2. $result=mysql_query("SELECT * FROM `table` WHERE ID=$_GET['link']")
  3. or die(mysql_error());
  4. while ($row=mysql_fetch_array($result))
  5. {
  6. $link = "<a href=\"".$row['link']."\">".$row['link']."</a>";
  7.  
  8. //If you create a column named `link_name` you could uncomment
  9. //the next line and comment the above line
  10.  
  11. //$link = "<a href=\"".$row['link']."\">".$row['link_name']."</a>";
  12. }
  13. //now if you have a column named link and want to display
  14. //its value as a link, use the following
  15.  
  16. echo $link;
  17. ?>
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.
There are alot of people smarter than me, BUT at least I try to be of some help. Of coarse I'm not perfect, I need help too.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC