Desperate for help newbie

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
usmanlakhani
Forum Newbie
Posts: 2
Joined: Mon Apr 20, 2009 10:58 pm

Desperate for help newbie

Post by usmanlakhani »

<html>
<body>
<?php
require_once ('MySQL.php');

if(isset($_POST['submit']))
echo('Error adding new author: ' );
?>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" name="submit" value="SUBMIT" />
</form>
</body>
</html>
When I run this in the browser, instead of showing me just 'Error adding new author', I am also shown everything inside the MySQL.php script file which is a lot of class definition.

2 ) I am also constantly getting an error for PDO installation.
Fatal error: Class 'PDO' not found in F:\Apache\htdocs\izineu\php\MySQL2.php on line 10

I have checked the php.ini file and I have uncommented the parts which have pdo in them.

Please help me out here !!!!
enoc22
Forum Commoner
Posts: 33
Joined: Wed Apr 01, 2009 12:45 pm

Re: Desperate for help newbie

Post by enoc22 »

I don't know much about PDO but i could see something else that could be fixed

change

Code: Select all

if(isset($_POST['submit']))
echo('Error adding new author: ' )
TO

Code: Select all

if(isset($_POST['submit']))[size=150][color=#FF0000][b]{[/b][/color][/size]
echo('Error adding new author: ' )
[size=150][color=#FF0000][b]}[/b][/color][/size]
and see if that helps any

Oli
usmanlakhani
Forum Newbie
Posts: 2
Joined: Mon Apr 20, 2009 10:58 pm

Re: Desperate for help newbie

Post by usmanlakhani »

Thanks enoc,

I figured it out myself ... i had forgotten to add the <?php and ?> signs around the code in the MySQL.php file. The minute I put that It was ok.

Thank you for your help.
enoc22
Forum Commoner
Posts: 33
Joined: Wed Apr 01, 2009 12:45 pm

Re: Desperate for help newbie

Post by enoc22 »

Anytime...I'm glad you figured it out..... :D
Post Reply