Forum Moderators: coopster

Message Too Old, No Replies

faulty mailto: behaviour with php

phpBB script

         

stardotstar

3:52 am on Jun 27, 2005 (gmt 0)

10+ Year Member



This is my first post here - so, Hi, I am a forum admin who has begun to get quite familiar with php and the back end of such sites - I am now running a dedicated server with php/mysql/apache to serve a heavily modded phpBB...

I have searched far and wide on this and am coming up with blanks and I'm sure its not that hard...

I have a mod to alter the post body template of a phpBB post that should allow someone to Report the Post to an Administrator; by invoking the user's local mail client with mailto: and sending me, the admin an email with a subject and body populated with variables from the post...


<tr>
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span><p align="right">
<font face="Verdana" size="1">
<a href="mailto:stardotstar@example.com?subject=MySite.com Offending Post&body=Posted By: {postrow.POSTER_NAME} {postrow.POST_DATE} http://www.example.com/phpBB2/viewtopic.php?p={postrow.U_POST_ID}#{postrow.U_POST_ID}">
Report Post To Administrator</a></font></p>
</tr>

I have placed this code in GoLive and get the same result every time as when it is implemented in the board:

Lotus Notes fires up and creates an email addressed to me (so the mailto:stardotstar@example.com is working) but with the subject line:


MySite.com Offending Post&body=Posted By: 25 Jun 2005 02:05 pm http://www.example.com/phpBB2/viewtopic.php

So, only the date/time stamp variable is working and the whole body is in the subject field...

Why> I am getting familiar with php but out of my depth here. Somehow there seems to be two problems:
1) The syntax is not recognising that &body should begin the body off the email and
2) The variables are not being seen as variables or they are undefined and the variable name is dropping in...

Can anybody please shed some light on this for me to troubleshoot?

TIA
Will.*

[edited by: tedster at 4:36 am (utc) on June 27, 2005]
[edit reason] use example.com [/edit]

ergophobe

4:47 pm on Jun 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hmm... I would start by URL encoding my parameters as in

... a href="mailto:stardotstar@example.com?subject=<?php echo urlencode("MySite.com Offending Post");?>&body=... etc

See if that helps

stardotstar

10:24 pm on Jun 29, 2005 (gmt 0)

10+ Year Member



I have tried some combinations of that but it is not working for me.

I am still too new to the coding to hack this out myself, perhaps I need to go back to basics and use another approach to the report post to admin requirement.

Thank you for your help. I will look further into the urlencode syntax and continue to experiment :)

Will