Undefined variable?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
bironeb
Forum Commoner
Posts: 59
Joined: Thu Nov 20, 2003 12:02 pm

Undefined variable?

Post by bironeb »

With the below code, im getting an error: Undefined variable: mlink

Code: Select all

<?php
if (file_exists("includes&quote; . basename($mlink) . ".php")) &#123; 
   include("includes&quote; . basename($mlink) . ".php"); 
&#125; 
else 
&#123; 
$link = "new"; 
$str = "includes&quote; . $link . ".php"; 
include($str); 
&#125; 
?>
any ideas?
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

You need to define $mlink = 'equals something'; before you use it
Post Reply