For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > June 2007 > You don't have permission









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author You don't have permission
Jean Pierre Daviau

2007-06-16, 6:58 pm

Hi everybody.

The email works fine and the echo lines works but I have this
warning:

You don't have permission to access
/<p>Nombre de personnes: 3</p><p>Jean<br>Non<br></p><p>1
courriels envoyés </p><p> </p>
on this server.

If I uncomment the if ($passe != "wsxqaz") the page does not
display proprerly.

=============================
<?php

function bureaudeposte($lius, $passe){
/*
if ($passe != "wsxqaz")
exit('Mauvais mot de passe');
*/
// Sujet
$subject = 'Bonjour ';
$message = "ok";


$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' .
"\r\n";

// Envoi
$db = mysql_pconnect("localhost", "root", "");
mysql_select_db("pierredata");

$query = "select * from demo_plein_air";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);

echo "<p>Nombre de personnes: ".$num_results."</p>\n<p>";
$j = 0;

for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
if (strstr($row["commentaire"], 'oui')){
$personne = $row["nom"];
mail($personne . '<'. $row["courriel"].'>',
$subject.$personne, $message, $headers);
$j++;
}
else
echo $row["nom"] . '<br>' ;
}
echo "</p>\n<p>$j courriels envoyés $laius</p><p> </p>";
}
?>

<form action="<?php bureaudeposte($laius, $passe); ?>">
<input type="text" name="passe" value=""/>
<textarea name="laius" rows="20" cols="80"></textarea>
<input type="submit" value="Vaut mieux y penser une fois avant
de cliquer!" onClick="return confirm('Vaut mieux y penser à deux
fois avant de cliquer!')" style="font-style:oblique;
background-color: transparent;"/>
</form>
================

--
Thanks for your attention.

Jean Pierre Daviau
--
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp



Rik

2007-06-16, 6:58 pm

On Sat, 16 Jun 2007 13:14:20 +0200, Jean Pierre Daviau <Once@WasEno.ugh>=
=

wrote:
> <form action=3D"<?php bureaudeposte($laius, $passe); ?>">


Nope, this is not how it works.

<form action=3D"<?php echo $SERVER['PHP_SELF']; ?>" method=3D"post">

The 'action' attribute is where the form posts it's contents to, it's no=
t =

a php function to be executed on the click.
-- =

Rik Wasmus
Jussist

2007-06-17, 7:01 pm

On Jun 16, 3:55 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> The 'action' attribute is where the form posts it's contents to, it's not
> a php function to be executed on the click.
> --
> Rik Wasmus


And just to underline this, what you type in your HTML tags are just
information for html -parser, which is client's browser. HTML or the
client, does not know anything about php-scripts you've written. The
php -functions you have are for php, and php alone. Therefore you post
html to html, and according to what was posted, you execute php
functions.

--
Jussi

Guy calls a government office, and proclaims "I want to be instated as
the president!" He gets the reply "Are you an idiot, or just mentally
ill?" The guy goes "Yes, yes! And I'm old, too!"

disczero.com
naamio.net
hoffburger.com



Jean Pierre Daviau

2007-06-17, 9:58 pm

Thanks


Rtyyyy

2007-06-18, 12:27 pm

http://www.WatchingTheTube.com/Medi...sp?clip=1673286
Edsterenceter95

2007-06-21, 10:04 pm

Pamela Anderson and Angelina Jolie licking each other all over by the truck!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com