Posts tagged "HTML Coding"

Php coding help please?

Could anyone tell me please where i’ve made a mistake here in this php coding? When i fill the form in and hit the submit button it does show the $theResults but email doesn’t get sent to my address. I’ve been trying to find out where the problem is but i’m not getting anywhere. I have contacted my server and they support mail().
<?php
$subject = "test";
$to = "myname@example.co.uk";
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$inquiryField = $_POST['inquiry'];

$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Inquiry: $inquiryField <br>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";

/* Results rendered in Html */

$theResults = "email has been sent";
mail($to,$subject,$body,$headers);
echo "$theResults";

?>

It looks like you are doing everything correctly in your PHP script. If you are sure about the TO address and you are not finding the email in your inbox at that address, then first check your spam filter. If the spam filter was not the culprit, then the best thing to do is to check the mail server logs on the server. These should show you if there was a problem when the sending mail server used by PHP went to hook up with your inbound mail server to deliver the message, or if the message was received successfully. If there was a problem the logs will show you what it was. If the logs show that the message was delivered successfully and its not in your inbox and its not in your spam filter, then you need to forward the log record to your mail server admin who should be able to track down the missing message. Hope this helps.


Is learning html coding for web development hard?

In the future I want to be able to maintain websites for different companies. I’m talking a html coding class and probably in the summer, dreamweaver. What do you all think?

Well learning HTML is not hard, if you enjoy actually learning it and doing it. I have seen people have the worst time doing it because they didn’t enjoy it. An i think its a great idea about the 2 classes you wanna take, i took both and they both helped me a lot. I would also recommend looking up a server-side programming class, i would wait till after you do html and dreamweaver classes because theres a lot to server-side programming and needs your full attention. But It will teach you how to do shopping carts, and now a days a lot of people want you to maintain those for them more then just the site information. Not to mention it’s something good to learn and add to your resume. Also, i dont know if your html class will teach you this, should, but if it doesn’t learn how to do a Cascading Style Sheet (CSS) that is becoming very popular now a days. But, a good site to check out, if you run into any HTML problems or wanna learn CSS on your own is http://www.w3schools.com/default.asp. Its not just great for HTML and CSS, but it has many other popular programming languages, not all, but most and gives the basics about each of them. But i agree with everyone else, its not keeping up the sites and doing it that is the problem, its keeping people interested in your site that is the hard part. You might think something looks great, but if you ask a average computer user they might hate it. Best thing to do is ask multiple people questions an ask what they like and dont like about it, and how you could improve the site. Best advice will come from the most honest people you know, so ask them first. Good Luck


I have created a php coding to insert data in to the my sql database table. But the records are not inserti?

I have created a php coding to insert data in to the my sql database table. But the records are not inserting.
I have created a form using html and wrote the coding in php to insert records in to the database table in mysql. But the data that I insert using the form are not inserting in to the table. But there is no error message even. Please help?
Here is my coding.
<html>
<head>
</head>
<body>
<table>
<form method="post" action="exe_2.php">

<tr>
<td>User Name</td>
<td><input type="text" name="name"></td>
</tr>

<tr>
<td>Password</td>
<td><input type="password" name="paword"></td>
</tr>

<tr>
<td>Email</td>
<td><input type="text" name="email"></td>
</tr>

<tr>
<td></td>
<td><input type="submit" name="submit" value="register"></td>
</tr>
</table>
</form>

</body>

</html>

<?php
error_reporting(0);
$con = mysql_connect("localhost","root","root");
mysql_select_db("bit",$con);
$insert="INSERT INTO student
(StdNo,User Name,Password,Email) VALUES
(‘null’,'$_POST[name]‘,’$_POST[paword]‘,’$_POST[email]‘)";

//if (isset($_POST['submit']))
//{
mysql_query($insert,$con);
echo "your record added";
//}
$view="SELECT * FROM student";
$result=mysql_query($result,$con);
echo "<table border=’1′>
<tr>
<th>StdNo</th>
<th>User Name</th>
<th>Password</th>
<th>Email</th></tr>"
;

while ($display=mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $display['StdNo'] . "</td>";
echo "<td>" . $display['User Name'] . "</td>";
echo "<td>" . $display['Password'] . "</td>";
echo "<td>" . $display['Email'] . "</td>";
echo "</tr>";
}

echo "</table>";

mysql_close($con);
?>

Below you will find code that should help you solve problems with your original. Because I was unsure of your table definition, I based the code on the following schema:

CREATE TABLE student(
StdNo BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Email VARCHAR(50),
User_Name VARCHAR(50),
Password VARCHAR(50),
last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);

In the above schema StdNo an auto incrementing field. I replaced the space with an underscore in the field name "User Name" because MySQL must operate in a special mode in order to understand field names with spaces. I also added a timestamp field so that you would know when the record was created or last upaded.

I made the registration form a function that you can call at any point in order to display the form.

If you have the correct schema in your database, you can load the code below into a single php page and it should work.

Note that I do echo the function mysql_error() to the user when an error is ecountered with the SQL call. This is not recommended for production as hackers might find important info from the displayed error.

********** THE CODE **********

<?php
function showRegForm() {

// *** This funtion displays a registration form.

$pageName = $_SERVER['PHP_SELF'];

echo("<html>
<head>
</head>
<body>

<table>

<form method=\"post\" action=\"$pageName\">

<tr>
<td>User Name</td>
<td><input type=\"text\" name=\"name\"></td>
</tr>

<tr>
<td>Password</td>
<td><input type=\"password\" name=\"paword\"></td>
</tr>

<tr>
<td>Email</td>
<td><input type=\"text\" name=\"email\"></td>
</tr>

<tr>
<td></td>
<td><input type=\"submit\" name=\"cmdSubmit\" value=\"register\"></td>
</tr>
</table>
</form>

</body>

</html>");

return true;

}
if (isset($_POST["cmdSubmit"])) {

// *** Submit button was pressed.
// *** Process registration.

// *** Connect to database or quit.
$con = mysql_connect("localhost","root","root") Or exit("<p><b>ERROR:</b> Could not connect to datbase.</p>\n");

// *** Select database.
mysql_select_db("bit",$con) Or exit("<p><b>ERROR:</b> Could not select target datbase (bit).</p>\n");

// *** Build registration query.

$userName = mysql_real_escape_string ($_POST["name"], $con);
$password = mysql_real_escape_string ($_POST["paword"], $con);
$email = mysql_real_escape_string ($_POST["email"], $con);

$insert = "INSERT INTO student (User_Name, Password, Email) VALUES (‘$userName’,'$password’, ‘$email’)";

// *** Run the query.
$result = mysql_query($insert, $con);

if (!$result) {

// *** Error creating record. Inform user and halt.
exit("<p><b>ERROR: Could not create record.</b> " . mysql_error() . "</p>");

} else {

echo("<p>Your record added.");

// *** Now output list of records.

$view = "SELECT * FROM student";
$result = mysql_query($view, $con);

if (!$result) {

// *** Error getting records. Inform user and halt.
echo("<p><b>ERROR: Could not retrieve list of records.</b> " . mysql_error() . "</p>");

} else {

// *** Show record list.
// *** Note: A bad idea to show this to users.

echo("<table border=’1′> \n
<tr> \n
<th>Created</th> \n
<th>StdNo</th> \n
<th>User Name</th> \n
<th>Password</th> \n
<th>Email</th></tr> \n");

while ($display = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td> " . $display['last_update'] . "</td>";
echo "<td> " . $display['StdNo'] . "</td>";
echo "<td> " . $display['User_Name'] . "</td>";
echo "<td> " . $display['Password'] . "</td>";
echo "<td> " . $display['Email'] . "</td>";
echo "</tr>";
}

echo "</table>";

}

// *** Show registration form in case they want to register again.
echo("<h5>Register Another?</h5>");
$showForm = showRegForm();
}

// *** Close the db connection.
mysql_close($con);

} else {

// *** Submit button was NOT pressed, so show registration form.

$showForm = showRegForm();

}

?>


How to Find the HTML Coding of Any Website

In this video I’ll show you a quick little technique you can use to get the HTML coding out of any website. You can now use codes from other websites for your very own!

I hope you enjoy this video tutorial. Please comment, rate, and subscribe. If you have any questions, please post it in the comments. Thanks for watching!

Duration : 0:1:24

Read more…


How to enable localhost for PHP coding?

I’m doing php programming for my client’s website (noob) and i have all sort of php codes in my php. When i tried to preview the php page on my computer, nothing shows up (e.g. the include file for menu). However, when I upload it to my client’s server, the include file is properly displayed.

I’ve search for answers as to what I was doing wrong (at first i thought my php codes were wrong) and later found out that i most probably have not enabled my localhost.

I’m doing my coding on dreamweaver so can anyone help me as to how i can enable localhost so i can easily preview my php pages on my computer and not having to upload the files to the server just to preview them?

Since you did not mention your computer’s operating system…

Installing IIS 6.0

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/750d3137-462c-491d-b6c7-5f370d7f26cd.mspx?mfr=true

Installing IIS on Windows XP Professional… http://www.webwizguide.com/kb/asp_tutorials/installing_iis_winXP_pro.asp

Installing IIS 7.0 on Windows Vista

http://learn.iis.net/page.aspx/28/installing-iis-70-on-windows-vista/


How do I use Hexadecimal or HTML coding on Notepad?

I need to know how to hex code. How do I do it on Notepad or other Windows 2000-Standard program? Please keep in mind I don’t have Word or any other Office program.

PSPad provides a convenient hex-editor.

However, hex-editing is typically used for altering binary files (non-text) files, and is therefore something very different from HTML coding (creating specially formatted text files).

When creating an HTML file, any text editor (such as Notepad) may be used.

Simply type the contents of the HTML file into Notepad (or a similar editor), and then save the file with a name ending in ".html". Subsequently opening the file in an Internet browser will cause the HTML code to be interpreted and rendered.

For example, try entering the following into Notepad and saving it as "test.html":


<html>
<body>
<p>This is a paragraph.</p>
<p style="color:red">This paragraph is in red.</p>
<ul>
<li>This is a list.</li>
<li>Each list item has a bullet point.</li>
</ul>
</body>
</html>
—-

Once the file is saved, double-clicking the file should cause it to load in your computer’s default browser (likely Internet Explorer or Firefox).

From there, it’s just a matter of learning the ins and outs of the various HTML tags.


Please can anybody help me in AJAX PHP coding?

Please can anybody help me in AJAX PHP coding. i am a webmaster and need help. please email me at pratikgreat2004@yahoo.com.

Go here: http://phpbuilder.com/

"In our last article, we introduced Ajax by developing a simple email validation application. In this article we are going to delve deeper into Ajax and explore how XSL can be used on both the client side (using Javascript) and on the server side (using PHP) to transform XML data into XHTML."


how do I display html/coding in forums posts?

I need to type in my html coding in a post at a forum but my coding is not showing up because it’s html…so what is the closing tags I need for my code to show up in my posts?

One thing you can do is replace each left angle brace with the < entity. This will cause the browser to display the actual angle brace rather than trying to interpret it as HTML code. For example:
<head>
<title></title>
</head>
<body>
<h1></h1>
</body>
</html>

should be written as

&lt;head>
&lt;title>&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>&lt;/h1>
&lt;/body>
&lt;/html>

and will appear on the page as
<head>
<title></title>
</head>
<body>
<h1></h1>
</body>
</html>

This is tedious, but it will usually work.

A more satisfying solution (especially for yahoo answers, which messes up indentation) is to use pastebin.com.

Simply copy your code and paste it into pastebin.com, then insert the link.

Pastebin handles all the character conversion for you, and also adds line numbers and syntax highlighting. It’s really easy and it’s free.

The pastebin link for the same code looks like this:

http://aharris.pastebin.com/m3bb2335f


Which html editor is the best one for html and php coding?

Which html editor is the best one for html and php coding?

I am using dreamweaver for making my html and php pages, its giving good facility not only for the html but also for the php. So I think its the best. Its even having facility to support validations too.


HTML question, can anyone tell me the coding for opening a window within the page and opening a new page pls?

I would also like to know how to do html coding for bold and colours please. Thanks

1.If you are using HTML(XHTML) code…just with Hyperlink then… may be you are cding like ..e.g <a href="……">link</a>… If its so ..then put target="Blank" inside the <a> tag…. It will open in new window or leave it as it is….it will open in same window…!!

2. if you are using JavaScript to open new Window with JavaScript function calling then use like below…

<Script Language="JavaScript">
function open_wn() {
var load = window.open(give your WINDOW path here [e.g \public_htm\win\popup.htm]);
}
</Script>
And go to the line where you want to give the Window link and call the function e.g <a href="javascript:load()">Open Window</a>

Try my codes…


« Previous PageNext Page »

Your Site Sample is Stephen Fry proof thanks to caching by WP Super Cache