A little help here. i'm trying to insert player input data into the database but i keep on getting "No Access"
<?php
TableHeader("Shop");
echo "<form action='modules/companiesowner/content.php' method='post' name='first'>";
echo "<td>Name:<input type='text' name='CompName' value=''>";
echo "<td>Number:<input type='int' name='Wages' value=''>";
TableFooter();
ButtonArea();
SubmitButton('Submit', 'first');
LinkButton('Cancel', 'index.php?p=companiesowner');
EndButtonArea();
if (isset($_POST['first']))
{
$db->Execute("insert into company_owner(CompName,Wages) values(?,?)", $_POST["CompName"], $_POST["Wages"]);
}
?>
No access when $_post
- a_bertrand
- Posts: 1536
- Joined: Mon Feb 25, 2013 1:46 pm
Re: No access when $_post
Because you must always call the index.php not directly the module file "modules/companiesowner/content.php" !
so your form must be:
<form method="post"> (as the url in the action will be kept for you)
or if you really want to (and I would avoid it)
<form method="post" action="index.php?p=companiesowner">
so your form must be:
<form method="post"> (as the url in the action will be kept for you)
or if you really want to (and I would avoid it)
<form method="post" action="index.php?p=companiesowner">
Creator of Dot World Maker
Mad programmer and annoying composer
Mad programmer and annoying composer
- a_bertrand
- Posts: 1536
- Joined: Mon Feb 25, 2013 1:46 pm
Re: No access when $_post
You should really really start to read the existing code. All that is already multiple times in existing modules.
Creator of Dot World Maker
Mad programmer and annoying composer
Mad programmer and annoying composer