$channels=$_GET['channels']; if (empty($channel s)) { $channels='blan k'; } changechannels( $channels);
$theatre=$_GET['theatre']; if (empty($theatre )) { $theatre='splas h'; } changetheatre($ theatre);
$info=$_GET['info']; if (empty($info)) { $info='noinfo'; } changeinfo($inf o);
Hey everyone,
I keep getting an error regarding the above code. These are the errors:
Notice: Undefined index: channels in /home/forcefed/public_html/index.php on line 5
Notice: Undefined index: theatre in /home/forcefed/public_html/index.php on line 6
Notice: Undefined index: info in /home/forcefed/public_html/index.php on line 7
I would assume it has to do with defining my variables in my php script above, but I dont see it cause I suck.
Any help would be appreciated!
Tim
3 3876
I see where your coming from, but I am a bit confused. Below is the entire script I am using. The thing is I am not using a form, I am using the get_ command to use switches to incorporate other pages into one, kind of like frames, which is why I am confused, since I never actually use a get_ or form. Am I declaring my variables wrong then? If so, could you recommend anything for me? I read up on w3 a bunch and I understand what they are saying, but I never use a <form and do not have buttons to submit anything, as you can see.
Thanks!
<?php
$channels=$_GET['channels']; if (empty($channel s)) { $channels='blan k'; } changechannels( $channels);
$theatre=$_GET['theatre']; if (empty($theatre )) { $theatre='splas h'; } changetheatre($ theatre);
$info=$_GET['info']; if (empty($info)) { $info='noinfo'; } changeinfo($inf o);
function changechannels( $channels) {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"';
echo '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">';
echo '<html xmlns="http://www.w3.org/1999/xhtml">';
echo '<head>';
echo '<title>ForceFe dTV Where Local Content Meets The Web</title>';
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<style type="text/css">td img {display: block;}</style>';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="770">';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="130">';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
include ('main.php');
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
switch ($channels)
{
case 'blank':
include ('blank.php'); break;
case 'tv':
include ('/home/forcefed/public_html/tvfiles/tv.php'); break;
case 'movies':
include ('/home/forcefed/public_html/moviefiles/movies.php'); break;
case 'musicvideos':
include ('/home/forcefed/public_html/musicvideofiles/musicvideos.php '); break;
case 'animation':
include ('/home/forcefed/public_html/animationfiles/animation.php') ; break;
}}
function changetheatre($ theatre) {
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td width="640" align="center" valign="top">';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="640">';
echo '<tr>';
echo '<td width="640" align="center" valign="top">';
switch ($theatre)
{
case 'splash':
include ('splash.php'); break;
case 'movie':
include ('movie.php'); break;
case 'tv':
include ('tv.php'); break;
case 'musicvideos':
include ('musicvideos.p hp'); break;
case 'animation':
include ('animation.php '); break;
case 'detroit':
include ('detroit.php') ; break;
case 'info':
include ('info.php'); break;
case 'bowlingfortrop hies':
include ('/home/forcefed/public_html/tvfiles/bowlingfortroph ies/bftpilotep1/bftpilotep1.php '); break;
case 'bftpilotep1':
include ('/home/forcefed/public_html/tvfiles/bowlingfortroph ies/bftpilotep1/bftpilotep1.php '); break;
case 'bftpilotep2':
include ('/home/forcefed/public_html/tvfiles/bowlingfortroph ies/bftpilotep2/bftpilotep2.php '); break;
case 'buriedman':
include ('/home/forcefed/public_html/moviefiles/buriedman/buriedman.php') ; break;
case 'selitoya':
include ('/home/forcefed/public_html/moviefiles/selitoya/selitoya.php'); break;
case 'selitoyatraile r':
include ('/home/forcefed/public_html/moviefiles/selitoyatrailer/selitoyatrailer .php'); break;
case 'endcall':
include ('/home/forcefed/public_html/moviefiles/endcall/endcall.php'); break;
case 'thepaperboy':
include ('/home/forcefed/public_html/moviefiles/thepaperboy/thepaperboy.php '); break;
default:
include ('splash.php');
break;
}}
function changeinfo($inf o) {
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="640" align="center" valign="top">';
switch ($info)
{
case 'noinfo':
include ('noinfo.php'); break;
case 'bowlingfortrop hies':
include ('/home/forcefed/public_html/tvfiles/bowlingfortroph ies/bftinfo.php'); break;
case 'bftpilotep1':
include ('/home/forcefed/public_html/tvfiles/bowlingfortroph ies/bftpilotep1/bftpilotep1info .php'); break;
case 'bftpilotep2':
include ('/home/forcefed/public_html/tvfiles/bowlingfortroph ies/bftpilotep2/bftpilotep2info .php'); break;
case 'buriedman':
include ('/home/forcefed/public_html/moviefiles/buriedman/buriedmaninfo.p hp'); break;
case 'selitoya':
include ('/home/forcefed/public_html/moviefiles/selitoya/selitoyainfo.ph p'); break;
case 'selitoyatraile rinfo':
include ('/home/forcefed/public_html/moviefiles/selitoyatrailer/selitoyatrailer info.php'); break;
case 'endcall':
include ('/home/forcefed/public_html/moviefiles/endcall/endcallinfo.php '); break;
case 'thepaperboy':
include ('/home/forcefed/public_html/moviefiles/thepaperboy/thepaperboyinfo .php'); break;
default:
include ('noinfo.php');
break;
}}
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '</table>';
include ('footer.php');
?>
code green 1,726
Recognized Expert Top Contributor
The $_GET[] command is used to read URL variables, normally inside a href string.
I can only see functions and include statements.
Where is the $channels variable that you pass into changechannels coming from? [PHP]$channels=$_GET['channels']; if (empty($channel s)) { $channels='blan k'; } changechannels( $channels);[/PHP]
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: saayan |
last post by:
Hi,
I am using PHP 5.0.1 with Apache 2 on Win XP (SP2).
My index.php file has require_once contents.php and also for
functions.php.
My contents.php file also has a require_once for functions.php.
When this code is tested on one machine, it works fine. However on
another machine with identical configuration (same PHP 5.0.1, XP+SP2,
Apache 2), an error message appears :
|
by: Fuzzyman |
last post by:
I've written a CGI proxy that remotely fetches web pages. I use the
urlopen function in CLientCookie which replaces (and ultimately uses)
the urlopen function in urllib2. What I'd like to do is give a more
useful message to the user when the page fetch fails.
My understanding was that a URLError exception had a 'code' attribute
which was the error code.
I trap the error with a simple : (excuse the horrible indentation,
this is from...
|
by: BlackKite |
last post by:
I have this script I wrote up as a php backend. But its throwing some errors i dont quite understand. Hope someone can help me fix this. Please
Error:
Line 52:
ftp_fput($connection, $bandle, $file, FTP_ASCII);
Whole Code:
<?php
|
by: karthickassistanz |
last post by:
Hi Friend,
I have a language file in the path /public_html/smartway/conf/config/lang/text.register_seeker.php.While editng this file in vietnam language,i can edit it for first time and produces the below error while editing second time.
Notice: XML Error:8: undefined entity in /home/thosu/domains/vietgoal.com/public_html/smartway/lib/xml_util.lib on line 370.
this is the function present in that line
function error()
{
...
|
by: priestyuk |
last post by:
Hi everyone: D,
I recently purchased a very smart and ‘expensive’ template from .
You have to install it on your site etc putting in your mysql details, e-mail address, license key etc. So far everything went to plan. Installed perfect. But now it’s running I am getting a list of these messages on my site (www.illuminati-gaming.co.uk):
Brace yourself:
This is a major pain in the back side as its plastered everywhere. Could...
| |
by: mikec87 |
last post by:
I am trying to populate a dropdown, but cannot get the sql to return what I want. Can someone please help me with this error that I am getting in case 1? I am not using case 2 or the default case yet.
"<br />
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/user21/public_html/mp3/enterjob_2.php</b> on line <b>23</b><br />
<br />
<b>Notice</b>: Undefined variable: temp in...
|
by: JRough |
last post by:
I'm trying to use output buffering to cheat so i can print to excel
which is called later than this header().
header("Content-type: application/xmsdownload");
header("Content-Disposition: attachment;
header("Pragma: no-cache");
header("Expires; 0");
print "$header\n$data";
|
by: JRough |
last post by:
On Sep 26, 3:23 pm, Captain Paralytic <paul_laut...@yahoo.comwrote:
without the exit I get this again:
Warning: Cannot modify header information - headers already sent by
(output started at /home/allrail/public_html/header.php:40) in /home/
allrail/public_html/header.php on line 39
as well as this:
Fatal error: Cannot redeclare maketr() (previously declared in /home/
allrail/public_html/templates/menu.php.html:24) in /home/allrail/...
|
by: complearn |
last post by:
Do you know why I got these errors for status_bar.php in some webhost, but work perfectly on other webhost?
Whats wrong? here are the codes from line 18, our webhost is running php5.
$dmg = ($_GET == 0 || $_GET == '22') ? $_GET : $_GET+$_GET;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |