PDA

View Full Version : Can you spot my mistakes?



coolblu
April 24th, 2002, 04:12
I am currently trying to adapt DT:Links for my own personal use.

So far I have

connect.inc

<?

$database = "localhost";
$dbname = "name_of_db";
$dbuser = "username";
$dbpass = "password";

mysql_connect($database, $dbuser, $dbpass) or die ("Couldn't connect to database.");
mysql_select_db($dbname) or die ("Couldn't select databse");

?>

admin.php
see http://ascene.l33t.ca/admin_php.txt (right click on page and go view source :))

and view.php (to view my first 10 affiliates

<?php
include('connect.inc');
$link_limit = "9";
?>
<?php
$query = "SELECT * FROM affiliates ORDER BY affilid DESC LIMIT $link_limit";
$result = mysql_query($query) or die( mysql_error() );
while ($rows = mysql_fetch_row($result))
{
echo ("<a href=\"$rows[2]\"><font face=\"arial, verdana, helvetica, sans serif\">$rows[1]</font></a>");
echo ("<br>");
echo ("<font size'1' face='arial'>$rows[4]</font>");
echo ("<br>");
}
?>

I cant seem to add affiliates to the database. The script also has its own installer (http://ascene.l33t.ca/install_php.txt) (right click on page and go view source :))

What is going wrong here?

Thanks

Coolblu

sorry for the outside links - the post was too long :)

megapuzik
April 24th, 2002, 07:28
*.inc for saving passwords ?!?!?!?
its a txt file, I can download it and open with notepad or something and view your database login info !
change in to *.inc.php

coolblu
April 24th, 2002, 09:39
Oops!! Sorry :)

I should have changed that. Thank you for pointing it out to me ;)

coolblu
April 28th, 2002, 07:11
anybody have any suggestions?

coolblu
May 7th, 2002, 12:23
anyone at all? :cry2: :D

spec
May 7th, 2002, 13:10
2 Bits of information that will help a PHP Coders here:

When wanting to show your source code save it as :
whatever.phps
with that it looks nice and has all the coloring

second on this line where you are adding the affiliates


$insert = "INSERT INTO affiliates (affilid, affilname, affilurl, affilclicks, affdescr) VALUES ('', '$name', '$url', '0', '$descr')";
$result= mysql_query($insert);PHP]

you should put:

[PHP]$result = mysql_query($insert) or die( mysql_error() )
I realise you use it everywhere else but where your having problems