Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

difficulies with fopen

General discussions related to php

Moderators: macek, egami, gesf

difficulies with fopen

Postby reimar » Thu Jul 03, 2003 7:36 am

Hello,
I have some problems with the command fopen. after writing the correct password in a form, a new site should appear. But that doesn´t work. I tried the following:

<html>
<head>
<title>That´s the Login-File</title>
</head>
<body bgproperties="fixed" background="../background.jpg">
<?php
if (strstr($passwd, "1234")){ fopen ("http://omv-la.askoe.or.at/omv.la/news/writenews2.php", "r+b"); }
else { echo "wrong code"; }
?>
</body>
</html>

I tried it with several modes but they don´t work either.
Who can help me??
reimar
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Jul 03, 2003 7:26 am

Postby liquedus » Thu Jul 03, 2003 12:00 pm

is there an error message?

if so, could you post it?


quick-fix (maybe) :

if you are using a form and passing the password to your script on the same page or another use $_GET['passwd'] or $_POST['passwd'] instead of $passwd to access the contents of the form variable. :lol:
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby reimar » Thu Jul 03, 2003 12:58 pm

There is no error message. The page just doesn´t appear.
reimar
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Jul 03, 2003 7:26 am

Postby Redcircle » Thu Jul 03, 2003 1:19 pm

fopen does not output anything to the browser it just opens the file out. What is it you are trying to do?

You might be better off using include()

also in checking passwords you can use
Code: Select all
if($password == "1234")
include("URL");
else
echo 'wrong code';
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby reimar » Fri Jul 04, 2003 9:01 am

Thank a lot!
Now it works!!
reimar
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Jul 03, 2003 7:26 am


Return to PHP General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.