Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 08-10-2007, 08:46 AM   #1 (permalink)
Junior Member
 
Join Date: 08-10-07
Posts: 19
iTrader: 0 / 0%
Latest Blog:
None

tubheiaboy is liked by many
PHP code help

Hey, on my website i get that error:

Fatal error: Cannot redeclare quote_smart() (previously declared in /home/europea/public_html/_include-connection.php: in /home/europea/public_html/_include-connection.php on line 17

This is _include-connection:

Quote:
<?php
ob_start();
$passwordthatmustbesecret = "''''";
$hostthatmustbesecret = "''''";
$usernamethatmustbesecret = "''''";
$databasethatmustbesecret = "'''''";

function quote_smart($value){
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
if(version_compare(phpversion(),"4.3.0") == "-1") {
return mysql_escape_string($value);
} else {
return mysql_real_escape_string($value);
}
} ?>
Please help me
tubheiaboy is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2007, 09:06 AM   #2 (permalink)
Contributing Member
 
Join Date: 06-11-07
Posts: 238
iTrader: 0 / 0%
Latest Blog:
None

Capo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the rough
Well apparently that's an include file, (you use include("_include-connection.php"); ) in another file.

This happens when you declare a function twice, so either you have another include that already has the quote_smart function declared, or you already declared it in your file.
Capo64 is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-12-2007, 12:32 AM   #3 (permalink)
T0d
Super Moderator
 
T0d's Avatar
 
Join Date: 01-11-04
Location: Sacramento
Posts: 1,539
iTrader: 0 / 0%
T0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest orderT0d is a web professional of the highest order
Are you doing ob_start on both pages? Are you including the same file on both pages?
__________________
Learn about Bear Grylls, Les Stroud, Man Vs. Wild & SurvivorMan at Survival TV Shows where Survival comes to life!
T0d is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-13-2007, 12:39 AM   #4 (permalink)
Member
 
Join Date: 08-11-07
Location: India
Posts: 72
iTrader: 0 / 0%
Latest Blog:
CakePHP Tutorial

brandrocker is liked by many
Try:
Code:
include_once('path-to-include-filename');
for including relevant file.
brandrocker is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-13-2007, 12:23 PM   #5 (permalink)
Junior Member
 
Join Date: 05-11-07
Posts: 21
iTrader: 0 / 0%
Latest Blog:
None

MykeXero is liked by many
The correct way woudl be follow the advise of everyone above me, but if you want to go the hackish route....

if (!function_exists('quote_smart')) {
function quote_smart($value){
//blah blah
}
}
MykeXero is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS code daniel0012 Coding Forum 4 03-12-2007 12:15 PM
BB code url markov Web Design Lobby 1 11-03-2006 08:13 PM
Google Code Search - Code Search Engine from the Big G Avinash Coding Forum 2 10-05-2006 11:10 PM
need help with a code kopythat Coding Forum 10 03-11-2004 06:31 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:38 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.