Important change to DreamHost form-mail script!

software development

#1

in response to this announcement posted today, i’ve decided to switch my form to post to a table in my databae and automatically generate an email when a new record is written. this works great and also prevents my real email address from being viewed in the source.

my question is this: what would happen if the database is down when someone tries to contact me. i.e., what kind of error message will be displayed if there is an attempt to insert into a table in a DB that is down?

thanks,
gabe


#2

[quote]i.e., what kind of error message will be displayed if there is an
attempt to insert into a table in a DB that is down?

[/quote]

This depends on how the script was written, and in what language you wrote it. Generally, though, when the form is submitted a “could not connect to database” error would pop up.

  • Jeff @ DreamHost
  • DH Discussion Forum Admin

#3

thanks, jeff. i have another question on this topic: is there a way to set up my mail-to form so that apostrophes and quotes will automatically be escaped? here’s an example of how it’s currently showing up in the DB/email:

“I’m publishing news…”

that is, it’s including the \ escape character. is there a way to leave that out?

thanks,
gabe


#4

if you are using php you could use the method stripslashes, it removes all slashes before both " and ’

Oh, and by the way, I have a question of my own aboyut the new mail policy.
I got a forum with a reply notification, you know, where you get an e-mail when someone replies to your post. I was using the standard dreamhost mail form, but that doesn’t seem to work with the new policy inplace ( no redirecting to mail addresses outide your own domain ). How can I change my script so it will work again?

Mark


#5

thanks, ractoc. that worked great. here’s what i’m doing after the variable is input into the form, but before my insert and mail trigger:

$message = stripslashes($message);

works like a charm!