PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
AYK
Hangin' Around


Joined: Apr 03, 2004
Posts: 32

PostPosted: Sat Apr 03, 2004 5:26 am Reply with quote Back to top

Hello,

I'm self-learning PHP and MYSQL at the moment from a book, and they were giving some examples like making a guestbook ( really really basic one ).

Now I'm having this problem :
I created module and an index.php for the guestbook allready were you are supposed to leave your message for the guestbook. Now when people press the submit button, I want the next PHP file to appear in the same place as the sign-in page. How can I do that ?
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Apr 03, 2004 9:17 am Reply with quote Back to top

I will assume you are calling the next file through a <form> tag using the ACTION attribute. To make the next file display in the same nuke window, you must code the ACTION attribute like this
Code:
<form action="modules.php?name=MODULE_NAME&file=FILE_NAME_WITHOUT_EXTENSION">
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
AYK
Hangin' Around


Joined: Apr 03, 2004
Posts: 32

PostPosted: Mon Apr 05, 2004 4:48 am Reply with quote Back to top

Thanks for the reply Raven ! I've been trying to fix the problem now but I'm getting the message "sorry such file doesn't exist".

This is the INDEX.PHP of the module :

Code:
<?php
#### Generated by Module Creator - By Disipal site (www.disipal.net) ####
if (!eregi("modules.php", $PHP_SELF)) {
   die ("You can't access this file directly...");

}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));

include("header.php");
$index = 1;
OpenTable();
echo " ";
echo "Sign my Guestbook !!!";
echo "<form action=modules.php?name=AYK&file=ce>";
echo "<table>";
echo "<TR>";
echo "<TD>";
  echo "<b>Name :</b>";
echo "</TD><TD>";
  echo "<input type=text size=40 name=name>";
  echo "</TD";
  echo "</TR></table>";
  echo "<br>";
  echo "<b>Location :</b>";
  echo "<input type=text size=40 name=location>";
  echo "<br>";
  echo "<b>E-mail :</b>";
  echo "<input type=text size=40 name=email>";
  echo "<br>";
  echo "<b>Home page :</b>";
  echo "<input type=text size=40 name=url>";
  echo "<br>";
  echo "<b>Comments :</b>";
  echo "<textarea name=comments cols=40 rows=4 wrap=virtual></textarea>";
  echo "<br>";
  echo " ";
  echo "<input type=submit name=submit value=Sign!>";
  echo "<input type=reset name=reset value=Start over>";
  echo " ";
  echo "</form>";

CloseTable();
include("footer.php");

?>


And this is the file ( CE.PHP ) that I want to appear when one presses the sign ! button :

Code:
<?php
#### Generated by Module Creator - By Disipal site (www.disipal.net) ####
if (!eregi("modules.php", $PHP_SELF)) {
   die ("You can't access this file directly...");

}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));

include("header.php");
$index = 1;
OpenTable();

include(dbconnect.php);

if ($submit == Sign !)
{
    $query = insert into guestbook
             (name,location,email,url,comments) values
             ('$name','$location','$email', '$url', '$comments')
             ;
             mysql_query($query) or
                 die ( mysql_error());
   
echo "<h2>Thanks !!!</h2>";
echo "<h2><a href=view.php>View My guestbook !!!</a></h2>";

 
}

else

{
    include(sign);
}



CloseTable();
include("footer.php");

?>


All files are in the /modules/ayk ( name of the module ) directory.

Do you have any tips for me ?
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Apr 05, 2004 5:06 am Reply with quote Back to top

When you click on the submit button and you get the error message, is the url in your browser the correct url? Remember on *nix systems it is case sensitive.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
AYK
Hangin' Around


Joined: Apr 03, 2004
Posts: 32

PostPosted: Mon Apr 05, 2004 5:13 am Reply with quote Back to top

This is the url that appears :
Only registered users can see links on this board!
Get registered or login to the forums!


hmm... I do not see it calling the ce.php file anywhere ...
View user's profile Send private message Visit poster's website
AYK
Hangin' Around


Joined: Apr 03, 2004
Posts: 32

PostPosted: Mon Apr 05, 2004 5:14 am Reply with quote Back to top

And it's not a unix system by the way : it's apache on winxp.

Thanks for the fast response by the way !
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Apr 05, 2004 6:26 am Reply with quote Back to top

I made a [mis]assumption that you would add the METHOD attribute to your FORM tag. Modify it to read
Code:
<form method=post action=modules.php?name=AYK&file=ce>
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
AYK
Hangin' Around


Joined: Apr 03, 2004
Posts: 32

PostPosted: Tue Apr 06, 2004 5:41 pm Reply with quote Back to top

Thanks ! I got it to work now. Laughing
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum