Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 12:22:34 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
155556
Posts in
21715
Topics by
7737
Members
Latest Member:
gx-world
WebsiteBaker Community Forum
English
Archive (posts up to 2007)
(Moderator:
Argos
)
Adding external HTML, PHP and Javascript
Pages: [
1
]
Go Down
Author
Topic: Adding external HTML, PHP and Javascript (Read 3173 times)
Milagh
Offline
Posts: 25
Adding external HTML, PHP and Javascript
«
on:
January 10, 2005, 03:57:57 PM »
Hi, I'm guessing it is possible to enter your own coding into a new page (via option Code?), but is it also possible to have that coding insert data into a database apart from wb?
Coming to this, is there a way to have additional fieldtypes in a wb form and have THAT data put into a database? Being able to do it via wb's standard forms would be the optimum.
Maybe this this should be in another forumtopic. Let me know.
Milagh
Logged
"I'm not lost! Just temporarily misplaced."
fienieg
Guest
Re: Adding external HTML, PHP and Javascript
«
Reply #1 on:
January 10, 2005, 06:25:53 PM »
Quote from: Milagh
Hi, I'm guessing it is possible to enter your own coding into a new page (via option Code?), but is it also possible to have that coding insert data into a database apart from wb?
Coming to this, is there a way to have additional fieldtypes in a wb form and have THAT data put into a database? Being able to do it via wb's standard forms would be the optimum.
Maybe this this should be in another forumtopic. Let me know.
Milagh
this feature isn't avaible yet, in the future maybe
but what are you refering to, what is the end result
there is a way to put you're own code into action... but you need to ask sylverfaces that
he/she is more into that
Logged
Milagh
Offline
Posts: 25
Adding external HTML, PHP and Javascript
«
Reply #2 on:
January 10, 2005, 08:32:43 PM »
Thanks 4 the reply, fienieg. Wha I'm looking for is a way to have site visitors fill in a form, have them receive a confirmation email with the info they supplied, have an email sent to me and have that data stored in a database for future reference/contact details.
I am trying to get my company website ready (finally), but need some way to have input gathered from potential customers via a contact form.
Hope this clears things up a bit.
Milagh
Logged
"I'm not lost! Just temporarily misplaced."
fienieg
Guest
Adding external HTML, PHP and Javascript
«
Reply #3 on:
January 10, 2005, 08:55:18 PM »
if i get it right
let visitors (customers) fill in a form
store that data in a SQL DB
send you a mail containing the data
and send you visitors (customers) a copy
You may want to use a BCC to you're mail adres...
and a contact form isn't that hard to manufacture... you only need the dbfunctions of WB, i'll look them up!
PS, you need create an seperate table for you're contact form!!!!
And you must have an mail function installed on you're server. phpmail() or some other mail sending program!!!
Logged
Milagh
Offline
Posts: 25
Adding external HTML, PHP and Javascript
«
Reply #4 on:
January 12, 2005, 08:16:38 AM »
Fienieg, that is my intention, correct. Looking forward to seeing de dbfuntions.
Already have a mailtemplate in php. Just need to adjust $values.
The mailtemplate also has the code to put data into separate database and mailfuntion. The code might be a bit long, but hey...if it works, don't question it.
Milagh
Logged
"I'm not lost! Just temporarily misplaced."
fienieg
Guest
Adding external HTML, PHP and Javascript
«
Reply #5 on:
January 12, 2005, 06:14:59 PM »
Quote from: Milagh
Fienieg, that is my intention, correct. Looking forward to seeing de dbfuntions.
Already have a mailtemplate in php. Just need to adjust $values.
The mailtemplate also has the code to put data into separate database and mailfuntion. The code might be a bit long, but hey...if it works, don't question it.
Milagh
could you place the code here
and there is a standard form module, so you can add what ever form you want, only it won't be writen to a DB, and i'm not sure if you can send it to you're customers...
will look into that...
Logged
Milagh
Offline
Posts: 25
Adding external HTML, PHP and Javascript
«
Reply #6 on:
January 12, 2005, 09:53:57 PM »
fienieg, here's the code I'm thinking of using. It might be that some of it is "old" php.
Code:
<?php
/* grabs the POST variables and puts them into variables that we can use */
$title
=
$_POST
[
'title'
&
#93;;
$name
=
$_POST
[
'name'
&
#93;;
$company_name
=
$_POST
[
'company_name'
&
#93;;
$address
=
$_POST
[
'address'
&
#93;;
$number
=
$_POST
[
'number'
&
#93;;
$postcode
=
$_POST
[
'postcode'
&
#93;;
$city
=
$_POST
[
'city'
&
#93;;
$email
=
$_POST
[
'email'
&
#93;;
$phone
=
$_POST
[
'phone'
&
#93;;
//---------VALIDATION-------->
if&
#40;$name){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw naam in.\n"
;
//----> ERROR if no input
&
#125;
if&
#40;$address){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw adres in.\n"
;
//----> ERROR if no input
&
#125;
if&
#40;$number){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw huisnummer in.\n"
;
//----> ERROR if no input
&
#125;
if&
#40;$postcode){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw postcode in.\n"
;
//----> ERROR if no input
&
#125;
if&
#40;$city){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw woonplaats in.\n"
;
//----> ERROR if no input
&
#125;
if&
#40;$email){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw huisnummer in.\n"
;
//----> ERROR if no input
&
#125;
if&
#40;$phone){//----> CHECK input
&
#125;
else&
#123;
$error
.=
"Er is een verplicht veld niet ingevuld. Klik terug in uw browser en vul uw telefoonummer in.\n"
;
//----> ERROR if no input
&
#125;
//-------->ERROR FREE??
if&
#40;$error==""){
echo
"Bedankt voor het insturen van ons contactformulier.\nU ontvangt van ons een email met daarin de gegevens die u heeft verstrekt.\n"
.
"Er wordt binnen 24 uur contact met u opgenomen om een afspraak te maken"
;
//----------------------------------
$mailContent
=
"--------Contactgegevens--------\n"
.
"Uw naam: "
.
$title
.
" "
.
$name
.
"\n"
.
"Bedrijfsnaam: "
.
$company_name
.
"\n"
.
"Adres: "
.
$address
.
" "
.
$number
.
"\n"
.
"Postcode/Woonplaats: "
.
$postcode
.
" Woonplaats: "
.
$city
.
"\n"
.
"E-mail: "
.
$email
.
"\n"
.
"Phone: "
.
$phone
.
"\n"
;
//----------------------------------
$subject
=
"ICT-zone Afspraak/Informatie aanvraag"
;
$recipientSubject
=
"ICT-zone Afspraak/Informatie aanvraag"
;
$receiptMessage
=
"Bedankt voor het insturen van uw contactgevens\n\n\n"
.
"Hieronder staan de gegevens die u aan ons heeft gestuurd. Indien deze gegevens niet correct zijn,\n"
.
"verzoeken wij u om ons een e-mail te sturen op your.email@company.com.\n\n"
.
"--------Personalia--------\n"
.
"Naam: "
.
$title
.
" "
.
$name
.
"\n"
.
"Initials: "
.
$initials
.
"\n"
.
"Last Name: "
.
$lastname
.
"\n"
.
"Date of Birth: "
.
$birthdate
.
"\n\n"
.
"--------Adresgegevens--------\n"
.
"Adres: "
.
$address
.
" "
.
$number
.
"\n"
.
"Postcode/Woonplaats: "
.
$postcode
.
" "
.
$city
.
"\n\n"
.
"--------INFO--------\n"
.
"E-mail: "
.
$email
.
"\n"
.
"Phone: "
.
$countrycode
.
" - "
.
$phone
.
"\n"
;
//----------------------------------
mail
&
#40;$email, $subject, $receiptMessage,"From: your.email@company.com");
//----------------------------------
mail
&
#40;"your.email@company.com",$recipientSubject,$mailContent,"From: ".$email.);
//--->echo $mailContent;
//////////////////////////////////////// CONNECT TO MYSQL DB ////////////////////
// OPEN CONNECTION --->
$connection
=
mysql_connect
&
#40;"localhost","username", "password") or die ("Unable to connect!"); /* change this! */
mysql_select_db
&
#40;"dbname") or die("Unable to select database!"); /* change this! */
// EXECUTE QUERY --->
$query
=
"INSERT INTO customerdata (
title,
name,
company_name,
address,
postcode,
city,
email,
phone)
VALUES(
'"
.
$title
.
"',
'"
.
$name
.
"',
'"
.
$company_name
.
"',
'"
.
$address
.
"',
'"
.
$city
.
"',
'"
.
$postcode
.
"',
'"
.
$email
.
"',
'"
.
$phone
.
"')"
;
//////----->
$result
=
mysql_query
&
#40;$query) or die ("Error in query:".mysql_error());
//if ($result)
//echo mysql_affected_rows()." row inserted into the database effectively.";
// CLOSE CONNECTION --->
mysql_close
&
#40;$connection);
///////////////////////////////////////////////////////////////////////////////////
&
#125;
else&
#123;
print
"Onze excuses, maar het formulier kan pas worden verstuurd wanneer alle aangegeven velden zijn ingevuld - \n"
;
print
"
$error
\n"
;
print
"\n"
;
print
"\n"
;
print
"Gebruik de \"Back\" of \"Vorige\" knop van uw browser om de missende gegevens in te vullen.\nHartelijk dank.\n"
;
&
#125;
?>
Some of it is in Dutch, but that is just text and no code.
Logged
"I'm not lost! Just temporarily misplaced."
fienieg
Guest
Adding external HTML, PHP and Javascript
«
Reply #7 on:
January 12, 2005, 10:06:41 PM »
Maakt niet uit hoor, ik kan gewoon nederlands lezen....
Ik kijk er morgen even naar, ik zou persoonlijk vor de validatie van de velden geen php gebruiken (alleen eventueel als back-up), maar javascript... dit werkt veel sneller, en zorgt ervoor dat je ook een verificatie kan doen op de e-mail!!! Erg handig...
en ik zal de WB value's toevoegen voor je!!! Erg handig, en ik maak wel een sql install script, met de juiste values.
Het enige wat jij moet doen dan nog, is het invoeren in een CODE pagina!!!
ik maak er nog wel een code snippet van...
Logged
Milagh
Offline
Posts: 25
Adding external HTML, PHP and Javascript
«
Reply #8 on:
January 12, 2005, 11:15:23 PM »
fienieg, toch wel handig als je Nederlands bent. Praat soms wat makkelijker.
Alvast hartelijk dank voor je hulp. Kijk er naar uit. Nu allen nog zo'n template verbouwen...
Translated into English: fienieg knows what to do and I'n looking forward to his work.
TIA!
Milagh
Logged
"I'm not lost! Just temporarily misplaced."
fienieg
Guest
Adding external HTML, PHP and Javascript
«
Reply #9 on:
January 12, 2005, 11:59:15 PM »
I'll just make it WB compatible
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...