Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old January 25th, 2003, 08:58 PM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Need help setting up PHP under Apache

Hi, im running Apache 1.3 Win32 on Windows XP. Ive successfully (almost) set up PHP on it with MySQL. The trouble is, that sending information from a form does not work, either in querystrings or using the post/get method. Whenever i try to read the info it comes up as a blank string. Have i missed out some vital line in php.ini or somewhere else?

Any help is greatly appreciated.

Thanks

Reply With Quote
  #2  
Old January 25th, 2003, 10:14 PM
perfectphp perfectphp is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 3 perfectphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I highly suggest using PHPTriad (URL). It automatically sets up Apache, PHP, MySQL, and a copy of phpMyAdmin.

Reply With Quote
  #3  
Old January 26th, 2003, 09:14 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
nkunicki:

Check your php.ini file and make sure if you have your register globals = off

if so, that is why it isnt posting propperly, you will need to either
A) turn register globals = on

or

B) use the $_POST[] or $_GET[] arrays for passing values from your form to the next page.

For example, my register globals = off so my code would be thus:

PHP Code:
<?
    $uname 
$_POST['user'];
    
$pass $_POST['pass'];
    if (empty(
$user) || empty(!$pass)){
    
//The username/password did not post.. draw out the userform
        
echo "<h3>User Login</h3>
        echo "
<form action '$_SERVER[PHP_SELF]' method 'post' >n";
        echo "
Username: <input type 'text' name 'user'><Br/>n";
        echo "
Password: <input type='password' name 'pass' <br/><br/>n";
        echo "
<input type 'submit' name 'submit' value 'Login'><input type 'reset' value ='Reset'>n";
        echo "
</form>n";
    }
    else { // The username and password did post, display them for debugging purposes
        echo "
username value$uname";
        echo "
password value$pass";
    }
?>


or something similar to that

show me a sample of some of your code and I can try to help you debug it..

Reply With Quote
  #4  
Old January 26th, 2003, 10:02 AM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
perfectphp: Hi, i tried phptriad, i didnt really like it as i didnt have full control over it in my opinion. Thanks anyway

nicat23: Ive checked, i already have registerglobals set to on. I tried using the $_POST or $_GET methods you suggested, but it still returns a blank string. Any ideas?

Thanks

Reply With Quote
  #5  
Old January 26th, 2003, 10:21 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Turn register globals off and restart your webserver..

take the code I posted below and put it into a new php file, like test.php

then go to your webserver and load test.php

it should show the userform..

input the items into the form and then hit submit, it should work.. let me know if it doesnt and I'll see what else I can do for you.

I'm at work right now and the power went out at my house last night and I forgot to power my ups back on as well as my webserver before I came to work... I'll put the same thing on my site and let you see what it is supposed to do..

post me a sample of your code that you're using and we'll go from there, k?

- Justin

Reply With Quote
  #6  
Old January 26th, 2003, 10:40 AM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Hi, the code you gave me worked. But i have another problem. I have no code right now, im just trying to get the server working. The problem is, im using an example querystring that looks like ?user=blah&pass=blah, and for some reason $user and $pass return null each time, with register globals on or off. Any ideas?

Thanks

Reply With Quote
  #7  
Old January 26th, 2003, 10:57 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
if that's being passed in the URL Then you'll need to use the
PHP Code:
 $user $_GET['user'];
$pass $_GET['pass']; 

methods

check the userform and look and see what method you are using, either post or get.. again if it's being passed through the URL then more than likely you are using the GET method..

check your form out, if it shows
Code:
<form action ='test.php' method = 'post'>

then you are using the post method, which is what I use for my code..

if it shows
Code:
<form action ='test.php' method = 'get'>


then you are using the get method, which would explain why you aren't getting any results from the queries

Reply With Quote
  #8  
Old January 26th, 2003, 11:24 AM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Aahh, thank you. Im a newb to PHP, so i didnt quite fully understand that.

Thanks for all the help

Reply With Quote
  #9  
Old January 26th, 2003, 11:44 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Quote:
Originally posted by nkunicki
Aahh, thank you. Im a newb to PHP, so i didnt quite fully understand that.

Thanks for all the help


Everyone's new at one point or another

Why dont you just post the code you have so far into here and I'll look at it and see what I can tell from it?

Reply With Quote
  #10  
Old January 26th, 2003, 12:07 PM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Like i said, i didn't actually have some code at this point, i was just setting up Apache and PHP, and testing it out with a few pre-made scripts that didnt seem to be working. Thanks anyways

Reply With Quote
  #11  
Old January 26th, 2003, 01:01 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Ahh I see.. well... no problem, hope I helped.

Reply With Quote
  #12  
Old January 26th, 2003, 07:05 PM
limnil limnil is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Lithuania
Posts: 20 limnil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

i've read your discussion, it nice that you (nicat23) can help us(newb). So like others newb i have a theoretical question:
I'm building a login page whit mysql database, session_start and session_end shows me if user is loged in or loged out. So my question would be like this:
a)what is your idea about the login pages( i think you have build some)maybe you can share these ideas
b) and about security problems......

It would be nice that you share your ideas and tell me some basics to create secure site

thanx

Reply With Quote
  #13  
Old May 7th, 2003, 09:22 PM
pharao pharao is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 1 pharao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Need help setting up PHP under Apache

Another good ressource (in german - I thinks so...) is

URL

with Apache vor Linux (LAMP) and Windows (WAMP) within PHP4

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Need help setting up PHP under Apache


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.