Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5
Author Message
mvillamizar
Regular
Regular



Joined: Nov 02, 2004
Posts: 54
Location: Colombia

PostPosted: Mon Jan 10, 2005 8:38 pm Reply with quote

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?
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Jan 10, 2005 9:09 pm Reply with quote

It appears it can't find 'subscription_module'. Make sure the spelling and case are correct.
 
View user's profile Send private message
mvillamizar







PostPosted: Mon Jan 10, 2005 9:17 pm Reply with quote

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
Worker



Joined: Jul 15, 2004
Posts: 108
Location: Charlotte, NC

PostPosted: Mon Jan 10, 2005 9:23 pm Reply with quote

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! 
View user's profile Send private message Visit poster's website ICQ Number
Raven







PostPosted: Mon Jan 10, 2005 9:41 pm Reply with quote

No, it can be lower case. Are you sure you have an index.php file?
 
mvillamizar







PostPosted: Tue Jan 11, 2005 8:40 am Reply with quote

I've got this:

../modules/subscription_module all in lower case and the code I posted on the first message on this topic is the index.php.

I have tryed typing the address on the address bar like:

http://www.mydomain.com/modules.php?name=subscription_module
http://www.mydomain.com/modules.php?name=subscription_module&op=1
http://www.mydomain.com/modules.php?name=subscription_module&op=2

and it works, but when I type http://www.mydomain.com/modules.php?name=subscription_module I see the form,then I fill in the form, click on submit button and I get the message Sorry, such file doesn't exist...

This is really driving me mad, it is quite weird.

What else can I do?
 
mvillamizar







PostPosted: Wed Jan 12, 2005 7:27 am Reply with quote

Raven, please any help on this topic
 
Raven







PostPosted: Wed Jan 12, 2005 8:43 am Reply with quote

Try changing
Code:
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







PostPosted: Mon Jan 17, 2005 4:11 pm Reply with quote

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.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©