lawfour 0 Newbie Poster

I know about SQL and seen what the code looks like when creating tables but that's it.

Are you saying I have to write a sql code that will populate my form? That would be way off my scope of knowledge but if you stir me the right direction I would appreciate it. Where would I find sample code to study from?

Thanks
Larry:-)

lawfour 0 Newbie Poster

Hi

It's been awhile since I had a question, thanks for helping me out before. Now I have another question.

I have 50 plus doctors that I have a DB table, I was told that I only needed one table but I could not figure out how. Well I figured it out.

I have one form and a register form that all my doctors fills out for placing orders.

The register form contains the names, username, passcode, room, bldg, etc.

what I want to do is when a doctor signs in his information is automatically filled in using the register information that was fill out at signup.


Before it was easy all I had to do is use $x_Investigator = "Name",
$x_Room = "604", etc.

Using one form for everyone makes it impossible to do that.

Does anyone know how I can have the form automatically populate with the information given in the registeration form?

Thanks
L:confused:

lawfour 0 Newbie Poster

OH yeah, I will definately bookmark your website. I have a PDF called learn PHP in 21 days and think it will help me with the terminology. I have done what you said about searching google but non of the forums I went was as helpful as this one.

So I will start with baby steps and hopefull I will learn how to get my search engine to work. Sometime I get to excited and I go too fast, got to learn to slow down a bit.

Thanks alot.


I will learn alot here from other post.

lawfour 0 Newbie Poster

Thanks I panic big time I put a lot of work in the databases I created, but I think i better buy some books to read up on things.

Thanks

lawfour 0 Newbie Poster

I have no ideal what happen to my databases all of a sudden they stopped working.

What I can tell is the problem is in the header, actually I am not sure if it my hosting company who caused the problem because they did an upgrade to their server I think a couple days ago and now nothing works. Before I scream at them I thought I might ask someone here if you knew what the problem is.

OK back to the header the error I get is this:

Warning: session_start(): open(/tmp/sess_390089ed4b86819ce69a881e681f4334, O_RDWR) failed: Read-only file system (30) in /hsphere/local/home/lwilliam/lawfour.com/database/Demoadd.php on line 1

I don't want to post all of the errors here if you need to see them go here http://www.jci.tju.edu/~lwilliam/demo.html the error goes down to line 8 where the headers are.


This is to top of my php page:

<?php session_start(); ?>
<?php ob_start(); ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>

Now when I delete the header and session the page loads ok with no error until I try to submit something then the header error comes up and that is because within the code their is another header that redirects …

lawfour 0 Newbie Poster

OK,

Thanks

lawfour 0 Newbie Poster

I did some editing and now all i get is what i enter in the search field. the process.php just displays what i typed into it.

www.lawfour.com/esr/search.php

Thanks for all you help I really appreciate it.

Here is the new CODE.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SEARCH</title>
 <SCRIPT LANGUAGE="javascript">

function validate() {

fm = document.thisForm

//use validation here to make sure the user entered
//the information correctly

fm.submit()

}

</SCRIPT>
</head>

<body>

(javascript validation)


   <form name="thisForm" method="POST" action="process.php">           
<table width="30%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                      <td width="7%" class="verdana_login">Search:</td>
                     <td width="8%"> 
                       &nbsp;<input type="text" name="my_textbox" size="10">&nbsp;
                       </td>
                        <td width="12%">
                        <form>

    <?php echo $list; ?>

</form>
   <select name="my_dropdown">
                        <?
include ("http://www.lawfour.com/esr/dbconnect.php");
$dbops ="New MyOps";
$link ="$dbops->dbconnect()";
$list =" <option value='CommonEquip'>Common Equip.</option><option value='CommonEquip'>Lab Equip.</option>
<option value='Company'>Vendor</option><option value='Equipment Info'>Pending Repairs</option>
<option value='Parts'>Products</option><option value='Parts'>Parts</option><option value='RTP'>RTP</option>
<option value='Ticket'>Airgas Tickets</option> ";
?>
                            <option>Airgas Tickets</option>
                             <option>Products</option>
                              <option >Pending Repairs</option>
                               <option selected>Common Equip.</option>
                               <option >Lab Equip.</option>
                               <option >Vendors</option>
                               <option >RTP's</option>

                          </select>               


                        </td>

                      <td width="13%" align="center">&nbsp;<INPUT type=image name="btm_submit" src="http://www.lawfour.com/esr/images/go.gif" border="0" width="35" height="22" onclick="validate()"></td>



     </table></form>
</body>
</html>
lawfour 0 Newbie Poster

Having trouble connecting, not sure if i am setting up the code right. Below is what I have for search.php.

And I am not sure where this code goes, is it a separate page that give the results of the search?:

<html>

(javascript validation)

<form>
<select><?php echo $list; ?></select>
</form>

</html>

Also, when I do get the search engine working does that mean that I have to change my current index.html to index.php because I want to put the search on the top of my website at
http://www.jci.tju.edu/~lwilliam/

With the current code I get this error:

Fatal error: Cannot instantiate non-existent class: myops in /hsphere/local/home/lwilliam/lawfour.com/esr/search.php on line 27


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SEARCH</title>
 <SCRIPT LANGUAGE="javascript">

function validate() {

fm = document.thisForm

//use validation here to make sure the user entered
//the information correctly

fm.submit()

}

</SCRIPT>
</head>

<body>
<?

include ("http://www.lawfour.com/esr/dbconnect.php");

$dbops = New MyOps;
$link = $dbops->dbconnect();
$list = "<option value='CommonEquip'>Common Equip.</option><option value='CommonEquip'>Lab Equip.</option>
<option value='Company'>Vendor</option><option value='Equipment Info'>Pending Repairs</option>
<option value='Parts'>Products</option><option value='Parts'>Parts</option><option value='RTP'>RTP</option>
<option value='Ticket'>Airgas Tickets</option>";

?>

   <form name="thisForm" method="POST" action="process.php">




<table width="30%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 


                      <td width="7%" class="verdana_login">Search:</td>
                     <td width="8%"> 
                       &nbsp;<input type="text" name="my_textbox" size="10">&nbsp;
                       </td>
                        <td width="12%"> 
                          <select name="my_dropdown">
                            <option>Airgas Tickets</option>
                             <option>Products</option>
                              <option >Pending Repairs</option>
                               <option selected>Common Equip.</option>
                               <option >Lab Equip.</option>
                               <option >Vendors</option>
                               <option >RTP's</option>

                          </select>
                        </td>

                      <td width="13%" align="center">&nbsp;<INPUT type=image name="btm_submit" src="http://www.lawfour.com/esr/images/go.gif" border="0" width="35" height="22" onclick="validate()"></td>



                  </table></form>
</body>
</html>
lawfour 0 Newbie Poster

Ok, I hope I got the code right so far, if it is, now I need to connect to database.

I created the process.php file with this info:

<?php 

echo $_POST['my_textbox']; 
echo $_POST['my_dropdown']; 

//The name of these post variables is the same as the name 
//of the elements that were in the form 

?> 

This is the search (live) htt://www.lawfour/esr/search.php

I added the JS right under the form post info.

<form name="thisForm" method="POST" action="process.php">


                        <SCRIPT LANGUAGE="javascript">

function validate() {

fm = document.thisForm

//use validation here to make sure the user entered
//the information correctly

fm.submit()

}

</SCRIPT>

<table width="30%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 


                      <td width="7%" class="verdana_login">Search:</td>
                     <td width="8%"> 
                       &nbsp;<input type="text" name="my_textbox" size="10">&nbsp;
                       </td>
                        <td width="12%"> 
                          <select name="my_dropdown">
                            <option>Airgas Tickets</option>
                             <option>Products</option>
                              <option >Pending Repairs</option>
                               <option selected>Common Equip.</option>
                               <option >Lab Equip.</option>
                               <option >Vendors</option>
                               <option >RTP's</option>

                          </select>
                        </td>

                      <td width="13%" align="center">&nbsp;<INPUT type=image name="btm_submit" src="http://www.lawfour.com/esr/images/go.gif" border="0" width="35" height="22" onclick="validate()"></td>



                  </table>
lawfour 0 Newbie Poster

I am using MySQL

Q1. I know how to submit an HTML FORM to a PHP page and work with the $_POST, $_GET, $_REQUEST objects.

A1. I know how to submit an HTML form using PHP but I never used $_POST, $_GET, $_REQUEST at least not in php.

I use this to submit forms on my site:

mail("me@emailaddress.com", "KCC Abraham Gas Order", "Air Gas Link: weblink.php \n\n Investigator: $x_Investigator  \n\n Requested by: $x_Requested_By \n\n Customer Number:",
        "From: larry@{$_SERVER['SERVER_NAME']}\r\n" );

Q2. I know how to connect to a database, query a database, and work with the results with PHP.

A2. I use PHPMAKER to create my php/sql pages at the moment I am good at editing just about anything.

So I don't have a clue on where to start. This is as far as I can go

My Table Names

<select name="select">
                        <option>Airgas Tickets</option>
                         <option>Products</option>
                          <option >Pending Repairs</option>
                           <option selected>Common Equip.</option>
                           <option >Lab Equip.</option>
                           <option >Vendors</option>
                           <option >RTP's</option>

                      </select>

I know sad but I am trying.

Thanks

LW

lawfour 0 Newbie Poster

I am about to pull what little hair I have let trying to figure if this is possible. On my website I have a drop down menu with different tables in the drop down part.

What I am trying to do is have a user choose the table to get info from then in the search box type in keywords of what to search for.

Can this be done if so HOW? :eek:

Thanks

my website has the menu I am talking about but of course it does not work. www.jci.tju.edu/~lwilliam/ Need to find a script or somewhere that shows me how to do it. (The tables are not related, some may have a feild or two that are the same.)