Advertisement
 

Membership

 

Advertisement

 

Search

 
Forums \ General forum \ Good HTML knowledge needed
2 months ago

LML

(Forum moderator)
Good HTML knowledge needed (342 reads, 10 replies)
yo,
so I learned html on friday/saturday cuz I was bored and so I finally got the time to do it.
So, after those 4-6hours of learning it in a tutorial (including css) I can do some nice layout and some stuff, but now I need to know something more and can't rly find anything regarding this on the inet (yes, I used google to find something..).

So, here is my problem:
I want to a text from a textbox to be send to an email, BUT, I don't want the user to get a window opened from where he can send it, I want it to get send directly. Can this be done with html? Can I just set a default email from where it is suppossed to get send and then it will work? If so, could you tell me the code please?:)

Thanks in advance~
Quote  
 

2 months ago
#1

NaW-Emerald

  6
You cannot do this with HTML. PHP (or ASP) is required and i might also let you know that it aint directly basic knowledge either to get such a function to work, avoiding spam filters etc.

Hire someone to make it for you, or finish learning HTML/CSS and move on to PHP, including SQL databases next. Then take it step by step until you can make such a mail form function.
Top of the page   Quote  

2 months ago
#2

LML

(Forum moderator)   17
hm, I will learn php in school soon, but I think copying such a line from inet might work, too? >_<'
Top of the page   Quote  

2 months ago
#3

NaW-Emerald

  6
It is more of 50+ lines of PHP code including the form HTML code. Atleast if you want it to validiate fields and be secure from abuse, such as injections. In addition you also need to make sure it works together with your servers POP3 (mailserver) settings.
Top of the page   Quote  

2 months ago
#4

LML

(Forum moderator)   17
hm, I just wanted it to send me an email, but it seems pretty hard:(
I will just let it the way it is right now, till I am good enough in php, then I will re-do the whole page, anyways. :)

Thanks anyways emerald


another question: if I want to write something like <text i wanna write> on my homepage, it will count as html, how to display it as text on the page?
Top of the page   Quote  

2 months ago
#5

zKod

  1
If it's PHP, it won't display as HTML.

I might have misunderstood what you were trying to say.
Top of the page   Quote  

2 months ago
#6

JoeDoe

  1
2008-08-25 21:55:31, Qpad.Emerald wrote:
It is more of 50+ lines of PHP code including the form HTML code. Atleast if you want it to validiate fields and be secure from abuse, such as injections. In addition you also need to make sure it works together with your servers POP3 (mailserver) settings.

1. i dont see what you want to validate there...
Validation is only important when you store the data in a database to avoid SQL Injection f.e...
2. Making sure PHP can communicate with the mailserver is not something that is done in the script we are talking about. Its a server setting. and any hosting plattform should do that right out of the box.

So, sending an E-Mail is as easy as this:
<?php
mail("LML@LMLdomain.com", "My Subject", "My Message");
?>

More infos on that on: http://ch2.php.net/manual/en/function.mail.php

There are 2 ways to get the text from a <form> element. Post and Get. In your case, $_POST is the thing you want to use.
Use google to find examples. its really very basic the thing you want to do. im sure if you are able to copy / paste and read you can figure it out...

p.s. Using ' instead of " may be cleaner. both work, as PHP is very tolerant. I used " only because Gosugamers seem to escape '
p.p.s Remember: PHP is not that hard. Unless you pay me for it. in that case, its very very complex
Top of the page   Quote  

2 months ago
#7

JoeDoe

  1
2008-08-25 22:02:04, LML wrote:
another question: if I want to write something like <text i wanna write> on my homepage, it will count as html, how to display it as text on the page?


any text that is inside the <body></body> tag will be displayed on your site.
so, (very) simplified (but working), it would be:
<html><header></header><body>text i wanna write</body></html>
Top of the page   Quote  

2 months ago
#8

MiNOS-_-

  3
2008-08-25 22:02:04, LML wrote:
another question: if I want to write something like <text i wanna write> on my homepage, it will count as html, how to display it as text on the page?



&lt; text i wanna write &gt;

^ just type like that inside html code
Top of the page   Quote  

2 months ago
#9

LML

(Forum moderator)   17
I see some code of you minos>_<'

also, I mean text inbetween the < and > which my html page won't display (same with gg.net, if you just write something between smaller and bigger signs, it won't get displayed <ye>), I guess cuz it counts it as a tag ..


edit: yo, sctv, you fucked the page? o_O' if you are using code in your post, use the [code] syntax, so it won't affect the page, thanks.
Top of the page   Quote  

2 months ago
#10

SCTV

  4

Parse error: syntax error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/web83/web/functions/common/common_functions.php(222) : regexp code on line 68

Fatal error: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Failed evaluating code: '[code]'.str_replace(&quot;[&quot;,&quot;&amp;#91;&quot;,htmlentities(&quot; &lt;?php ### Konfiguration ### # Bitte passen Sie die folgenden Werte an, bevor Sie das Script benutzen! # An welche Adresse sollen die Mails gesendet werden? $strEmpfaenger = \'IhrName@provider.xy\'; # Welche Adresse soll als Absender angegeben werden? # (Manche Hoster lassen diese Angabe vor dem Versenden der Mail ueberschreiben) $strFrom = \'\&quot;Formmailer\&quot; &lt;IhrAndererName@provider.xy&gt;\'; # Welchen Betreff sollen die Mails erhalten? $strSubject = \'Feedback\'; # Zu welcher Seite soll als \&quot;Danke-Seite\&quot; weitergeleitet werden? # Wichtig: Sie muessen hier eine gueltige HTTP-Adresse angeben! $strReturnhtml = \'http://www.provider.xy/IhrName/IhreSeite.htm\'; # Welche(s) Zeichen soll(en) zwischen dem Feldnamen und dem angegebenen Wert stehen? $strDelimiter = \&quot;:\\t\&q in /var/www/web83/web/functions/common/common_functions.php on line 222