Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-13-2003, 03:29 PM   #1
Registered: Jan 2003
Posts: 55

Rep: Reputation: 15
problems running php script

I have been tryin to do this for a long time but no luck, so i decided to format the system again and start again.

I am tryin to set up a web server with PHP and MySQL.

I installed a fresh install of Red hat8. and after configuring the Network. i tested the server, and it worked fine.

when i tested php, it displayed ok.

Following this i tried to test PHP, with a basic script


$myvar = "Hello World, $firstname";

echo $myvar;



<FORM ACTION="inputform.php" METHOD=post>

First Name <INPUT TYPE=TEXT NAME="firstname" SIZE=30><BR>



The output i got is simply Hello world.

I really require help as i am tryin to work on this project and i am stuck at the setting up.

Any Help appreciated.

Old 02-13-2003, 03:59 PM   #2
Registered: Feb 2003
Location: NorthEast
Distribution: RH 8.0
Posts: 34

Rep: Reputation: 15
Although I never use PHP, I look it up on the web. Here is the syntax for ur inputform.php

This should work for u

<?php echo $_POST["firstname"]; ?>.

I think your concatenate method below is wrong. Check out the syntax for it.

$myvar = "Hello World, $firstname";

echo $myvar;

or Assumming ur syntax is correct... try this:


$myvar = "Hello World, $_POST["firstname"]";

echo $myvar;

Last edited by importboy03; 02-13-2003 at 04:09 PM.
Old 02-13-2003, 10:25 PM   #3
Registered: Jul 2002
Posts: 143

Rep: Reputation: 15
You can also go into the php.ini file and turn on register globals. That should fix it. But at a cost of security. Read up more on it at
Old 02-13-2003, 11:37 PM   #4
LQ Newbie
Registered: Feb 2003
Location: Duluth MN
Distribution: Debian, FreeBSD, SuSE
Posts: 23

Rep: Reputation: 15
SAMS PHP and MySQL Web Development book is an excellent resource. You can pick it up at or Barnes and Noble, or email me and I'll send you a link to the PDF version of it
Old 02-14-2003, 09:02 AM   #5
Registered: Jan 2003
Posts: 55

Original Poster
Rep: Reputation: 15
Fatal Error: running mysql_connect()

I am getting a fatal error when i try to submit data to my Mysql using php. is the page
the php is as folows:


mysql_connect (localhost, user, pass);

mysql_select_db (dbname);

mysql_query ("INSERT INTO tablename (first_name, last_name)
VALUES ('$first_name', '$last_name')

print ($first_name);

print (" ");

print ($last_name);

print ("<p>");

print ("Thanks for submitting your name.");

Old 02-14-2003, 01:01 PM   #6
Senior Member
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Works fine for me now


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cron NOT running php script ??!! hendrixx Linux - Software 2 11-15-2006 07:18 AM
libmysqlclient error when running a php script rose_bud4201 Linux - Software 2 06-03-2005 01:43 PM
cron NOT running php script ??!! hendrixx Programming 1 01-19-2005 05:36 AM
php script not running in FC2 benjam Fedora 2 08-09-2004 02:47 PM
'method not allowed' when running any php script... :( _MD_ Linux - Software 3 04-17-2004 08:13 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration