EditWrx Knowledge Base Home
 Search       Login   Register   Members   Help   Home 
Search by username


PHP code in the userblock
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
ericcoumans
Member
 

Joined: Tue Oct 10th, 2006
Location:  
Posts: 1
 Posted: Tue Oct 10th, 2006 04:39 pm
 Quote  Reply 
Why doesn't the following code work:

<div class="content" editblock="one" userblock="<?php echo $vak; ?>">
<p>Tekst...</p>
</div>
<!-- editblock="one" -->

I include the variable $vak into the page, it's just a easy solution to create new pages.
The only problem with this, when i edit the page, it opens correctly, only when i
save it, the userblock changes into:  userblock="<?php echo $vak; ?> , so without "> on the end.

Is there a solution for this problem?

Greets

#########################

The following code is working propperly:
<div class="content" userblock="<?php echo $vak; ?>" editblock="one"> <p>Tekst...</p>
</div>
<!-- editblock="one" -->

Can anyone explaine the difference between these codes to me.

Last edited on Tue Oct 10th, 2006 05:09 pm by ericcoumans

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Wed Oct 11th, 2006 12:16 am
 Quote  Reply 
eric

When editwrx is writing to the file it needs to have reference points in the file to work with. Since the contents it's received from the browser is different from the contents in the file, those reference points need to be outside the editblock. The two reference points are the open and close strings editblock="one"

Editwrx will rewrite that portion of the file that includes both strings and all content between them. Therefore, if your dynamic userblock is between those two strings it overwrites the file content with what was sent from the browser. The file at that point of course contains userblock="<?php echo $vak; ?>" while the browser saw and sent whatever was echoed. Placing your userblock outside of the two editblock strings isolates it in the file so it does not get changed.


 Current time is 12:08 am




Powered by WowBB 1.62 - Copyright © 2003-2004 Aycan Gulez