General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 20th, 2003, 10:19 AM
Makka Makka is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 Makka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Reply

no code works only thing that will work is

<?php

echo "It is working";
?>

Reply With Quote
  #2  
Old April 22nd, 2003, 01:07 AM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
...then it's obviously working!

What does your other code do?

Reply With Quote
  #3  
Old April 24th, 2003, 08:13 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
Welcome to the forums, Makka.. Please referr to the rules in the future when posting Titles such as "Help" "Reply" etc usually don't give people a good idea about what you're needing help with...


What exactly are you trying to do? Do you have some sample code you can give us to look at so we can help you through it? Are you getting error messages? No output? What's going on?

Let us know and we'll help you as much as we can!

Reply With Quote
  #4  
Old April 25th, 2003, 06:28 AM
Makka Makka is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 Makka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
whoops

it seems i pressed the new thread button rather than the reply button. lol how silly of me

Well i have set up an apache server on my pc just to test my scripts on localhost but it only echos the things. It wont carry out functions.

This is the variable login script.

<?php
//variables

$pwd = "password";

?>

<form name = "login">
<input type = "text" name = "pass" value = "">
<input type ="submit" value = "submit">
</form>

<?php
if ($pass == $pwd)
?>

THE PROTECTED PAGES HTML GOES HERE



Please help and i dont get no errors it just does not do any thing and all help is appreciated

Reply With Quote
  #5  
Old April 25th, 2003, 07:31 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
ok.. where is your start of your form tags? like

<form name="frmLogin" action="/index.php" method="post">

?

also.. by default global_vars = off.. so you may need to get your form information via this kind of method
PHP Code:
 $login $_POST['login'];
$pass $_POST['pass']; 

Reply With Quote
  #6  
Old April 25th, 2003, 05:55 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Re: whoops

What script processes your form? Is it just meant to retrieve the same page, but with a password? Your form action needs to be set to the name of the script that will evaluate the form, even if it's just the same page. Assuming your page is called index.php, then have form action="index.php", or use $PHP_SELF.

PHP Code:
<?php
//variables

$pwd "password";

?>

<form name="login" action="index.php" method="post">
<input type = "text" name = "pass" value = "">
<input type ="submit" value = "submit">
</form>

<?php
if ($_POST['pass'] == $pwd) {
// note the opening brace!
// closing brace is below.
?>

THE PROTECTED PAGES HTML GOES HERE

<?php
}   // (end if. closing brace.)
?>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Reply


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


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway