Jump to content

Tried to bare bones all my code, hoping to see why this emsg?


yshua

Recommended Posts

Dear forum ladies and gentlemen:

 

        Tried to bare all my code for one final stab at sol'n before the Toronto Web people get me....  I cut down my index.php, form.php, and insert.php files as follows, and made recommended changes.  Now is this easily solvable?  Using PHP5.3.8, MySQL5.5.21, Apache2.2, Win7.  Please see attached code that gives the following emsg:

 

Timestamp: 8/22/2012 7:29:19 PM

Error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol.

 

Source File: http://127.0.0.1/insert.php

 

Line: 0

 

index.php:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>mywebserver website</title>
</head>
<body>
<table align="center"><tr><td>
<table width="843" height="503" align="center" bgcolor="#F7F7F7">
  <tr><td height="453" valign="center"><table width="799" height="385" align="center"><td><tr> 
<tr><td height="379" valign="top"><tr>
<h2></h2>
<p><h2>Under Construction....</h2>

<p align="center"><a href="form.php" ><strong>Download Now</strong></a></p>
  </p></td></tr></table></td></tr>
</body>
</html>
[/Code]

 

form.php:

[Code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php header ("content-type: text/html; charset=utf-8"); ?>
<head>
<title>mywebserver's website</title>
</head>
<body>
<strong>Please fill in the following information to get started<br><br></strong></h2>
            <p> <form name="debt" method="post" action="insert.php">
                  <table width="537" align="center"  cellpadding="0" cellspacing="0" >
<tr><td height="35" colspan="2" valign="top" ><div id="final" align="center"></div></td></tr>
      <tr><td width="268" height="22" valign="middle"><div align="right">First
                          Name </div></td>
      <td width="267" valign="top">
<input type="text; charset=utf-8" name="fname" id="fname" /td></tr>
    <tr><td height="100" colspan="2" ><div align="center"
<table width=0 cellpadding=0 cellspacing=0 border=0><tr>
<input type="Submit" >
<a href="#" title="Submit" onclick="submitform('final')"><br/></a></td>
                        </div></td></tr>
      </table></form> </td></tr></table></td></tr>
</body>
</html>
</Code>

insert.php:
<Code>
<?php
$db = new mysqli ();
$db->set_charset ('utf8');
mysqli::__construct() ([ string $host = ini_get("mysqli.default_host") [, string $username = ini_get("mysqli.default_user") [, string $passwd = ini_get("mysqli.default_pw") [, string $dbname = "reccus2" [, int $port = ini_get("mysqli.default_port") [, string $socket = ini_get("mysqli.default_socket") ]]]]]] )

  $mysqli = new mysqli('host', 'headache2', 'fakepassword', 'fakerewi3');

if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '
            . $mysqli->connect_error);
}
echo 'Success... ' . $mysqli->host_info . "\n";

mysql_query("INSERT INTO users (fname) charset='utf-8' VALUES
('".$_REQUEST['fname']."')");
session_start();
$_SESSION['user']=$_REQUEST['fname'];

$mysqli->close();

?>
<body onLoad="document.myform.submit();">
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" name="myform">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="fakeid@yahoo.com">
<input type="hidden" name="item_name" value="1 Download">
<input type="hidden" name="item_number" value="1 Download">
<input type="hidden" name="amount" value="9.98">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.fakewebsite.com/success.php">
<input type="hidden" name="cancel_return" value="http://www.fakewebsite.com/yshua/">

</form>
</body>
[/Code]

 

Thanks for giving me this chance,

Yshua

18882_.php

Link to comment
Share on other sites

Dear people:

 

      Here's the latest error:

 

error.log:

[Fri Aug 24 16:32:55 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/default-files, referer: http://127.0.0.1/

[Fri Aug 24 16:32:55 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/default-files, referer: http://127.0.0.1/

[Fri Aug 24 16:41:01 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/default-files, referer: http://127.0.0.1/

 

access.log:

 

127.0.0.1 - - [24/Aug/2012:16:32:55 -0600] "GET / HTTP/1.1" 200 5202

127.0.0.1 - - [24/Aug/2012:16:32:55 -0600] "GET /default-files/styles_wp36t.css HTTP/1.1" 404 228

127.0.0.1 - - [24/Aug/2012:16:32:55 -0600] "GET /default-files/styles_wp36t.css HTTP/1.1" 404 228

 

Still am clueless,

Yshua

Link to comment
Share on other sites

Fenway:

 

          With all due respect, as a huge contributor to this forum that you are.  I am humbled at your willingness to reply to mere me, a novice!  However, the solution doth now speak for itself.  I was using a host and hostname conflict.  Redundant MySQL signons, eliminated gave emsg: 1045, showing "root" needed to be specified.  Will post final solution, as this one is preliminary, and an isert error remains.

 

Hope to post complete sol'n soon,

Yshua

Link to comment
Share on other sites

Dear Fenway:

 

        Touche', you are right again, after checking my sources!  Ow.  So perhaps one lone gasp of a question to get me on track to get this question back on how to do a MYSQLI insert (or whatever one calls it)?  How in the world, without knowledge of a control panel, etc., do I find out the appropriate login info for the opening of MYSQLI?

 

Oh, well,

Yshua :o

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.