LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2003, 02:48 AM   #1
neon
Member
 
Registered: Aug 2003
Location: Thailand
Distribution: Fedora 3
Posts: 56

Rep: Reputation: 15
setting up PHP & MySQL


I've tried setting up PHP & MySQL for days now.. i can't seem to do it? i've been following manuals and books exactly..
and shouldn't these come in the distribution anyways? i'm using RH 8.0
i selelcted it.. but it didn't work!!
need some guidance here.
 
Old 10-14-2003, 03:40 AM   #2
boreo
Member
 
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326

Rep: Reputation: 30
Mmmmmmm.. So what is the problem? What are the errors? Give us a little more information about the situation. Thanks.
 
Old 10-14-2003, 04:13 AM   #3
miknight
Member
 
Registered: Oct 2002
Location: Sydney, Australia
Distribution: Gentoo, Ubuntu, Debian
Posts: 184

Rep: Reputation: 30
I prefer not to use RPMs for these two apps, partly because I needed to customize PHP further but also because I was able to follow the instructions supplied in PHP's and MySQL's documentation.

I'd suggest removing the PHP and MySQL rpms and grabbing a MySQL binary from mysql.com and the PHP source from php.net.
 
Old 10-22-2003, 04:42 AM   #4
neon
Member
 
Registered: Aug 2003
Location: Thailand
Distribution: Fedora 3
Posts: 56

Original Poster
Rep: Reputation: 15
yeah that worked!
i removed them and re installed them again..
i don't know why the versions that came with the CD didn't work though.. Hmm..
anyways it works..

but another problem with php..
it doesn't seem to be able to pass values from one page to another..
ok, i start with a HTML page with a form, then submit the info to the .php file..
the .php can't seem to read the variables?

here is the .html code

--form.html

<HTML>
<head>
<title>form.html</title>
<META NAME="Generator" CONTENT="EditPlus">
</head>
<body>
<form action = "form.php" method = "get">
<table align = "center" border = 1 >
<tr>

<TD><font size=5><b>name</b></font></TD>
<TD><input type="text" name="name" size ="20"></TD>
</tr>
<tr>

<TD><font size=5><b>phone number</b></font></TD>
<TD><input type="text" name="phone" size="20"></TD>
</tr>
<tr>

<TD width="134" height="38" align="center">
<input type="submit" value="Yes" name="Yes"></TD>
<TD width="190" height="38" align="center">
<input type="Reset" value="Reset" name="reset"></TD>
</tr>
</table>
</form>
</body>
</HTML>

here is the .php code

--form.php

<?php
echo"<table align=center>";
echo"<TR><TD><font size=5>name</font></TD>";
echo"<TD><font size=5>$name</font></TD>";
echo"<TR><TD><font size=5>phone number</font></TD>";
echo"<TD><font size=5>$phone</font></TD>";
echo"</table>";
?>
 
Old 10-22-2003, 05:12 AM   #5
Butterbur
LQ Newbie
 
Registered: Oct 2003
Location: Shires
Distribution: Mandy 9.2
Posts: 7

Rep: Reputation: 0
Either edit your php.ini file and set register_globals to ON or better still use $_GET['variable_name']
Regards
BB
 
Old 10-22-2003, 05:26 AM   #6
neon
Member
 
Registered: Aug 2003
Location: Thailand
Distribution: Fedora 3
Posts: 56

Original Poster
Rep: Reputation: 15
nope.. still doesn't work..
 
Old 10-22-2003, 05:31 AM   #7
miknight
Member
 
Registered: Oct 2002
Location: Sydney, Australia
Distribution: Gentoo, Ubuntu, Debian
Posts: 184

Rep: Reputation: 30
Butterbur's advice is correct. You need to do what he's suggested. Make sure you restart apache after making these changes (and make sure you've edited the correct php.ini file Could there be one lying around from the previous installation?)
 
Old 10-22-2003, 05:40 AM   #8
neon
Member
 
Registered: Aug 2003
Location: Thailand
Distribution: Fedora 3
Posts: 56

Original Poster
Rep: Reputation: 15
ahh sorry i worked after all!
it wasn't the global variables actaully..
i just used the$GET_[variable]


very nice..
i spent all day trying to figure this silly thing out..
 
Old 10-22-2003, 05:46 AM   #9
neon
Member
 
Registered: Aug 2003
Location: Thailand
Distribution: Fedora 3
Posts: 56

Original Poster
Rep: Reputation: 15
actaully, why does this occur?
in the text book, they didn't use the $GET_['variable']
???
what's the difference?
 
Old 10-22-2003, 08:11 AM   #10
Butterbur
LQ Newbie
 
Registered: Oct 2003
Location: Shires
Distribution: Mandy 9.2
Posts: 7

Rep: Reputation: 0
It's a security issue. You can find details here
 
Old 10-23-2003, 04:58 AM   #11
miknight
Member
 
Registered: Oct 2002
Location: Sydney, Australia
Distribution: Gentoo, Ubuntu, Debian
Posts: 184

Rep: Reputation: 30
It IS about enabling the register globals option. $_GET["varname"] (or $_POST["varname"]) is always available, but when register globals is on, then PHP will automagically make $varname available (or 'register' them) in your script as a global variable.

The reason why the book doesn't use them is because the $_GET and $_POST arrays didn't come in until recent version of PHP. It used to be the case that the register globals options was set to 'on' by default. Nowdays it's set to off and the PHP people encourage developers to use the $_GET style method because it's more secure.

Last edited by miknight; 10-23-2003 at 05:05 AM.
 
Old 10-24-2003, 05:14 AM   #12
neon
Member
 
Registered: Aug 2003
Location: Thailand
Distribution: Fedora 3
Posts: 56

Original Poster
Rep: Reputation: 15
Ahah!
yeah, my book is a bit old..
i just got a new one, and it said what you said, pretty much.. !
thanks again!
 
Old 10-24-2003, 11:59 PM   #13
miknight
Member
 
Registered: Oct 2002
Location: Sydney, Australia
Distribution: Gentoo, Ubuntu, Debian
Posts: 184

Rep: Reputation: 30
No probs! Enjoy the language, it's a fun one.
 
  


Reply


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
Slackware guide for AMP Apache MySQL & PHP xushi Slackware 35 05-11-2006 12:18 PM
Setting up apache with php and mysql meander Linux - Networking 6 01-26-2005 05:10 AM
PHP & MySQL Count on PHP Gerardoj Programming 1 06-01-2004 11:43 AM
From RedHat9 to FreeBSD (Apache 2 & Mysql & PHP 4) guardian653 *BSD 5 12-11-2003 06:31 PM
Apache & PHP & Mysql thomas050682 Linux - Networking 5 03-03-2003 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 PM.

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