Re: [PHP] your philosophy on php-design

2002-05-30 Thread Mike Gohlke

Wilbert,
On one site as an experiment, I decided to put each frame (I know you 
don't want to use them...read on) into a single .php.  It decides what 
to do via a switch on $act.  Consequently, it's simple to keep it 
consistent (menu, submenu, footer, etc.).
Add item link a href=index.php?act=additemitemid=blah?
Then just go through and create your table as necessary changing the 
subcontent as necessary.

Granted, this can make for a very large .php file which will be better 
served using APC cache or Zend Cache.

Mike...

Wilbert Enserink wrote:

Hi all,


I'm busy building a website. I cannot use frames.
Every page can be  divided in a table with 3x3 cells.

The row will be my main menu.
The first column wil be submenu.
The middel cell will display the actual content. 


||
--main menu--
|--  |---
 sub  |  main   |sub content
 menu   |  content   |
||
|--  |--
--footer-- 
||


the main menu will always be the same, same as the footer -- includes
the main content cell depends on which submenu function is choosen.

Some submenu items are: 

login
search in database
add to your favourite items
add to basket


Now I was wondering how to build my site. How should I deal with a function like 'add 
to basket'. I mean, when a certain item is displayed and the customer wants to add it 
to their basket I have call the script add_to_basket.php or something like that. 
However I don't want to leave the page where the item is displayed, cause that's 
confusing to the visitor. Even more..In the 'sub-content' cell I want to display data 
about ordering info, like there are so many items in the basket. 

So I have to call upon a script which stores the info about add_to_basket, load a 
total new page where 1 table cell changes, namely the sub-content cell, but still 
displayes the original product. 

So, If I were to use frames It could be done, but now I'm not thinking of frames but 
of displaying content dynamically in a tabe cell.

I would very much appreciate your expert opinion on this matter, I'm sure every idea 
helps me form my own ideas which I can use.
maybe there are people out there who have done this kind of thing, or know about 
large sites which use this same concept

Any philosophies are much appreciated!

Wilbert Enserink



 











-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-
  




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Intermediate Searching... screen.

2002-05-29 Thread Mike Gohlke

As stated elsewhere, this is somewhat similar to what you need.
(btw, NOT tested for syntax errors)

?
// $searchquery = their incoming request
// $finishedquery = an already stored request
// I use this style (inserting pointers to the searched records into a 
table for temporary use.  It's a halfassed form of caching)
//

if ( empty($finishedquery) ) {
echo(Searching...);
dosearch($searchquery);

echo(scriptdocument.location='$PHP_SELF?finishedquery=$searchquery;/script);
} else {
showsearch($finishedquery);
}
?

Jeff Bearer wrote:

I have a part of my site that searches a large database and sometimes it
takes more than a few seconds to return the results.  When searches take
longer, people get antsy and search again.  To let them know that the
search is working so they don't double efforts I'd like to have an
intermediate Searching... screen.

I don't have a good idea on how to do this and I'm looking for some
ideas or directions. How do I show one thing while the search is running
and another when the search is complete and also not loose the returned
record set?

  




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_SERVER_VARS

2002-05-05 Thread Mike Gohlke

Kyle,
Here's a quote I found on Usenet:
http://groups.google.com/groups?selm=aec2ace8.0204180402.4c562696%40posting.google.comoutput=gplain

--- paste ---
I think I found out what this HTTP_WEFERER is all about...

I was working on a perl script having this problem. Some PCs (Client)
running that script returned a HTTP_WEFERER (my PC for example) and
some a correct HTTP_REFERER!

Changing OS, Provider, Browser... had no effect.

My last guess, was to turn off my Firewall (*Norton* Personal Firewall)
and after that my PC returned a correct HTTP_REFERER!

Seems to be the solution
--- end paste ---


Hope this helps,
Mike...

Kyle Gibson wrote:

 Whoops. It wont show unless you come from somewhere else...


 Go here and click the link:

 http://www.plaguenet.com/wreferer.php


 Thanks,


 Kyle Gibson








Re: [PHP] rather a mysql question

2002-05-03 Thread Mike Gohlke

Depending on your OS, there's a good possibility that the OS is caching 
HD data.  So instead of mysql reading directly from disk, it's getting 
it from the memory cache.  Depending on how heavily your server is used, 
wait 10 or 15 mins (to let the memory cache clear out) and try it again.

Mike...

Ando Saabas wrote:

Sorry that this is more of a mysql question, but since most php
programmers use it a lot, i though i might find the answer without
subscribing to mysql list, here goes:
When i do a query from a big table using indexes,it takes for example 5
seconds. Now if i, after
some time repeat the query, the query takes about 0.5 secs.
So far i thought it was because of caching, but now i read mysql (v3.23)
doesnt
support query cache. So this really gets me wondering, where does the
speed increase come from?



  






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Writing Cross DB application

2002-04-15 Thread Mike Gohlke

ADOdb is probably your best bet for this.
http://php.weblogs.com/ADODB

Mike...

Arcadius A. wrote:

Hello !
I'm planning to write a database application for  MySQL, and then port it to
PostrgeSQL.
Is there any library or class that could help me to write/maintain just one
source code for both MySQL and PostgreSQL (on WIN and UNIX)?

Thanks in advance.

ARcadius








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Posting with script tags, or a plea not to

2002-04-12 Thread Mike Gohlke

Barry C. Hawkins wrote:
Barry  Rasmus (you already figured this out, I'm sure),
That's the problem, it's there but the browser is ignoring the ? ? tag 
as unknown (just as it should).  The only way Earthlink can fix that is 
to do an inline change of  to lt; and  to gt; when using the webmail 
side.

Personally, I would say things are working exactly as they should.

Mike...

Rasmus,
   I gathered info in several ways to hopefully save time.  I
composed a message containing a simple, one-line PHP echo function and
sent it to myself.  Not surprisingly, nothing showed in the message body
when pulled up via the webmail app.  The exhibits are displayed below.
This message was composed via Outlook, just to eliminate any confusion.

Message sent:
   Subject: PHP Test
   Message: ? echo Earthlink Mailcenter Sucks. ?

Message received in Earthlink webmail:
   Subject: PHP Test
   Message: (nothing appears)

View Source in IE 6.0:

snip
TR
  TD ALIGN=RIGHT VALIGN=TOP
FONT FACE=arial size=1
BSubject:  /B
/FONT
  /TD
  TD ALIGN=LEFT VALIGN=TOP
FONT FACE=arial size=1
BPHP Test/B
/FONT
  /TD
/TR

TR
  TD COLSPAN=2
HR WIDTH=95%

TABLE BORDER=0 WIDTH=90%
TR
 TDIMG SRC=./images/spacer.gif WIDTH=5 HEIGHT=10/TD
 TD
FONT SIZE=2
PREFONT SIZE=2? echo Earthlink Mail Center Sucks. ?
/PRE/FONT
 /TD
 TDIMG SRC=./images/spacer.gif WIDTH=5 HEIGHT=10/TD
/TR
/snip

Earthlink Mailcenter's view source hyperlink to mimeget.php3?:

snip
Subject: PHP Test
Sender: [EMAIL PROTECTED]
Message-ID:
[EMAIL PROTECTED]
X-Originating-IP: 66.149.18.3


? echo Earthlink Mail Center Sucks. ?

/snip

Thanks,






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Again, and Again, and AGAIN!

2002-03-20 Thread Mike Gohlke

Are you hitting enter while in one of the fields or clicking the submit 
button.  I've seen versions of IE that would not set the submit button 
if enter was used.  Personally, I would check for isset($username)  
isset($password).

Mike...

(Sorry for the very late reply, etc.  I've been dealing with a screwy 
server for the past few days:(

Jason Wong wrote:

On Sunday 17 March 2002 13:14, Jason Wong wrote:


You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see
changelog/history/php.ini for details).



Sorry a typo:

$HTTP_POST_VARS[] has been replaced by $_POST[]







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Mike Gohlke

Dr. Shim wrote:

I've tried repediately to have a PHP script validate a form when the form is
submitted. I'm quite new to PHP, and I'd really appreciate the help anybody
could give me. I've been stuck on this problem far to long.

I have a form (here's the code):

form method=post action=?php $PHP_SELF; ?
  Username:
  input type=text name=username maxlength=255 value=?
$HTTP_POST_VARS['username']; ?

The shortcut is ?php =$blah?, not ?php $blah?

  br
  Password:
  input type=text name=password maxlength=8 value=?
$HTTP_POST_VARS['password']; ?
  br
  input type=submit name=login value=Log In
onclick=document.refresh()

document.submit() should do it, refresh() will just reload the page.

  br
  br
/form

And right underneath the form code, I have my PHP script:

?php
 if (isset($login)) {
  insert();
 }

 function insert() {
  $db = odbc_connect('mydatabase', 'myusername', 'mypassword');

  if(!$db) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbr~~~br$PHP_ERRORbr$dbbr~~~;
  }

  $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password';
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbrbr . odbc_errormsg($db) . br~~~;
  }
 }
   ?

What I'm trying to achieve here is that when the user fills out the form,
presses the Log In button, the script underneath validates and inserts the
data into a database.  Now, I click on the Log In button, nothing happens.

Could anybody please help me with this? I would really, really appreciat any
help.








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php