problem remembering the form fields after submitting form

1 view
Skip to first unread message

Shane

unread,
Apr 9, 2009, 7:10:15 AM4/9/09
to phpShop
Hello

I have set up a site using PHPshop and am having trouble getting the
form fields to populate when returning to the form fields after
submitting the form. I am working on the "register new user form" at
the moment. The required field list is long and takes users a couple
of attemps to get it right (without clientside validation). On
returning to the form field to correct the mistakes, the fields are
empty. I see there is php code to print the user variables but it
doesn't seem to work. value="<?php echo $username ?>"
I edited this to take the value from the POST[] array ie. value="<?
php echo $_POST["username"]; ?>"
but it still doesn't work.

I still don't know enough about sessions to get it to work - I guess
session details are being used to remember the $var names.

Any suggestions would be appreciated.

thanks

Shane

Shane

unread,
Apr 9, 2009, 8:53:13 PM4/9/09
to phpShop
please ignore the last message..... I found the problem:) but now
have another related problem.

I just realized the error message table is set to 100% within the
table body tag.
This hid the form below it (which contained the entered data from the
$vars array) so users had to browse back to return to the (empty) form
page.
I changed the height to 20% from the css class .ErrorTable and can
now see both error message and semi completed form (almost) .
Unfortunately this is only a temporary fix. I would prefer not to
have a percentage in there as another page may need more space to
relay the error
and I can't see the full form (even with only a 20% error on the
page).

I'm now trying to find where this ErrorTable is generated - I though
it was error.ihtml is th msgs folder but it isn't.

any help would be appreciated.

Also I need to find where the functions are stored. eg shopperAdd.

Thanks for all your help

regards

Shane

Jeff Newman

unread,
Apr 9, 2009, 10:31:46 PM4/9/09
to php...@googlegroups.com
i believe the error message is displayed at the bottom of the s_header.ihtml
file - probably in the c_header.ihtml file as well. it's the very first
thing put into the main content portion of the page, right before the other
pages are put in, like the flypage or browse page.

it's odd that a 100% table would cause you not to see what you were supposed
to be seeing, because i've never seen that table cover anything. i've
always seen the content following the table to acctually appear below the
error table, not under it. are you using a DIV version of phpshop?
--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.49/2050 - Release Date: 04/09/09
10:27:00

Shane

unread,
Apr 11, 2009, 6:11:26 AM4/11/09
to phpShop
Hi Jeff

I'm not using divs for layout (ie size isn't specified). I have some
divs in the header for color etc but kept the table layout as it was.
Height was set to 100% in the table in S_header.ihtml but removing
the height completely fixed the problem and places the content below
the error, as you say. I can't remember why I put height to 100%
originally but it caused the problem.

thanks to Uli for helping me out also.

regards

Shane

Jeff Newman

unread,
Apr 15, 2009, 10:48:09 AM4/15/09
to php...@googlegroups.com
Before I forget about it, i created a Store Closed feature. requires 5
little edits,and all should be good.

It works by limiting access based on a global field, then the login value
and the auth[perms] value.

if STORE_CLOSED is set to 1, store will be closed to everyone unless the
$login = 1 (meaning you'd like to try to log in) or $auth["perms"] = "admin"
(meaning your an admin thats already logged in.

this way, admins can get in and do their work while others are locked out.

so here are the hacks

config.php:
after the DEBUG section, add this section
[code]
# STORE_CLOSED Directive
# Shows "store closed" message and disables non-admin access.
# Good while developing
define("STORE_CLOSED","1");
define("CLOSED_MSG","The site is temporarily closed for maintanence. Please
try again in a few minutes.<p>Thank you.");
[/code]

index.php
wrap the HEADER ... FOOTER section with the following

before the header is inserted:
[code]
// Check for maintanence
if (!STORE_CLOSED || $login || ($auth["perms"] == "admin")) {
[/code]

after the footer is inserted:
[code]
} else {
echo CLOSED_MSG;
}

[/code]

the following are not required, but will notify the admins if they've left
the store closed (oops!).

s_header.ihtml
add this notification so that you'll know if you've left the site closed
replaces the first table column of the "Logged in as" table row
[code]
<td width="150" valign="top"><?php if (STORE_CLOSED) { echo "<font
style='color: red'><strong> Store Mode: Closed</strong></font>"; } else {
echo "&nbsp;"; } ?></td>
[/code]

c_header.ihtml
same thing here...
[code]
<td width="150" valign="top"><?php if (STORE_CLOSED) { echo "<font
style='color: red'><strong> Store Mode: Closed</strong></font>"; } else {
echo "&nbsp;"; } ?></td>
[/code]

header.ihtml
this adds the notice just under the header table at the beginning of the
second main table row...
[code]
<tr><td valign="top"><?php if (STORE_CLOSED) echo "<br><center><font
style='color: red'><strong> Store Mode: Closed</strong></font></center>";
?><br><table width="100%" cellspacing="0" cellpadding="4" border="0">
[/code]

Reply all
Reply to author
Forward
0 new messages