Jump to content

Forms


UltimateOreo

Recommended Posts

PHP is in no way responsible for client side code. PHP outputs strings, most people use it to output strings of html. Having said that, html has no ability to interact with a server, it is strictly a markup language.

 

Explain what it is exactly you want to do.

Link to comment
Share on other sites

This html form will post data to foo.php.

 

<form action="foo.php" method="post">
  <input type="text" name="data">
  <input type="submit" name="submit">
</form>

 

foo.php

<?php

  if (isset($_POST['submit'])) {
    echo $_POST['data'];
  }

?>

Link to comment
Share on other sites

Also u cn try these within php tags except of html.

 

<?php
echo "<form action=\"foo.php\" method=\"post\">";
echo "<input type=\"text\" name=\"data\">";
echo  "<input type=\"submit\" name=\"submit\">";
echo "</form>";
?>

 

This will not require html tags to enclose.

Link to comment
Share on other sites

Everytime I try to submit the form, I get this-

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@vbulletintests.freeasyhost.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

--------------------------------------------------------------------------------

 

Apache/1.3.36 Server at www.vbulletintests.freeasyhost.com Port 80

Any help?

Link to comment
Share on other sites

I CHMOD everything 777 that has to be, and here is all the code that I am using, it is for a modification for the vbulletin forum system, Im am making it so that admins on the site can just fill in a field, and it will be submitted on the page. Heres the codes-

 

The PHP, without any forms/modifications-

 

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'biography');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array(
'biography'
);

// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('biography') . '");');
?>

Heres the HTML that I am using, and that the PHP is fetching-

 

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
<style type="text/css">
<!--
.top {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-top-color: #000000;
border-right-color: #000000;
border-bottom-color: #000000;
border-left-color: #000000;
}
.all {
border: 1px solid #000000;
background-color: #FFFFFF;
}
-->
</style>

$headinclude </head> <body> $header $navbar
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="$stylevar[cellspacing]" class="all">
  <thead>
    <tr align="center"> 
      <td align="left" valign="top" class="thead">
<div align="left"></div>
        <div align="left">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
            <tr>
              <td class="tcat">Biographys<td>
            </tr>
            <tr>
              <td><font size=4>The staff here at $vboptions[bbtitle] would like to think of $vboptions[bbtitle] as more of a community, not just a regular bulletin board. To help us achieve this goal, we have decieded to release short autobiographys about ourselves. We believe that this will help all of you to get acquainted with us better. It is always a good thing to know who you are working with.</font></td>
            </tr>
          </table>
 
 
 
<table width="100%" border="0" cellpadding="3" cellspacing="0">
            <tr>
              <td class="tcat">name of the persons biography<td>
            </tr>
            <tr>
              <td>actual biography goes here</td>
            </tr>
          </table>
 
<table width="100%" border="0" cellpadding="3" cellspacing="0">
            <tr>
              <td class="tcat">name of the persons biography<td>
            </tr>
            <tr>
              <td>actual biography goes here</td>
            </tr>
          </table>

          <font size="2"><font face="Verdana, Arial, Helvetica, sans-serif"></font></font></div></td>
      <if condition="$vboptions[showmoderatorcolumn]"> </if> </tr>
  </thead>
  $forumbits 
  <tbody>
  </tbody>
</table>
$footer 
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.