[GRLUG] PHP question ... was Client/Server Database app question

Chris Lamrock clamrock at nmtdie.com
Thu Feb 2 11:28:46 EST 2006


Wow there is a ton I don't know!

Now I've got another thing to google today... :-)

Thanks for all your help!

-----Original Message-----
From: grlug-bounces at grandrapids-lug.org
[mailto:grlug-bounces at grandrapids-lug.org]On Behalf Of Topher
Sent: Thursday, February 02, 2006 11:20 AM
To: GRLUG general mailing list
Subject: Re: [GRLUG] PHP question ... was Client/Server Database app
question


> Now I think I just have to put the buttons in some sort of table so they 
> are lined up - after adding a new form in there the find went to a 
> separate line...

Rather than putting them in a table, give each on a class like this: 
class="inlinebuttons"  and then in your css file put in this:

.inlinebuttons {
   position: inline;
}

they'll all line up nicely.  You could put in some padding: 0 5px 0 5px; 
if you want some spacing around them.

>
> Thanks Again!
>
> -----Original Message-----
> From: grlug-bounces at grandrapids-lug.org
> [mailto:grlug-bounces at grandrapids-lug.org]On Behalf Of Kaminski Dennis J
> Sent: Thursday, February 02, 2006 10:51 AM
> To: GRLUG general mailing list
> Subject: Re: [GRLUG] PHP question ... was Client/Server Database app
> question
>
>
> Wouldn't you just have to put the FIND button in a different form?
>
> Dennis J Kaminski
>
>
>
>
> -----Original Message-----
> From: grlug-bounces at grandrapids-lug.org
> [mailto:grlug-bounces at grandrapids-lug.org] On Behalf Of Chris Lamrock
> Sent: Thursday, February 02, 2006 10:40 AM
> To: GRLUG general mailing list
> Subject: Re: [GRLUG] PHP question ... was Client/Server Database app
> question
>
>
>
> Ok - I understand changing the form tag will re-route the user to the
> search.php - but then it won't submit to itself for the other buttons
> correct?
>
> Also instead of submitting to itself what do recommend?  What could I
> google for to find an example?
>
> Thanks!
>
>
> -----Original Message-----
> From: grlug-bounces at grandrapids-lug.org
> [mailto:grlug-bounces at grandrapids-lug.org]On Behalf Of Topher
> Sent: Thursday, February 02, 2006 10:29 AM
> To: GRLUG general mailing list
> Subject: Re: [GRLUG] PHP question ... was Client/Server Database app
> question
>
>
>> Hmm  Maybe this will help...
>>
>> Here is the code to the "main" program customers.php...
>>
>>
>> What I would LIKE to do is when I hit the "FIND" button (at the bottom
>
>> of the included code) I would like it send the user to the separate
>> program - search.php.
>>
>> I already have search.php returning the user to customers.php.
>>
>>
>> Does this help any?
>
> Sure, it looks like this current script is submitting to itself.  I
> personally don't prefer that method for a variety of reasons, but it's
> not uncommon.  If you want it to instead go to search.php, change your
> form tag to be like this
>
> <form action="/path/to/search.php" method="post">
>
> You can change the method to "get" if you want the variables to stay in
> the URL (good for bookmarking results).
>
> Also, I'd suggest moving your database connect info to a seperate file,
> and including it.  Then you can let people see your code whenever
> without having to remember to remove your stuff each time.
>
> include($_SERVER['DOCUMENT_ROOT'] . "/path/to/dbconnect.inc.php");
>
>>
>>
>>
> <-----------------------------------------------------------------------
> ----
>>>
>> <html>
>> <body>
>>
>> <div align="center">Proquote V 3.0
>> <font size="-1"><div align="center">Customer Database</font> <br><br>
>> <?
>> $id=1;
>> if (isset($place)){$id=$place;};
>> if (isset($submit)){
>> if ($submit == "Next") { $id=$id+1;}
>> if ($submit == "Previous") { $id=$id-1;}
>> if ($id < 1) {$id=1;}
>> }
>> ?>
>> <?php
>> $db = mysql_connect("localhost", "user","password");
>> mysql_select_db("proquote",$db);
>> $result = mysql_query("SELECT * FROM customers where
> customer_id=$id",$db);
>>
>> if ($myrow = mysql_fetch_array($result)) {
>>
>>  echo "<table border=1>\n";
>>
>>    printf("<tr><td>Customer Id</td><td>%s</tr>\n",
> $myrow["customer_id"]);
>>    printf("<tr><td>Company</td><td>%s</tr>\n", $myrow["company"]);
>>    printf("<tr><td>Address</td><td>%s</tr>\n", $myrow["address"]);
>>    printf("<tr><td>Address_2</td><td>%s</tr>\n", $myrow["address_2"]);
>>    printf("<tr><td>City</td><td>%s</tr>\n", $myrow["city"]);
>>    printf("<tr><td>State</td><td>%s</tr>\n", $myrow["state"]);
>>    printf("<td>Zip</td><td>%s\n", $myrow["zip"]);
>>    printf("<tr><td>Phone</td><td>%s</tr>\n", $myrow["phone"]);
>>    printf("<tr><td>Fax</td><td>%s</tr>\n", $myrow["fax"]);
>>    printf("<tr><td>Contact</td><td>%s</tr>\n", $myrow["contact"]);
>>    printf("<tr><td>Email Address</td><td>%s</tr>\n", $myrow["email"]);
>>
>>  echo "</table>\n";
>> }
>>
>> ?>
>> <p /><form>
>> <br><br>
>> <input type="submit" name="submit" value="Previous" />
>> <input type="submit" name="submit" value="Next" />
>> <input type="submit" name="submit" value="Find" />
>> <input type="submit" name="submit" value="Add" />
>> <input type="submit" name="submit" value="Edit" />
>> <input type="submit" name="submit" value="Delete" />
>> <input type="submit" name="submit" value="Close" />
>> <input type="hidden" name="place" value="<? echo "$id"; ?>" />
>> </form>
>> </body>
>> </html>
>>
> <-----------------------------------------------------------------------
> ->
>>
>>
>> _______________________________________________
>> grlug mailing list
>> grlug at grandrapids-lug.org
>> http://grlug.org/mailman/listinfo/grlug
>>
>
> Topher
> Manager of Internet Services
> Cornerstone University Radio
>
> ------
> perl -e 'print join "", (map(chr,(shift =~ /\d{3}/g))), "\n"' \
> 105032119105115104032105032107110101119032112101114108
> _______________________________________________
> grlug mailing list
> grlug at grandrapids-lug.org
> http://grlug.org/mailman/listinfo/grlug
>
>
>
>
> _______________________________________________
> grlug mailing list
> grlug at grandrapids-lug.org
> http://grlug.org/mailman/listinfo/grlug
> _______________________________________________
> grlug mailing list
> grlug at grandrapids-lug.org
> http://grlug.org/mailman/listinfo/grlug
>
> 
>
>
>
>
>
> _______________________________________________
> grlug mailing list
> grlug at grandrapids-lug.org
> http://grlug.org/mailman/listinfo/grlug
>

Topher
Manager of Internet Services
Cornerstone University Radio

------
"People, I think, read too much to themselves; they should read aloud from
time to time to hear the language, to feel the sounds."
                         -- Louis L'Amour, The Lonesome Gods
_______________________________________________
grlug mailing list
grlug at grandrapids-lug.org
http://grlug.org/mailman/listinfo/grlug

!DSPAM:43e23228145126078711380!




More information about the grlug mailing list