Jump to content

Data insert.php doesn´t go into db on-line?


eduardar

Recommended Posts

I´ve off-line a webserver and saved on it a folder website. Inside this folder is an index.php file with an insert.php script. The data filled out in a html form of my website (www.eduardlid.net) goes off-line into a database of phpMyadmin! On-line it doesn´t?

Link to comment
Share on other sites

There can be a dozen different reasons code does not work when moving between servers.

 

What have you done to pin down exactly at what point your code and data are doing what you expect and at what point they are not? I can guarantee that the problem lies somewhere between those two points. If all you have done is to try your code and it doesn't work, all you have pinned down the problem to is somewhere in your code and that doesn't tell us anything that would allow us to help find the problem. We already know your code doesn't work, since you are posting in a programming help forum.

 

Do you have any error checking and error reporting logic in your code to get it to tell you if your query is even executing without errors? Are you sure your code where the query is at is being executed? What sort of symptom or error are you getting?

 

Link to comment
Share on other sites

I´ll send you my code:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<head>

    <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">

    <title>Eduard Lid</title>
    <link rel="stylesheet" type="text/css" href=ex1.css>
</head>


<body>
<div id="floater">

    <ul id="flags">
        <li>eng<a href="portfolio.html"><span id="amer"></span></a></li>
        <li>es<a href="portfolio.html"><span id="spanish"></span></a></li>
        <li>d<span id="germ"></span></li>
        <li>nl<span id="dutc"></span></li>
        <li>f<span id="fren"></span></li>
    </ul>

<?php

$Site_Name = $_POST['site_name'];
$Site_URL = $_POST['site_url'];
$Description = $_POST['Description'];


$con = mysql_connect("****","****","******") or die(mysql_error());

mysql_select_db("_website", $con);


$sql="INSERT INTO links (Site_Name, Site_URL, Description)
VALUES ('$_POST[site_name]','$_POST[site_url]','$_POST[Description]')";

if (!mysql_query($sql,$con))
{
    die('Error: ' . mysql_error());
}

mysql_close($con);

?>



<form action="insert.php" method="POST">
    <label for="s_name">Site Name:</label>
    <input type="text" id="s_name" name="site_name">
    <label for="s_url">Site URL:</label>
    <input type="text" id="s_url" name="site_url">
    <label for="Description">Description:</label>
    <input type="text" id="Description" name="Description">
    <input type="submit" value="Add Link">
</form>

</div><!--end #floater -->

<div id="vertical">

</div>




<div id="main">

    <p><img id="eduard" src="eduard.JPG" alt="img Eduard Lid"></p>

<p><img id="lake" src="lake.jpg" alt="img lake"></p>


<iframe id="player" 
  src="http://www.youtube.com/embed/h2AWKgU0cN4" frameborder="0"></iframe>
<br>

        <p>Web designer<span class="right">Dise&#241;ador de sitios web</span></p>


        <p>Translator<span class="right">      Traductor
</span>

        <ul id="links">
            <li><a href="english.html">more</a></li>
            <li><a href="spanish.html">m&#225;s</a></li>

        </ul>


</div><!--end #main -->

<h1>Eduard Lid</h1>

<p>
    <a href="http://validator.w3.org/check?uri=referer"><img
      src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
  </p>
  


<p id="copyright">Copyright © 2012</p>



</body>
</html>

- I´ve tried many things: changed host name, user and password. (and uploading these files with my FTP)

- Exported db from local host to host.

- Error messages many, latest: no db selected (which I don´t understand!)

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.