>>
Site Map
>>
Forums
>>
Modules 7x
Forum module - topics in forum:
Modules 7x - Discussions regarding PHP-Nuke Modules. 7x
Cant contain my own variables in URL?
I have this url to my module:
/modules.php?name=shoutbox&shout
and that works fine. but whenever i try and post form information into it with <form method="POST" action="$sitename&shout"> ( I made $sitename elsewhere) it goes here:
/modules.php?name=shoutbox&shout
but it says the file doesnt exist

what should i do?
This is my code im using to get the post info:
| Code: : |
<?php
if(isset($shout))
{
$serror = false;
if(!strlen($_POST["name"]))
{
echo "<b>You must enter your name</b></br>";
$serror = true;
} else if(strlen($_POST["name"]) < 3)
{
echo "<b>Your name must be atleast 3 characters long</b></br>";
$serror = true;
}
if(!strlen($_POST["message"]))
{
echo "<b>You must enter a message</b></br>";
$serror = true;
} else if(strlen($_POST["message"]) < 5)
{
echo "<b>Message must be atleast 5 characters long</b></br>";
$serror = true;
}
if(!$serror)
{
$amount = strval(file_get_contents("xn/shoutbox/amount.txt"));
if(($famount = fopen("xn/shoutbox/amount.txt","w")) && ($fshouts = fopen("xn/shoutbox/shouts.txt","a")))
{
$amount++;
fwrite($famount,$amount);
fclose($famount);
fwrite($fshouts,$amount."name=".$_POST["name"]."\n");
fwrite($fshouts,$amount."shout=".$_POST["message"]."\n");
fwrite($fshouts,$amount."email=".$_POST["email"]."\n");
fclose($fshouts);
echo "Shout sent!";
}
} else {
echo "</br><i><a href=\"".$sitename."&enter\">Click here to try again</a></i>";
}
die();
}
?> |
So you're trying to post form code into your shoutbox as a shout?
$shout is just defining whether it should use the _POST info or not. Thats why it says if(isset($shout)). But yeah, form code into the shoutbox.
Well for starters as far as I'm aware nuke won't allow you to post form attributes in text areas anyway, but besides from that I've no idea how to fix your issue (if that's what it is)
Hmmm so what should I do?
EDIT: How does your_account module do it?
EDIT: Fixed it.
One way would be to put the variables in hidden input fields within the form and it will post them onto the page for you.
How did you get it working anyway ?