Jump to content

Marcus2000

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Marcus2000's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi people, another quick question in regards to my webpage... Can anyone tell me the best way to display the current time in New York, London and Tokyo using php? I would like to use just hours/mins/secs (no dates) and for each city and have the time running live like a real clock. Any sugestions on how to achive this? Thank in advance.
  2. Thanks man, working on something with ajax, looking good for now! Thank you.
  3. Hi guys and girls, I have a div on my page that I would like to refresh once every min. Is this possible with PHP, or should I use something like jquery? Any suggestions would be of much help. Thank you.
  4. Thanks for your much needed explanation AyKay47, The problem has been fixed since, however because of your good self I now have a much better understanding of the initial problem. Thanks for pointing me in the right direction. Cheers.
  5. Maybe this may help you guys out a bit. This is what my friend told me to do the last time I had this problem: REPLACE define ('NID', floor(hexdec(substr(uniqid(''),0,11))/100)-52230000000); // table id BY define ('NID', floor(hexdec(substr(uniqid(''),0,11))/100)-52330000000); // table id (52230000000 to 52330000000, 52330000000 BEING THE CORRECT VALUE, it’s a counter related value, and on some servers, the counter already reaches its limit with the initial figure) This did in fact work for about 3 or 4 weeks. But now I have the same problem, where my uses can't make any changes on their accounts on my website.
  6. Hi guys, I know this is a bit of a messy question, but i have a problem with some code that my friend wrote, and now i don't know how to fix it. Basically there is a line of code on my site, and what my friend told me was that this specific line of code has to do with the server and is similar to a ticking clock. What he told me is that it is a "counted related value" which needs to been changed every now and then when it hits the servers limit. This actually means nothing to me, but i'm hoping some one out there knows what my friend means. Anyway this is the line of code i need to change, or in fact the number i need to change. The problem is that as i dont really know what i'm doing i have no idea as to what to change the number to. Please help guys, I really need to fix this asap. Anyways this is the code: // unique references define ('NID', floor(hexdec(substr(uniqid(''),0,11))/100)-52330000000); // table id define ('SID', strtoupper(uniqid(''))); // short unique id define ('UID', strtoupper(md5(uniqid('')))); // 32char id Its the number 52330000000 that i had to change the last time i had this problem. Many thanks in advance.
  7. Hi people, please can some one help me out with a bit of php for the 'mail function'? All i want to do is have the end user fill out the form, hit submit then either have the user directed to a thank you page or have pop up message stating that the information has been sent. At the moment the code i have does not seem to be sending the mail and aditionally i have no idea where or how to start writing the code for the thank you page or the conformation pop up message. Please can some one show me the light on this one, i am really just starting out with php and finding it real hard. Anyway guys this is the code i have, please let us know what i'm doing wrong and what i need to add to it. <?php if(isset($_POST['submit'])) { $to = "my_email@mydomain"; $subject = "Contact Form"; $name = $_POST['name']; $comp_name = $_POST['company_name']; $email = $_POST['email']; $phone = $_POST['contact_number']; $location = $_POST['location']; $message = $_POST['message']; $body = "From: $name\n E-Mail: $email\n Company Name: $comp_name\n Contact Number: $phone:\n Location: $location:\n Message:\n $message"; mail($to, $subject, $body); } ?> Hope some one can help, many thanks in advance. Cheers.
  8. Thanks for trying mate, but that dont work for me either dude. Does anyone have any sugestions? Cheers.
  9. Hi people, I am a complete newbe to php but can some one please help us out a little with a bit of code? Basically i have a contact form, when the user submits the form it gets processed by my php page and the data sent of to my email address. The thing is I have wrote most of the code for this and i think it should work, however i want to add a bit of code that re-directs the user to a "thank you" page after they submit the form. I hope that makes sense, please check out the code below and please let me know what and where to put the re-direct code, please also let me know if the code i have written so far is correct. my code <?php if(isset($_POST['submit'])) { $to = "me@my_email_address.com"; $subject = "Contact Form"; $name = $_POST['name']; $comp_name = $_POST['company_name']; $email = $_POST['email']; $phone = $_POST['contact_number']; $location = $_POST['location']; $message = $_POST['message']; $body = "From: $name\n E-Mail: $email\n Company Name: $comp_name\n Contact Number: $phone:\n Location: $location:\n Message:\n $message"; mail($to, $subject, $body); } ?> Cheers people, hope some one can help.
  10. Finally..... sucess. Cheers guys, I just removed the code above the php open tag and at the end tag and it seems to be working. Very very pleased, this is the first bit of php code that i have made that seems to work. Thank you so much for your help people. Will be back soon i'm sure, with loads more quetsions. Cheers.
  11. Thanks for responding to my post dude, but even with the admenments i am still getting the error message: Warning: Cannot modify header information - headers already sent by (output started at D:\Sites\killerphp.com\form_test.php:10) in D:\Sites\killerphp.com\form_test.php on line 20 I'm just not having any luck with this at all. I'm using VertrigoServ for testing the script, is there a chance that it may be an issue with that? this is the exact code i'm testing <?php $comp_name = "abc"; if(isset($_POST['company_name']) && $_POST['company_name']==$comp_name) { header("Location: http://www.hotmail.com"); } else { header("Location: http://www.yahoo.com"); } exit(); ?> Thanks for your help mate, I know I can get this, its just driving me a little insain now.
  12. Hi people, I really hope you guys can help me out today. I'm just a newbe at php and i'm having real trouble. Bassically all I want to do is have a user type in a company name in a html form. If what the user types in the form matches the company name in my php script i want the user to be sent to another page on my site. If what the user types in the form doesnt match the company name in my php script i want the user to be sent to a differnt page like an error page for example. this is my html form: <form id="form1" name="form1" method="post" action="form_test.php"> <p>company name: <input type="text" name="company_name" id="company_name" /> </p> <p> <input type="submit" name="button" id="button" value="Submit" /> </p> </form> And this is the php code I'm trying to process the information on: <?php $comp_name = abc; if(isset ($_POST["company_name"])){ if($_POST["company_name"] == $comp_name){ header("Location: http://www.hotmail.com"); exit(); } else{ header("Location: http://www.yahoo.com"); exit(); } } ?> The thing is i'm getting this error when i test it: Warning: Cannot modify header information - headers already sent by (output started at D:\Sites\killerphp.com\form_test.php:10) in D:\Sites\killerphp.com\form_test.php on line 17 Please can some one help me out, i'm sure this is just basic stuff but i just cant get it to work Cheers.
  13. Thanks for the quick response mate. that looks like what i'm after. Just one thing, how to i edit the code to go to either a sucess page or got to the error page? Cheers.
  14. Hi people, please can any of you guys help us out? I need to write some php code but i'm getting more and more confused everytime i get into php. Anyways this is what i'm trying to do on my site: I want the user to type in a company name in a text field in a very simple html form. The user hits submit buton and the text the user typed in gets sent to a php document for processing. If the user has typed in a company name that matches one of the 3 company names that i have, then the user gets sent to one page. (sucess page) If the what the user has entered into the search form does not match one of my 3 company names, then I want them to be sent to another page (error page). I know this is real simple stuff guys, but i just cant get my head round this so far, please, please help. Many thanks in advance, Marcus.
  15. Cheers Denno for all your help, your a star. I'm sure i will be back will more php headaches in the future for you to solve! Cheers Dude.
×
×
  • 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.