Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
killing-hours
RavenNuke(tm) Development Team


Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Fri Nov 19, 2010 10:07 am Reply with quote

Hey all-

Having a Blonde Moment it appears. I am writing a very simple and basic form that has 3 inputs & 3 divs on it so that I can play around with ajax testing different things. I've setup the form the way I "thought" it should be... however, I'm running into all sorts of problems. I must be missing something somewhere somehow.

Here is how i've tried it.. two files only (index.php & submit.php)

index.php:

Code:
<?php


if (!defined('MODULE_FILE')) {
      die ('Access Denied');
}

$module_file = "modules";

require_once("mainfile.php");


include('header.php');

opentable();

echo '<form id="submit" class="cmxform" action="' . $module_file . '.php?name=' . $module_name . '" method="post">';

echo '<table width="60%" id="formcontain" align="center" cellpadding="2" cellspacing="2" border="0">';

echo '<tr>';
echo '<td align="center">Input 1</td>';
echo '<td align="center"><input type="text" id="input1" size="15" /></td>';
echo '<td align="center"><font color="red"><div id="input1d">Returned Data</div></td>';
echo '</tr>';


echo '<tr>';
echo '<td align="center">Input 2</td>';
echo '<td align="center"><input type="text" id="input2" size="15" /></td>';
echo '<td align="center"><font color="blue"><div id="input2d">Returned Data</div></td>';
echo '</tr>';


echo '<tr>';
echo '<td align="center">Input 3</td>';
echo '<td align="center"><input type="text" id="input3" size="15" /></td>';
echo '<td align="center"><font color="green"><div id="input3d">Returned Data</div></td>';
echo '</tr>';


echo '<tr><td colspan="3" align="center"><input type="submit" id="submit" value="Submit Data" />';
echo '<input type="hidden" name="op" value="Submit" />'."\n";
echo '</tr>';


echo '<tr><td colspan="3" align="center"><b><div id="hover">HOVER TO FETCH DATA</div></b>';
echo '</tr>';

echo '</table>';



echo '</form>';

closetable();

include('footer.php');

?>




submit.php

Code:
<?php


 


$input1 = $_POST['input1'];

echo '<b>' . $input1 . '</b';
echo '<b>TEST</b>';


 ?>



The reason I don't have all the inputs on the submit is because I am debugging a separate error and reduced it down to a bare min.

So at this point... the form should be sending the data to the submit.php where I'm simply attempting to echo that data out to verify it's actually passing... it's not though. Not quite sure what I'm missing and where. (i've also tried hardcoding the submit location) Any advice or insight? Thanks.

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Fri Nov 19, 2010 12:23 pm Reply with quote

There is no code tell the script how to get to submit.php. You need to have a SWITCH statement that either displays the index or includes sumbit.php. Look at the example I posted in the javascript thread. Only registered users can see links on this board! Get registered or login! You can skip over all the javascript and css in the beginning. You will see a switch statement and two functions at the bottom. You can either wrap your code within the switch or use functions as I did.

If you do not understand let me know, and I can slap something together real quick to show you.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
killing-hours
PostPosted: Fri Nov 19, 2010 12:34 pm Reply with quote

Got it sorted... over my blonde experience. Wasn't using the "name". Wink Thanks nuken...i'm slow somedays.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©