Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > PHP
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 06-28-2007, 07:04 AM   #1 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
Functions and Includes

Is it possible to run a function at was declared in an include?

The function called scanMsg is declared in one file, and this file is included from another one. One of the function parameters is given from MySQL, is this code I'm using here OK?

PHP Code:
<?php
include("http://www.##########################-msg.php"); // Function declared in here
$tid mysql_result(mysql_query("SELECT tid FROM table WHERE id = $uid LIMIT 1;"),0,0);
scanMsg($msg,$tid,"Sky High Chat");
?>
The variable $uid is declared earier in the file.

Whats wrong with this?

- Mark
__________________
Stuff4Web.co.uk - The ultimate resource for webmasters

50% off all orders £1-£50! Just enter the code AGSIG01 at the checkout! Offer ends: 01/09/2008
markster is offline   Reply With Quote
Old 06-28-2007, 07:23 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
http://www.##########################

That's what's wrong with it.
PHP: include - Manual
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Old 06-28-2007, 07:35 AM   #3 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
I blanked out the URL myself to stop people going there. I've had a look round the manual and I couldn't find anything to help.
__________________
Stuff4Web.co.uk - The ultimate resource for webmasters

50% off all orders £1-£50! Just enter the code AGSIG01 at the checkout! Offer ends: 01/09/2008
markster is offline   Reply With Quote
Old 06-28-2007, 08:50 AM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
When you include it via the url, you are evaluating the results of that page not the code on the page. If you want to include the php code, you need to include the file as the server would see it.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 06-28-2007, 09:16 AM   #5 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
Thumbs down

Quote:
Originally Posted by markster View Post
I've had a look round the manual and I couldn't find anything to help.
You probably forgot to read the red bordered, definatly can't miss, Security warning and the normal Warning.
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Reply


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

vB 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
#includes not working? ben657 Standard C, C++ 6 07-10-2005 08:44 PM


All times are GMT -8. The time now is 04:56 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle