close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

str_replace

Thread began 5/02/2013 6:31 am by greg401801 | Last modified 5/02/2013 7:50 am by Jason Byrnes | 852 views | 1 replies |

greg401801

str_replace

I have created my registration pages using the Double Opt-in Registration System.

The .php page created (blank.php) that is the content for my confirmation email sends the following in my confirmation email:

Registration group Email: bob@abcde.com
Registration group Password: password1234
Registration group Confirm: password1234
Registration group First Name: Bob
Registration group Last Name: Smith
etc.....


I would prefer that it look like this:

Email: bob@abcde.com
Password: password1234
Confirm: password1234
First Name: Bob
Last Name: Smith
etc.....


I know there is an str_replace command in there that removes the "_" that is usually between "Registration_Email", etc.. Previously Jason helped me add another str_replace to remove the "Registration group " from the mail message. But it isn't working. I think something got jumbled or it wasn't saved or ????. I'm not sure what happened. Here is the str_replace code in my page:


<?php echo(str_replace("_"," ",$pkey)); ?>:</th>
<td style="font-size: 12px; padding: 3px;">
<?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?></td>
</tr>


I'm not exactly sure what the second str_replace is doing. But I'm sure it doesn't do what I want. Based on the first one, I suspect I want to add something similar to the following:

<?php echo(str_replace("Registration group "," ",$pkey)); ?>:</th>
<td style="font-size: 12px; padding: 3px;">


Since I'm unclear what $pkey is, I don't know if that belongs or not. Also, at the bottom of the email is the following:

Registration group 1 Fax: (234) 555-1234
Hidden Field:
Registration submit: Register
Verify Email: Verify you emaill address here.

I would like to remove:

Hidden Field:
Registration submit: Register


Is there an easy way to remove these two lines?

Sign in to reply to this post

Jason ByrnesWebAssist

$pkey is a variable that contains the name of the form element

so for the form element named:
Registration_group_Email

php:
<?php echo(str_replace("_"," ",$pkey)); ?>



removes the under scores and converts it to:
Registration group Email

to remove the fist part, add another str_replace to remove "Registration_group_"

php:
<?php echo(str_replace("_"," "str_replace("Registration_group_","",$pkey))); ?>




see this tutorial for details on removing some form elements from the email:
http://www.webassist.com/community/tutorials/view_tutorial.php?tid=21

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...