Forum Moderators: coopster

Message Too Old, No Replies

Need Direction with PHP Code

trying to undo Smarty Template design

         

old_expat

3:03 am on May 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On one important application, a hired coder left me in the lurch big time .. although he did take my 50% deposit.:)

He made a unilateral decision to use Smarty Templates, which I don't understand. I know that much of the code is still ther .. in the ****.tpl files, but I don't know how to *un-smarty* the code.

I can put much of it back together, but I'm wondering how to handle certain of the syntax, which I think is writing to a mySQL database.

I see lots of lines like: (page name is partner_account_create.php)

<form name="CreateAccount" method="Post" action="/partner_account_create.php">
{PROPERTYHIDDENFIELDS}

<input name="username" type="text" size="12" maxlength="20" value="{USERNAME}">

etc.

My problem is how to handle the {PROPERTYHIDDENFIELDS} and {USERNAME}.

What would the correct synyax (is that even the right word?) be?

My first reaction is to think:

<form name="CreateAccount" method="Post" action="/partner_account_create.php">

But I'm pretty sure this isn't right.

OTOH, the following seems right

<input name="username" type="text" size="12" maxlength="20" value="USERNAME">

Habtom

6:07 am on May 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

Smarty Templates are basically used for separating your design from your PHP codes. That way, when you want to change the design of the website, you can just jump and change the templates which will be reflected in all.

The ones in {curlybrackets} are the tags which will later hold the real values while generating the pages. The ones in curlybrackets are defined and assigned values at some part of the code, in which if you decide to avoid using them, you can import the PHP code assigning the values into the tpl pages and rename the tpl file into PHP.

If he has gone far enough, I recommend you to go ahead and continue using the Smarty templates.

Habtom

old_expat

1:40 am on May 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"If he has gone far enough, I recommend you to go ahead and continue using the Smarty templates."

Well, my problem is I barely understand PHP = I can't code PHP I can only do some limited queries.

I don't want to use Smarty Templates. Quite simple .. if I have a mistake in the template AND the PHP, I have 4 X as many trial and error frustrations.