Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 05-29-2005, 02:43 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Ok, here is your script in action. I added some code to display the links, as proof that they were submitting to the database.

http://commandoselite.com/scripts/linksdb.php

Also, there is a link that you can click on to see the source code.

For some reason, the source code gets chopped off near the end, but that doesn't matter that section was added to display the links and source code.

every thing after line 73, just look for "Every thing after this line was added so that the links would be displayed, and so that you could view the source code." I added for the links and source code display.

Every thing above that line is your work, just edited where needed to make the script work.

You will have to edit the sql statements to reflect the database table your using. Same for mysql_select_db(), making sure it is selecting your database. And of course the mysql_connect() to reflect your username and passwords.

One thing I noticed though, is that you alternated capitals and lowercase letters for your variables.

That may have been why it wasn't working. Variables are case sensitive. $NN is different from $nn.

Any ways, hope this helps you

IcI

Last edited by IcIshoot; 05-29-2005 at 07:57 AM.
Reply With Quote
  #22  
Old 05-29-2005, 11:34 AM
General Nuisance is offline General Nuisance
Registered User

Join Date: Oct 2004
Posts: 616

Send a message via ICQ to General Nuisance
COOL!! my script rocks... lol.. thanks ici...

i will find some way to add your name to te site... Thanks!

my contact info:

MSN: GeneralNuisance@gmail.com
Email: same as msn
ICQ: i dont know # but its in my profile...
__________________
The Nova-Zone


http://youraite.yourhost.yourusername.com - long urls
-looks bad
-who can remember it?
- Solution?
- Get a short Nova-Zone subdomain! Yoursite.nova-zone.com
- Now thats smart. just ask for one via pm,email or contact page on site.
Reply With Quote
  #23  
Old 05-29-2005, 11:46 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

gj bro ! I remember my first one to
Reply With Quote
  #24  
Old 05-29-2005, 12:50 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Make sure though that when you use it to take out the lines


echo '<br><br><a href="linksdb.php?show=source">Click here to see source code</a><br><br>';

++++++++++++++++

if (isset($_GET['show']) AND ($_GET['show'] == "source")){
echo DisplaySourceCode();
}

+++++++++++++++++++++++

function DisplaySourceCode()
{

$h = file_get_contents("linksdb.php");
return "<br><br><textarea cols=60 rows= 20>$h</textarea>";
}


Other wise visitors will be able to get your database username and password.

IcI
Reply With Quote
  #25  
Old 05-29-2005, 01:03 PM
General Nuisance is offline General Nuisance
Registered User

Join Date: Oct 2004
Posts: 616

Send a message via ICQ to General Nuisance
ok i did... it works now! im making a link page now to get the mysql entries and post them on the page... will be one in a few min...

Thank you So Much ICIshot!

i will add your name to the site somewhere..

i will post when it is completely integrated in to The Nova-Zone so yall can test it out!

Edit--

i just got to thinking and looking at script... I DID NOT PUT IN DESCRIPTION!!!

thats ok is should be easy to add...

edit # 2 ---

i added the desciption box and it worked first try!
__________________
The Nova-Zone


http://youraite.yourhost.yourusername.com - long urls
-looks bad
-who can remember it?
- Solution?
- Get a short Nova-Zone subdomain! Yoursite.nova-zone.com
- Now thats smart. just ask for one via pm,email or contact page on site.

Last edited by General Nuisance; 05-29-2005 at 02:06 PM.
Reply With Quote
  #26  
Old 05-29-2005, 02:19 PM
General Nuisance is offline General Nuisance
Registered User

Join Date: Oct 2004
Posts: 616

Send a message via ICQ to General Nuisance
what am i doing wrong?

this script dont work either....

PHP Code:
<html><head><title>The Nova-Zone Link Database </title></head>
<body>

<?php

#connecting To mysql

$conn = @mysql_connect"localhost" "root" "5bk3hm2agn" ) or die( "Err:conn" );

#select the database

$rs = @mysql_select_db"linkdb"$conn ) or die( "err:db" ) ;

# create the query

$sql="select LName, URL, ld, sc from links";

# execute the query

$rs mysql_query$sql,$conn ) ;

#write the data

while( $row mysql_fetch_array$rs ) )
{
echo( 
"Category: " $row["sc"]
echo( 
"Site Name: " $row["LName"]
echo( 
"URL: " $row["URL"]
echo( 
" Site Description: " $row["ld"] ."<BR>");
}
?>
</body></html>
it is supposed to display the links that are submitted to the database..
__________________
The Nova-Zone


http://youraite.yourhost.yourusername.com - long urls
-looks bad
-who can remember it?
- Solution?
- Get a short Nova-Zone subdomain! Yoursite.nova-zone.com
- Now thats smart. just ask for one via pm,email or contact page on site.
Reply With Quote
  #27  
Old 05-29-2005, 02:51 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

well it seems to me to be those echo's...
Reply With Quote
  #28  
Old 05-29-2005, 03:56 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
echo( "Category: " . $row["sc"]
echo( "Site Name: " . $row["LName"]
echo( "URL: " . $row["URL"]


those above lines don't have the ");" at the end.

Also, why are you doing "$rs = @mysql_select_db( "linkdb", $conn ) or die( "err:db" ) ;"?

putting the @ infront of mysql_select_db() (or any other function) suppresses the errors. You could be getting errors in the sql statements and not know it.

You should do some thing like "$rs = mysql_select_db( "linkdb", $conn ) or die( mysql_error() ) ;", that way you will recieve any errors and get an idea as to what you have to do to fix them. Same applies to mysql_connect(), mysql_query(), ect.


IcI
Reply With Quote
  #29  
Old 05-29-2005, 04:08 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Also, my msn: icishoot@yahoo.com
yahoo: icishoot



IcI
Reply With Quote
  #30  
Old 05-29-2005, 05:35 PM
General Nuisance is offline General Nuisance
Registered User

Join Date: Oct 2004
Posts: 616

Send a message via ICQ to General Nuisance
well the @ thing is because my book says to do so.
__________________
The Nova-Zone


http://youraite.yourhost.yourusername.com - long urls
-looks bad
-who can remember it?
- Solution?
- Get a short Nova-Zone subdomain! Yoursite.nova-zone.com
- Now thats smart. just ask for one via pm,email or contact page on site.

Last edited by General Nuisance; 05-29-2005 at 05:51 PM.
Reply With Quote
  #31  
Old 05-29-2005, 07:24 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
lol, k.
Reply With Quote
  #32  
Old 05-29-2005, 08:11 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

yes, the book is a reference, a tutorial...doesn't mean you should code that way all the time... right now the @ isn't needed, infact it is need the @ is taken off. All the @ does is supress errors..
Reply With Quote
  #33  
Old 05-31-2005, 09:34 PM
General Nuisance is offline General Nuisance
Registered User

Join Date: Oct 2004
Posts: 616

Send a message via ICQ to General Nuisance
2nd php script done!

hey great news!! icishoot and i got the Links Pages Done for the Nova-zone! check it out and submit your link!

http://www.nova-zone.com\links.php
__________________
The Nova-Zone


http://youraite.yourhost.yourusername.com - long urls
-looks bad
-who can remember it?
- Solution?
- Get a short Nova-Zone subdomain! Yoursite.nova-zone.com
- Now thats smart. just ask for one via pm,email or contact page on site.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to get php script to work with ajax(jquery) alvidales phphq.Net Forums 0 06-28-2011 10:24 AM
What PHP script is this? Chels Web design and Programming 11 02-04-2006 05:45 AM
PHP NEWS SCRIPT? o2 phphq.Net Forums 8 10-30-2004 02:57 PM
Php Database Script area51-(xs)- Web design and Programming 8 06-27-2003 09:24 AM
php news script? Se7eN Web design and Programming 2 05-04-2003 12:09 PM


All times are GMT -5. The time now is 06:23 AM.




Powered by vBulletin®