Author |
Message |
mvillamizar
Regular


Joined: Nov 02, 2004
Posts: 54
Location: Colombia
|
Posted:
Mon Jan 10, 2005 8:38 pm |
|
Hi,
I've got the following problem:
I'm creating a module
Code:<?php
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$index = 1;
include("header.php");
$form2 = <<<FIN
<form name="form1" id="form1" method="post" action="modules.php?name=subscription_module">
<input type="hidden" name="op" value="1"/>
<p>Nombre/Name
</p>
<p>
<input type="text" name="name" />
</p>
<p>Apellidos/Lastname</p>
<p>
<input type="text" name="lastname" />
</p>
<p>
<input type="submit" name="Submit" value="Enviar" />
</p>
</form>
FIN;
OpenTable();
?>
<table width="490" border="0" cellpadding="0" cellspacing="0" bgcolor="#E0DFE3">
<tr>
<td>
<?php
switch($op){
case 1: echo "Caso 1"; break;//confirmationForm();
case 2: echo "Caso 2"; break; //sendMail($_POST['message']);
default: echo "$form2";
}
?>
</td></tr>
</table>
<?php
CloseTable();
include("footer.php");
?>
|
When you call the module for the first time you see the form, then you fill the form and click the submit button and you get "Sorry, such file doesn't exist..."
what it is the problem? |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon Jan 10, 2005 9:09 pm |
|
It appears it can't find 'subscription_module'. Make sure the spelling and case are correct. |
|
|
|
 |
mvillamizar

|
Posted:
Mon Jan 10, 2005 9:17 pm |
|
I double checked many times and the case and the spelling are correct.
the thing that confuse me is that why the first time I can see the form, but when I submit the form, it can't find the module. |
|
|
|
 |
drmike
Worker


Joined: Jul 15, 2004
Posts: 108
Location: Charlotte, NC
|
Posted:
Mon Jan 10, 2005 9:23 pm |
|
I remember something about the first letter of all modules has to be a capital letter. I have a feeling that this is the issue.
-drmike |
_________________ Only registered users can see links on this board! Get registered or login! |
|
 |
 |
Raven

|
Posted:
Mon Jan 10, 2005 9:41 pm |
|
No, it can be lower case. Are you sure you have an index.php file? |
|
|
|
 |
mvillamizar

|
Posted:
Tue Jan 11, 2005 8:40 am |
|
|
|
 |
mvillamizar

|
Posted:
Wed Jan 12, 2005 7:27 am |
|
Raven, please any help on this topic |
|
|
|
 |
Raven

|
Posted:
Wed Jan 12, 2005 8:43 am |
|
Try changingCode:action="modules.php?name=subscription_module"
|
to
Code:action="http://your_domain.com/modules.php?name=subscription_module"
|
Just to rule out a path issue of any kind. Assuming that doesn't work, please zip up your subscription_module and email it to me. |
|
|
|
 |
mvillamizar

|
Posted:
Mon Jan 17, 2005 4:11 pm |
|
At last, I've got the problem!!!
I was using a form and one of the fields has it name attribute set to name.
PHPNUKE has a global variable called $name and takes the module's name as its value, so the form $name variable was overwriting the global one. That it is why I received always the error messege "Sorry, such file doesn't exist..." it couldn't find the file. |
|
|
|
 |
|