Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-22 14:44:53

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

More (or again) on using php in txp

Hi, I searched but didn’t find answer to this:

before using txp, I would normaly made a contact.html page and contact.php page, and in my contact form action=“contact.php”.

Now, I made contact section in txp, and contact page, and linked them together. So, now when user click on send button, what is the best way to link those to pages?

I already tried just to upload contact.php file on the server, and in action I puted “http://www.mysite.com/contact.php and that is working, but now that file is practicly outside of txp.

Is this the best way to do this or is there anything else?

ps.
I know about plugins, but I want to use my own code
pps.
I also know that this could be done in one page, but I’m not that good in php

Thanks

Offline

#2 2007-12-22 15:56:28

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: More (or again) on using php in txp

try zem_contact_reborn plugin it did what you want inside txp

Cheers

Offline

#3 2007-12-22 15:57:41

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: More (or again) on using php in txp

Second what Dragondz says. Don’t bother with your own code, use ZCR instead.

Offline

#4 2007-12-22 20:56:23

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: More (or again) on using php in txp

Ok, I’ll try, but I would still like to know to do it the other way,

Thanks.

Offline

#5 2007-12-22 21:02:03

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: More (or again) on using php in txp

Ok, I’ll try, but I would still like to know to do it the other way

Tell us why. Little explanation would be great, because I don’t get it why you want make things harder.

Cheers!

Offline

#6 2007-12-23 07:53:43

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: More (or again) on using php in txp

if you really want to use your own contact.php for whatever reason then thats fine. you’ll just have to link to it directly. theres no reason to bring it ‘into’ textpattern. but seeing as you claim to be not good at php, its probably a bad idea anyway.

Offline

#7 2007-12-24 09:56:31

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: More (or again) on using php in txp

Gocom wrote:

Tell us why. Little explanation would be great, because I don’t get it why you want make things harder.

Cheers!

Well, I tought becouse I have another form in may web site, which is much biger then just a simple mail form, that I need to know the other way to.

But, if I can make any kind of form with zem, then thats great. I just sit down to work, so I’ll try it now.

Thanks a lot!

Offline

#8 2007-12-24 11:08:00

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: More (or again) on using php in txp

You can do what you want with zem plugin, you can have up to 10 field inside it, and more with some php coding.

I think you can use it, it s better for you and safer!

Cheers

Offline

#9 2007-12-24 12:38:07

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: More (or again) on using php in txp

I dont get it. Just been trying to put my contact form into zem plugin, and its
not that easy.

I mean, I already build my contact form using html and css, and it works just fine. Translating that into txp is a lot of work and tweaking. I used ol for my form and button replacement tehnic for submit button.

<form method=“post” action=“kontakt.php”>
<fieldset>
<ol> <li> <label for=“ime”>Ime: </label>

<input id=“ime” name=“ime” class=“text” type=“text” /> </li> <li> <label for=“email”>Email: </label> <input id=“email” name=“email” class=“text” type=“text” /> </li> <li> <label for=“sajt”>Web sajt: </label> <input id=“sajt” name=“sajt” class=“text” type=“text” /> </li> <li> <label for=“tema”>Tema: </label> <input id=“tema” name=“tema” class=“text” type=“text” /> </li> <li> <label for=“tekstPoruke”>Poruka: </label> <textarea id=“tekstPoruke” name=“tekstPoruke” class=“text”></textarea> </li>

</ol>

</fieldset >

<fieldset class=“submit”>

<button id=“replacement-1” type=“submit”>Send</button>

</fieldset>

</form>

Just how am I going to put this into zem plugin? And styling? And this is nothing special, its a simple form build with ol.

It looks to me like that zem is for those who just want a contact form, fast and easy.

Last edited by AndrijaM (2007-12-24 12:42:29)

Offline

#10 2007-12-24 13:33:02

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: More (or again) on using php in txp

So, you don’t know how to use the plugin, ZCR, and by that you blame it to be bad, only for simple contact forms. No, that’s not true at all, because it can do anysorts of things, and it also protects spam by neet steps.

Translating that into txp is a lot of work and tweaking.

No, it doesn’t. See:

<txp:zem_contact to="dest@example.com">
<fieldset>
	<ol>
		<li><txp:zem_contact_email label="Email" break="" /></li>
		<li><txp:zem_contact_text label="ime" break="" /></li>
		<li><txp:zem_contact_text label="web sait" break="" /></li>
		<li><txp:zem_contact_textarea label="Poruka" break="" /><li>
		<li><txp:zem_contact_submit label="Send" /></li>
	</ol>
</fieldset>
</txp:zem_contact>

Read the help doc of the plugin ;)

Cheers!

Last edited by Gocom (2007-12-24 13:34:51)

Offline

#11 2007-12-24 14:09:04

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: More (or again) on using php in txp

Thanks for helping, but I already tried that and still it is not ok.

I didnt said that ZCR is bad, but it do takes time to read through the doc and learn it.

For instance,

in my html code I have:

<li>
<label for=“ime”>Ime: </label>
<input id=“ime” name=“ime” class=“text” type=“text” />
</li>

To make that, I need to write this in zem:

<li><txp:zem_contact_text label=“ime” break=”“ /></li>

If I put on the label value “ime” then in my contact form next to the field is going to say ime, which is not correct in my language. I need to put Ime: like in the html:
<label for=“ime”>Ime: </label>

Also, label value automaticaly becomes id in input. I used that input id to for styling, my form layout depends on that id.
<li>
<label for=“ime” class=“zemText zemRequired ime”>ime</label>
<input type=“text” id=“ime” class=“zemText zemRequired” name=“ime” value=”“ maxlength=“100” />
</li>

Also, please tell me how can I, if i can add another class to the input or label, it is easier to add it to zem then to go in my css and make changes there.

So, I guess everything could be fixed, but then I need to go to my css file, make more changes, and thats more work.

Thanks again!

Last edited by AndrijaM (2007-12-24 14:14:19)

Offline

#12 2007-12-24 15:00:55

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: More (or again) on using php in txp

Got it, its the name atribute.

Thanks!

Offline

Board footer

Powered by FluxBB