eduardar Posted May 29, 2012 Share Posted May 29, 2012 I have a ´famous´ problem! My data of my insert.php goes off-line (webserver > localhost) into my database of phpMyadmin! On-line it doesn´t. How do I solve this problem? eduardar (newbie) Quote Link to comment Share on other sites More sharing options...
ManiacDan Posted May 29, 2012 Share Posted May 29, 2012 I'm afraid you're going to have to rephrase this problem so it's easier to understand. Quote Link to comment Share on other sites More sharing options...
eduardar Posted May 29, 2012 Author Share Posted May 29, 2012 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? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 29, 2012 Share Posted May 29, 2012 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? Quote Link to comment Share on other sites More sharing options...
eduardar Posted May 29, 2012 Author Share Posted May 29, 2012 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ñ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á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!) Quote Link to comment Share on other sites More sharing options...
fenway Posted June 2, 2012 Share Posted June 2, 2012 Don't post your DB credentials to the world -- and I don't know what "offline" means, anyway. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.