TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-27-2008, 09:23 AM   #1 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default an error makes me crazy nuts !!!!!!!

hey
im working on a website but i get this error
and the issue is that the same code is used on many pages but the error is just on 2 pages

here is the code

PHP Code:
require("config.inc");
include(
"function.inc");
dbconn($db_host,$db_name,$db_user,$db_pass); 
and here is the error =>

PHP Code:
Fatal errorCannot redeclare dbconn() (previously declared in C:\wamp\www\alfars\controls\function.inc:2in C:\wamp\www\alfars\controls\function.inc on line 12 
looking forward forthe answer
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 02-27-2008, 10:31 AM   #2 (permalink)
The Acquainted
 
Join Date: Oct 2007
Posts: 170
Thanks: 18
maZtah is an unknown quantity at this point
Default

You're double trying to make a connection to the database.

A proper solution would be to make the connection in the config.inc file.
In that case, put this in your config.inc file:

PHP Code:
mysql_connect("localhost""user""pwd") or die(mysql_error());
mysql_select_db("db") or die(mysql_error()); 
You can delete the dbconn line now. Every time you include your config file it connects to the database automaticly.

Hope this is what you want though :).
maZtah is offline  
Reply With Quote
Reply



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

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:40 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design