Jump to content

skym

Members
  • Posts

    253
  • Joined

  • Last visited

Everything posted by skym

  1. dcole.ath.cx is right, geographicaly. Is Russia in Europe? Yes it is. Is Russia in Asia? Yes it is. Turkey too, part in Europe, part in Asia.What I don't understand, why is Israel in UEFA?
  2. Finally I understand what your problem is...The fact that the "There was a problem interacting with the database.." message still appears if there is a previous validation error? If yes, then try: if($management == true) {// This is were management first comes into play.$error = false;// ...// sql functions// if something goes wrong, then set $error = true;if ($error) { echo "There was a problem interacting with the database, please contact us at"; echo "info@theyellowpagesnetwork.com"; $management = false; }}if($management == true) {echo "everything seemed to work all right";}
  3. "everything seemed to work all right"This is what I got with the following code: <?php$subscribe = "hello";$name = "name";$email = "mail@mymail.ro";$verifyemail = "mail@mymail.ro";if (isset($subscribe)) {$errorhandler = ""; // This will control holding error information$management = true; // Gives me full control over when the script runs and stops$regex = "^[A-Za-z0-9\._-]+@([A-Za-z0-9][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";// regex variables has a regex value initialized into it, this allows me to quickly run// the regex functions through the email field to test it's format. It makes sure it// contacts an at symbol, and a period, and in the proper places.if ($name == "") { // checks if name is empty, and puts error info into string $errorhandler .= "The Name Field was not filled in correctly<br />"; $management = false; }if ($email == "") { // checks if email is blank $errorhandler .= "The Email Field was not filled in correctly<br />"; $management = false;}if ($email != $verifyemail) { //checks if email fields match $errorhandler .= "The email address DO NOT match<br />"; $management = false;}if (!ereg("$regex", $email)) { //tests emails format with regex variable above $errorhandler .= "The email address is improperly formatted<br />"; $management = false;}if (!empty($errorhandler)) { //This tests the error handler to see if it has recieved print "$errorhandler"; //a string information if so it passes the information below. $management = false;}if($management == true) {// This is were management first comes into play. //$connect = mysql_connect("localhost", "#####", "######"); //$select = mysql_select_db("#######"); echo "sql<br>";}else { echo "There was a problem interacting with the database, please contact us at"; echo "info@theyellowpagesnetwork.com"; $management = false;} if($management == true) { echo "everything seemed to work all right"; } }?> I replaced the $_POST vars (didn't want to make a form for testing), commented the sql functions and put an echo, and I used if (!empty($errorhandler)) (sorry, in the previous post I forgot the !).
  4. Any link to your source?Because the following works for me:<?php$str = "";if (is_string($str)) echo "it is a string"; else echo "it is not";?>
  5. But $errorhandler is a string, even if it's empty.Use if ($errorhandler != "") or if (empty($errorhandler)) instead of if (is_string($errorhandler))
  6. http://www.php.net/manual/en/language.variables.variable.php Always read the php.net documentation (including the notes) when in trouble.
  7. http://www.maxkiesler.com/index.php/weblog...ajax_tutorials/
  8. What if you delete the width: 100%; for TEXTAREA in the stylesheet.css file?
  9. Are there other elements with the same AutoFeedbackForm name in the page?
  10. Just like you do with paths in HTML.include('path_to_the_file/file.php');
  11. skym

    Cookies

    Yes, and if the folders are named just like the cookie values, then you can shorten your code: <?phpif (isset($_COOKIE["language"])) {require("./" . $_COOKIE["language"] . "/menu.php");echo $_COOKIE["language"] . "<br />";}?>
  12. skym

    Cookies

    There is a syntax error...echo "<?php require("./english/menu.php"); ?>" ?! <?phpif (isset($_COOKIE["language_english"])) {require("./english/menu.php");echo $_COOKIE["language_english"] . "<br />";}if (isset($_COOKIE["language_german"]))require("./german/menu.php");elseecho "";?>
  13. include()http://php.net/include/
  14. Wrong? As far as I know both 'color' and 'colour' are correct.
  15. http://www.maxkiesler.com/index.php/weblog...ajax_tutorials/
  16. skym

    Forms - Textarea

    Are there any spaces or new lines between <textarea> and </textarea> ?
  17. In javascript you might try:HTML files: <html><head><script src="file.js"></script></head><body><script>txt = txtFromExternalFile();document.write(txt);</script></body></html> JS file: function txtFromExternalFile(){return "the text or whatever";} You also might use PHP or XML as you said. Which is better, this depends on what "the thing" is.
  18. <?phphighlight_file("file.php");?> http://ro2.php.net/manual/en/function.highlight-file.php
  19. <html><head><script type="text/javascript">function comingsoon(){//document.write("Comming soon<br />")document.getElementById('container').innerHTML = '<div align="center"><div style="background-color: #f4e7ea; border: 1px solid #986265; padding: 5px; font-weight: normal; width: 50%; text-align: center;">Coming soon....</div></div>';}</script></head><body><select size="5"><option onclick="comingsoon()">test<option onclick="comingsoon()">test2</select><span id="container"></span></body></html>
  20. skym

    color picker

    I guess you only need the algorythm. If colormatch.dk uses javascript, then you can take a look in the code and use the same algorythm in PHP.
  21. We can't know if the code is right, what can be done with those constants and that function unless we see it. Look for the constants where they are defined and the tep_image() function, and post them.
  22. skym

    download finished?

    It's 01:00AM and I have no time/strenght to look for the answer by myself, so I'm asking you guys.I just remembered about 2 years ago when I was searching for free games on a site, I couldn't download more then one game at a time, nor I couldn't use any download accelerator. How can this be done in PHP? How do I know if the user has finished downloading or not?
  23. If you don't care about reloading the same page you might try something like: <?phpif (!isset($_GET['confirmed'])) {?><script>if ( confirm("Conditional Question To Start Quest") )document.location='?confirmed=true';elsedocument.write ("Comment about declining quest.");</script><?php} else {mysql_db_query(...);echo "Comment about accepting quest.";}?>
  24. Of course it is not working. You can't combine JS and PHP just like that. PHP will execute the mysql_db_query before any user input, since the browser will never see anyway the query, you are only echoing the results. The PHP will parse the script, execute the query, generate the HTML file and send it to the browser.Better try separate pages something like: <script>if ( confirm("Conditional Question To Start Quest") ) {document.location='script_with_mysql_update.php';}</script>
×
×
  • Create New...