mysql on wamp server doesnt work - mysql

i have just installes wamp server 2.4 and almost everything is working good but every time i am trying to open a file with mysql code on it he just showing me a white page whith nothing on it.
this is one of my files i have tried to open 'phpmyadmin' and this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head>
<body> <?php
$connect = mysql_connect("localhost", "guycohen801", "") or die ("cant connect to the server");
$db = mysql_select_db("test", $connect) or die ("cant select database");
$query = "SELECT * FROM asd3"; $result = mysql_query($query, $connect) or die ("query failed:" . mysql_error());
while ($row = mysql_fetch_array($result)) {
echo $row['1']," "; echo $row['2']," <br>";
}
mysql_close($connect); ?>
</body> </html>
and on the local host he shows me a whilte page and when i cliced on 'view page sorce' that what was writen:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
how can i fix this problem?????????????

Related

Apache FOP float text right

Im using the Apache FOP to convert Html document to PDF.
In my document I need the right align. I was using http://webcoder.info/downloads/xhtml2fo.xsl stylesheet but the float feature is not working.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>W22</title>
</head>
<body>
<p style= "float: right">
Invoice No : $invoiceId <br>
Date : $date <br>
Client Ref : $customerAccount <br>
Email : $email
</p>
</body>
</html>

How to insert content in a keywords metatag with JSP

I have the following JSP page:
<%#page import="com.myPath.JSPHelper"%>
<%#page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="keywords" content="${jspHelper.getKeywordsMetatag()}">
</head>
<body>
<%
JSPHelper jspHelper = new JSPHelper();
jspHelper.loadData(request.getAttribute("id").toString()); // load data from database
%>
<script type="text/javascript">
<%=jspHelper.getScriptContent()%>
</script>
</body>
</html>
What I'm trying to do is to fill in the contents of the keywords meta tag using a function getKeywordsMetatag() that is defined in a companion class `JSPHelper.java'.
But this is not working, I get the following error:
The function getKeywordsMetatag must be used with a prefix when a default namespace is not specified
I'm new to JSP so I've tried many things without success.
What am I doing wrong here?
What really bothers me is that the function getScriptContent() perfectly works, dumping javascript code in the html page. Why does getScriptContent() work but not getKeywordsMetatag()?
Thanks!
I would move the declaration of jspHelper up above its first use. I would also drop the ${} syntax but that might not be necessary.
<%#page import="com.myPath.JSPHelper"%>
<%#page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
JSPHelper jspHelper = new JSPHelper();
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="keywords" content="<%=jspHelper.getKeywordsMetatag()%>">
</head>
<body>
<%
jspHelper.loadData(request.getAttribute("id").toString()); // load data from database
%>
<script type="text/javascript">
<%=jspHelper.getScriptContent()%>
</script>
</body>
</html>

Multimarkdown well configured header data

Hi I'm trying to get the top of my multimarkdown file to look like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Test of markdown</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../main.css" />
</head>
I know how to add the following metatags:
Title: Test of markdown
CSS: ../main.css
Quotes language: english
which gives me :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test of markdown</title>
<link type="text/css" rel="stylesheet" href="../main.css"/>
</head>
But I'm not sure how to add the rest. Would appreciate any help. Thanks
I can't find any native markdown way to do this but you could run a little script across the generated HTML if you really feel you need to do this.
This is a simple Python 3 option that might get you started. This could be improved in many ways but wanted to keep it simple. An obvious idea would be to give it a folder and have it process every HTML file in the folder. But I hope this gives the idea.
Example code:
filepath = input('What is the full file path to the file? - ')
htmldoctype = ' '.join([
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"',
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'\n'
])
htmlinfo = ('<html xmlns="http://www.w3.org/1999/xhtml">\n')
inlines = []
try:
with open(filepath, mode='r', encoding='utf-8') as infile:
for line in infile:
if line.strip() == '<!DOCTYPE html>':
inlines.append(htmldoctype)
elif line.strip() == '<html>':
inlines.append(htmlinfo)
else:
inlines.append(line)
except Exception:
print('something went wrong in get')
try:
with open(filepath, mode='w', encoding='utf-8') as outfile:
for line in inlines:
outfile.write(line)
except Exception:
print('something went wrong in write')
Input:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test of markdown</title>
<link type="text/css" rel="stylesheet" href="../main.css"/>
</head>
<body>
test
</body>
</html>
Output:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>Test of markdown</title>
<link type="text/css" rel="stylesheet" href="../main.css"/>
</head>
<body>
test
</body>
</html>

Facebook Like Button On Web page

A client has recently requested social media links on his website. Facebook is my first attempt at this ever. My client does not have a facebook page.
My code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function renderFbLike() {
var parent = document.getElementById('fblikediv');
var child = document.getElementById('fblikeimg');
parent.removeChild(child);
//this really works...sort of
var html2 = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http://www.jplandman.co.za&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=60&appId=258346014244946\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:40px;\" allowTransparency=\"true\"></iframe>";
document.getElementById('fblikediv').innerHTML = html2;
}
</script>
</head>
<body>
<br />
<br />
<br />
<div id="fblikediv">
<img src="images/fb-like-button.png" id="fblikeimg" onmouseover="return renderFbLike();"></div>
<p />
</body>
</html>
Screen shot:
My question:
The link that says "JPLandman" links to some Facebook page that does not exist. Is there any way to prevent this? What are the possible work around?
See if adding this to your head makes any difference!?!
<meta property="og:title" content="Some Title"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://www.jplandman.co.za"/>
<meta property="og:site_name" content="JP Landman"/>
<meta property="og:description" content="Some content"/>
So after struggling for a little while for my client I finally found a page that will suffice. They genearate the code. Copy and paste(not my top choice but hey it works as expected)
AddThis+

Feedback Form HTML Unexpected end of file PHP

This php file appears correct, but is returning an 'unexpected end of file' error. Is the error somewhere in the html file. I have tried putting the tags inside print in "", removed one extra white space on the php line, added white spaces between the brackets[] and quotes'' on the variable lines, and still have the same error when I press enter to send the data to the php script. Here is the html code: http://pastebin.com/Rb62pZcy
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Your Feedback</title>
</head>
<body>
<?php // Script 3.3 handle_form.php
// This page receives the data from feedback.html
// It will receive: title, name, email, comments in $_POST
$title = $_POST [ 'title' ] ;
$name = $_POST [ 'name' ] ;
$email = $_POST [ 'email' ] ;
$comments = $_POST [ 'comments' ] ;
print "<p>Thank you, $title $name, for your comments.</p>"
"<p>You stated that you found this example to be '$response' and added:<br />$comments</p>"
?>
</body>
Instead of this:
print "<p>Thank you, $title $name, for your comments.</p>"
"<p>You stated that you found this example to be '$response' and added:<br />$comments</p>"
Use this:
echo "<p>Thank you, $title $name, for your comments.</p>";
echo "<p>You stated that you found this example to be '$response' and added:<br />$comments</p>";
I think you miss the ";" character.
------------------UPDATE-----------------------------
I try this code and works:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Your Feedback</title>
</head>
<body>
<?php
if (isset($_POST['email'])){
$title = $_POST['title'];
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
}
else
{
$title = "No title arrived";
$name = "No name arrived";
$comments = "No comments arrived";
}
//$response is not defined??
$response = "Live long and prosper";
//so i defined
echo "<p>Thank you, $title $name, for your comments.</p>";
echo "<p>You stated that you found this example to be '$response' and added:<br />$comments</p>";
?>
</body>
</html>
PS: try executing this script alone...name it "handle_form.php" and put this in the nav address bar:
localhost/your_project/handle_form.php
Works on my localhost.....if your problem continue then may be the problem is in the submit page.
Saludos.