Pokedragonfire

ph34r |\/|y 1337 n1nj4 5k1||z

Age 20
Squark.
Seen June 18th, 2008
Posted July 6th, 2007
1,097 posts
19.1 Years
Soo...how can I stop this error message (besides changing stuff in the php.ini file)
Here's my code...

<html>

<head>
<?php
if($_POST['style'] == "style1") echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"style1.css\" />";
else echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />";
?>
</head>
<body>
<form action="something.phtml" method="post">
<select name="style">
<option value="">Default
<option value="style1">Style1
</select>
<input type="submit" name="submit" value="Change Style!" />
</body>
</html>
I know why it does that but I'm stupid and have no idea how to make it not do that.
:t038::t037:
Age 32
Oakland Ca
Seen December 29th, 2008
Posted August 11th, 2008
3,549 posts
19.3 Years

<html>

<head>
<?php
if($_POST['style'] == "style1")
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"style1.css\" />";
}
else 
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />";
}
?>
</head>
<body>
<form action="something.phtml" method="post">
<select name="style">
<option value="">Default
<option value="style1">Style1
</select>
<input type="submit" name="submit" value="Change Style!" />
</body>
</html>
thats the right code
Stop waiting for GSC Remakes! Play the fan made remakes!
I support these rom hacks:



Also, while you're here, check out my GSC music project:
Thread | PureVolume
Age 32
Oakland Ca
Seen December 29th, 2008
Posted August 11th, 2008
3,549 posts
19.3 Years
Okay so I am supposed to get the error? Or can I change the code so I don't?
no your not. try changing the code then tell me if it works

edit- try this code


<html>

<head>
<?php
if($_POST['style'] == "style1")
{
echo 
"<link rel=/'stylesheet/' type=/'text/css/' href=/'style1.css/' />";
}
if(
$_POST['style'] == "default")
{
echo 
"<link rel=/'stylesheet/' type=/'text/css/' href=/'default.css/' />";
}
else
{
echo 
"<link rel=/'stylesheet/' type=/'text/css/' href=/'default.css/' />";
}
?>
</head>
<body>
<form action="<? $PHP_SELF?>" method="post">
<select name="style">
<option value="default">Default
<option value="style1">Style1
</select>
<input type="submit" name="submit" value="Change Style!" />
</form>
</body>
</html>
Stop waiting for GSC Remakes! Play the fan made remakes!
I support these rom hacks:



Also, while you're here, check out my GSC music project:
Thread | PureVolume

Pokedragonfire

ph34r |\/|y 1337 n1nj4 5k1||z

Age 20
Squark.
Seen June 18th, 2008
Posted July 6th, 2007
1,097 posts
19.1 Years
no your not. try changing the code then tell me if it works

edit- try this code


<html>

<head>
<?php
if($_POST['style'] == "style1")
{
echo 
"<link rel=/'stylesheet/' type=/'text/css/' href=/'style1.css/' />";
}
if(
$_POST['style'] == "default")
{
echo 
"<link rel=/'stylesheet/' type=/'text/css/' href=/'default.css/' />";
}
else
{
echo 
"<link rel=/'stylesheet/' type=/'text/css/' href=/'default.css/' />";
}
?>
</head>
<body>
<form action="<? $PHP_SELF?>" method="post">
<select name="style">
<option value="default">Default
<option value="style1">Style1
</select>
<input type="submit" name="submit" value="Change Style!" />
</form>
</body>
</html>
No it doesn't work. It gives me more errors:
Notice: Undefined index: style in C:\website\something.phtml on line 4

Notice: Undefined index: style in C:\website\something.phtml on line 8

And I don't have any of the short tags on either. (<? and ?> won't work for me.)
You are using forward slashes and single quotes instead of backward slashes and double quotes.
I fixed those and it still didn't work. =(
:t038::t037:
Age 32
Oakland Ca
Seen December 29th, 2008
Posted August 11th, 2008
3,549 posts
19.3 Years
No it doesn't work. It gives me more errors:
Notice: Undefined index: style in C:\website\something.phtml on line 4

Notice: Undefined index: style in C:\website\something.phtml on line 8

And I don't have any of the short tags on either. (<? and ?> won't work for me.)
You are using forward slashes and single quotes instead of backward slashes and double quotes.
I fixed those and it still didn't work. =(
try... try saving it as a .php file. that helps sometimes. and are you sure you have all the nessesary CSS files?
Stop waiting for GSC Remakes! Play the fan made remakes!
I support these rom hacks:



Also, while you're here, check out my GSC music project:
Thread | PureVolume

Pokedragonfire

ph34r |\/|y 1337 n1nj4 5k1||z

Age 20
Squark.
Seen June 18th, 2008
Posted July 6th, 2007
1,097 posts
19.1 Years
try... try saving it as a .php file. that helps sometimes. and are you sure you have all the nessesary CSS files?
It's still not working and I have the CSS files but it would work even if I didn't because it wouldn't give me errors.
:t038::t037:
Age 32
Oakland Ca
Seen December 29th, 2008
Posted August 11th, 2008
3,549 posts
19.3 Years
http://pokemon-tns.cjb.net/test/test.php

i got it working :P


<html>

<head>
<?
if($_POST['style'] == "default")
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />";
}
if(
$_POST['style'] == "style_1")
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"style1.css\" />";
}
else
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />";
}
?>
</head>
<body>
<form action="<? $PHP_SELF?>" method="post">
<select name="style">
<option value="">Select a Style!</option>
<option value="default">Default</option>
<option value="style_1">Style 1</option>
</select>
<input type="submit" name="submit" value="Change Style!" />
</form>
</body>
</html>
Stop waiting for GSC Remakes! Play the fan made remakes!
I support these rom hacks:



Also, while you're here, check out my GSC music project:
Thread | PureVolume

Pokedragonfire

ph34r |\/|y 1337 n1nj4 5k1||z

Age 20
Squark.
Seen June 18th, 2008
Posted July 6th, 2007
1,097 posts
19.1 Years
http://pokemon-tns.cjb.net/test/test.php

i got it working :P


<html>

<head>
<?
if($_POST['style'] == "default")
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />";
}
if(
$_POST['style'] == "style_1")
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"style1.css\" />";
}
else
{
echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />";
}
?>
</head>
<body>
<form action="<? $PHP_SELF?>" method="post">
<select name="style">
<option value="">Select a Style!</option>
<option value="default">Default</option>
<option value="style_1">Style 1</option>
</select>
<input type="submit" name="submit" value="Change Style!" />
</form>
</body>
</html>
It's still not working for me. Wait what version of php are you using? I've got 5. And what are your settings in your php.ini file?
:t038::t037:
Age 62
Male
Melbourne, Australia
Seen April 26th, 2018
Posted June 9th, 2014
11,439 posts
19.7 Years
Why don't you try using a PHP file instead of a PHTML file?


"One reason why mathematics enjoys special esteem, above all other sciences, is that its laws are absolutely certain and indisputable, while those of other sciences are to some extent debatable and in constant danger of being overthrown by newly discovered facts."
Albert Einstein

"What science can there be more noble, more excellent, more useful for men, more admirably high and demonstrative than mathematics."
Benjamin Franklin

"Mathematics, rightly viewed, possesses not only truth, but supreme beauty – a beauty cold and austere, like that of sculpture, without appeal to any part of our weaker nature, without the gorgeous trappings of paintings or music, yet sublimely pure and capable of a stern perfection such as only the greatest art can show."
Bertrand Russell

avatar and signature by FoxHound

ANNOY ME AT YOUR PERIL. I am becoming increasingly tired of the unmanly elitism and closed-mindedness of certain members who shall remain unnamed.
Age 35
Ohio
Seen June 19th, 2009
Posted June 17th, 2009
113 posts
18.1 Years
but WHY are you using a phtml file instead of a php file?
~Shingo @ Pokemon Adventures MUSH (Founder/Head Admin/Coder)

A dedicated roleplay environment built around the canon pokemon universe where every player collaboratively works towards writing one main, large storyline with drama ahoy! We affectionately call it [PAM].

Check us out! http://pokemonadventures.game-host.org/
Age 32
Oakland Ca
Seen December 29th, 2008
Posted August 11th, 2008
3,549 posts
19.3 Years
Because I can. =P

Okay well I'm using 5, but not the most recent I think.
4.3 is standard, 5 is still buggy
Stop waiting for GSC Remakes! Play the fan made remakes!
I support these rom hacks:



Also, while you're here, check out my GSC music project:
Thread | PureVolume

Pokedragonfire

ph34r |\/|y 1337 n1nj4 5k1||z

Age 20
Squark.
Seen June 18th, 2008
Posted July 6th, 2007
1,097 posts
19.1 Years
4.3 is standard, 5 is still buggy
Maybe 5 has stuff I want that 4.3 doesn't have.
I don't really know and I'm not reinstalling. It was hard enough getting it installed in the first place! Besides my php book is specifically for 5, not 4.3.
:t038::t037:
Age 35
Ohio
Seen June 19th, 2009
Posted June 17th, 2009
113 posts
18.1 Years
agreed on the 5 part. my server is currently running on php5 and running without a hitch.
~Shingo @ Pokemon Adventures MUSH (Founder/Head Admin/Coder)

A dedicated roleplay environment built around the canon pokemon universe where every player collaboratively works towards writing one main, large storyline with drama ahoy! We affectionately call it [PAM].

Check us out! http://pokemonadventures.game-host.org/
Age 62
Male
Melbourne, Australia
Seen April 26th, 2018
Posted June 9th, 2014
11,439 posts
19.7 Years
The server I'm on is running PHP5 just fine, it's taking all the scripts I throw at it anyway. And PHP5 does fix some security issues.


"One reason why mathematics enjoys special esteem, above all other sciences, is that its laws are absolutely certain and indisputable, while those of other sciences are to some extent debatable and in constant danger of being overthrown by newly discovered facts."
Albert Einstein

"What science can there be more noble, more excellent, more useful for men, more admirably high and demonstrative than mathematics."
Benjamin Franklin

"Mathematics, rightly viewed, possesses not only truth, but supreme beauty – a beauty cold and austere, like that of sculpture, without appeal to any part of our weaker nature, without the gorgeous trappings of paintings or music, yet sublimely pure and capable of a stern perfection such as only the greatest art can show."
Bertrand Russell

avatar and signature by FoxHound

ANNOY ME AT YOUR PERIL. I am becoming increasingly tired of the unmanly elitism and closed-mindedness of certain members who shall remain unnamed.
Age 32
Oakland Ca
Seen December 29th, 2008
Posted August 11th, 2008
3,549 posts
19.3 Years
I suspect it's because I turned error reporting to ALL and my script is not messed up, but I'm not sure.
well... you saw it works!
Stop waiting for GSC Remakes! Play the fan made remakes!
I support these rom hacks:



Also, while you're here, check out my GSC music project:
Thread | PureVolume
Age 62
Male
Melbourne, Australia
Seen April 26th, 2018
Posted June 9th, 2014
11,439 posts
19.7 Years
Well, turn off error reporting then... you don't need it, just code your own errors in using is_file and isset.


"One reason why mathematics enjoys special esteem, above all other sciences, is that its laws are absolutely certain and indisputable, while those of other sciences are to some extent debatable and in constant danger of being overthrown by newly discovered facts."
Albert Einstein

"What science can there be more noble, more excellent, more useful for men, more admirably high and demonstrative than mathematics."
Benjamin Franklin

"Mathematics, rightly viewed, possesses not only truth, but supreme beauty – a beauty cold and austere, like that of sculpture, without appeal to any part of our weaker nature, without the gorgeous trappings of paintings or music, yet sublimely pure and capable of a stern perfection such as only the greatest art can show."
Bertrand Russell

avatar and signature by FoxHound

ANNOY ME AT YOUR PERIL. I am becoming increasingly tired of the unmanly elitism and closed-mindedness of certain members who shall remain unnamed.