Jump to content

penislandbic

New Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by penislandbic

  1. I figured out why it wasn't working. I had the button in a form that had an onSubmit attribute. I never put return false in the function so the form refreshed the same page. It's my fault. There was nothing wrong with my server.
  2. I tested it on a Liniux server from Host Gator and WAMP server on my local computer and both give the same result. I have different .htaccess files on either one.
  3. I'm trying to use JavaScript to redirect to a PHP page that GETs a logout variable and checks to see if it's true. This is what I have function logout() { window.location.href = "index.php?logout=true"; } When I invoke the logout() function, it redirects to "index.php?". It completely ignores the "logout=true" part. How can I fix this?
  4. I made a chat program where you enter your name and then a message, and it posts it so everyone can see it. Let's say that a user is logged into Facebook, and he goes on to my chat, can I have the chat check the Facebook account that he is logged into for his name, and then auto fill his name in the name input box?
  5. How would I change my php.ini to the correct time zone? I have no clue what a php.ini is. I googled it and read that I also have to restart the server. How would I do that? I am sorry about signing up for a year with GoDaddy also. Do you have any suggestions for good hosting serveces?
  6. My php script always returns different times. Example: The current time is 4:33pm and the script returns 11:33am. Then sometimes it is correct, and then randomly switches to something like 7:33pm when it should be 5:33pm. This is my code $time = new DateTime(); $time->setTimezone(new DateTimeZone('America/Chicago')); $time = $time->format('g:i A'); echo $time; I don't know if makes any difference, but I'm renting a server from Go Daddy for my website and it is running Linux. How would I fix this problem? Edit: I'm also having a problem with the "time()" function giving results that are hours off.
  7. I want to replace key words from an array in a user input string for all instances and case insensitive with the string "NOPE". An example array would be... var replacer = new Array("@", "$", "*", "drip", "slide", "move", "(", "\)"); Example: var userInput = "I have to slide down @ $3.00 with all (*) of the $ and moVe to another driping SLIDe"; *Magic replacement...* var output = "I have to NOPE down NOPE NOPE3.00 with all NOPENOPENOPE of the NOPE and NOPE to another NOPEing NOPE"; How would I do that?
  8. I have a php file that has this in it... //Make logChatInput.php $dataBase = "users"; $logChatInput = fopen($newDir."/logChatInput.php", "w"); $logChatInput_contents = <<<EOD <?php $chatInput = addslashes($_GET["chatInput"]); date_default_timezone_set('America/Chicago'); $time = date('g:i A'); $crappychat_service = mysql_connect("localhost", "root", ""); mysql_select_db("{$dataBase}", $crappychat_service); $sql = "INSERT INTO messages (Message) VALUES('".$chatInput."')"; mysql_query($sql, $crappychat_service); ?> EOD; fwrite($logChatInput, $logChatInput_contents); fclose($logChatInput); My problem is I want ONLY $dataBase to be recognized as a the value it holds and not anything else. The php is giving an error because I don't have $chatInput declared outside the EOD. I only want the $dataBase variable to be associated with the current PHP file and not the one being written, so I put it in curly braces, but it still recognizes other "variables". How would have it only recognize $dataBase in the EOD?
×
×
  • 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.