7 Replies - 955 Views - Last Post: 03 November 2010 - 04:22 PM Rate Topic: -----

#1 tolu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-November 10

data submission

Posted 03 November 2010 - 03:10 PM

i have this code already :
<?php 
if(isset($_POST['submit'])) { 
$to = "you@you.com"; 
$subject = "Form Tutorial"; 
$name_field = $_POST['name']; 
$email_field = $_POST['email']; 
$message = $_POST['message']; 
  
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; 
  
echo "Data has been submitted to $to!"; 
mail($to, $subject, $body); 
} else { 
echo "blarg!"; 
} 
?> 




<form method="POST" action="mailer.php">
   <input type="text" name="name" size="19"><br>
   <br>
   <input type="text" name="email" size="19"><br>
   <br>
   <textarea rows="9" name="message" cols="30"></textarea>
   <br>
   <br>
   <input type="submit" value="Submit" name="submit">
</form>


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 03 November 2010 - 03:13 PM


Is This A Good Question/Topic? 0
  • +

Replies To: data submission

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: data submission

Posted 03 November 2010 - 03:14 PM

Yes, and? Are you getting errors? What's the deal? Have you checked out our tutorials?
Was This Post Helpful? 0
  • +
  • -

#3 tolu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-November 10

Re: data submission

Posted 03 November 2010 - 03:46 PM

hello there , please i am going through the tutorial here "simple text chat box" i have these codes
<html>

<head>
<title>DIC ChatBox Beta 1</title>
</head>

<body>

<h1></DIC> Chat Box</h1>
<form id="signInForm">
	<input id="userName" type="text">
	<input id="signInButt" name="signIn" type="submit" value="Sign in">
	<span id="signInName">User name</span>
</form>

<div id="chatBox"></div>

<div id="usersOnLine"></div>

<form id="messageForm">
	<input id="message" type="text">
	<input id="send" type="submit" value="Send">
<div id="serverRes"></div>
</form>
</body>
</html>



Creating the style sheet: (cb_style.css)
Let’s make it simple and clean so everyone else can edit it easily.
We will style each element depending on its id

Here is the CSS we need, it’s very simple so no need to add any comment

#signInForm, #messageForm {
	margin:0px;
	margin-bottom:1px;
}
#userName {
	width: 150px;
	height: 22px;
	border: 1px teal solid;
	float:left;
}
#signInButt {
	width: 60px;
	height: 22px;
}	
#signInName{
	font-family:Tahoma;
	font-size:12px;
	color:orange;
}
#chatBox {
	font-family:tahoma;
	font-size:12px;
	color:black;
	border: 1px teal solid;
	height: 225px;
	width: 400px;
	overflow: scroll;
	float:left;

}
#usersOnLine{
	font-family:tahoma;
	font-size:14;
	color:orange;
	border:1px teal solid;
	width:150px;
	height:225px;
	overflow:scroll;
	margin-left:1px;
}
#message {
	width: 350px;
	height: 22px;
	border: 1px teal solid;
	float:left;
	margin-top:1px;
}
#send {
	width: 50px;
	height: 22px;
	float:left;
	margin:1px;
}
#serverRes{
	width:150px;
	height:22px;
	border: 1px teal solid;
	float:left;
	margin:1px;
}




Now, we need to link the index.htm with cb_style.css.
At the document’s header part add this code


<link rel="stylesheet" type="text/css" href="cb_style.css">


PLEASE MY PROBLEM NOW IS THAT I DO NOT UNDERSTAND THEY LINK index.htm with the cb_style.css.
WHAT DID THEY MEAN BY "At the document’s header part add this code"?

This post has been edited by JackOfAllTrades: 03 November 2010 - 03:58 PM
Reason for edit:: Fixed code tags/formatting

Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: data submission

Posted 03 November 2010 - 04:01 PM

Did you notice at the beginning of that tutorial this?

Quote

We will use multiple programming languages in this tutorial, so please make sure before you start that you know:
1-The basics of HTML elements and Objects.
2-The basics of CSS to create a simple layout for the chat box elements.
3-Intermediate skills in Javascript to control all the chat box functionality (client side).
4-Intermediate skills in php to process incoming and outgoing information (server side).


Do you have all that knowledge? I don't believe you do. Start SMALLER. Maybe from the beginning? This is a well-regarded starting point, as is this.
Was This Post Helpful? 0
  • +
  • -

#5 tolu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-November 10

Re: data submission

Posted 03 November 2010 - 04:06 PM

yes sure i do is only the linking that is fucking me now... please just give an idea of where to add the link : 1 <link rel="stylesheet" type="text/css" href="cb_style.css"> to.
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: data submission

Posted 03 November 2010 - 04:09 PM

From one of the pages to which I just linked.
Was This Post Helpful? 0
  • +
  • -

#7 tolu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-November 10

Re: data submission

Posted 03 November 2010 - 04:11 PM

now i decide to add it like this:

<html>

02

03 <head>

04 <title>DIC ChatBox Beta 1</title>
<link rel="stylesheet" type="text/css" href="cb_style.css">.............. here is where i added the code.
05 </head>

06

07 <body>

08

09 <h1></DIC> Chat Box</h1>

10 <form id="signInForm">

11 <input id="userName" type="text">

12 <input id="signInButt" name="signIn" type="submit" value="Sign in">

13 <span id="signInName">User name</span>

14 </form>

15

16 <div id="chatBox"></div>

17

18 <div id="usersOnLine"></div>

19

20 <form id="messageForm">

21 <input id="message" type="text">

22 <input id="send" type="submit" value="Send">

23 <div id="serverRes"></div>

24 </form>

25 </body>

26 </html>
Was This Post Helpful? 0
  • +
  • -

#8 tolu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-November 10

Re: data submission

Posted 03 November 2010 - 04:22 PM

Thank you that link really work... i really appreciate.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1