Jump to content

chrispols

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chrispols's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey TecBrat, Awesome, that's got me on the right track. Here's my final code: $dt=date(Hi); $p_id = "".$dt; for($id=0; $id<4; $id++){ $p_id .= substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", mt_rand(1,35), 1); } I made it : date(Hi) with 4 subsequent substr.. this should make it impossible to duplicate in theory. If we had 100 tickets inputted the same day with the date in the beginning, we could experience the duplication, but having the time there it should be unique. Thanks for the advice, brilliant! Chris
  2. Ok, no response from making it more Random. How would I go about adding the time into the ticket id? I reckon something like this: $p_id .= substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", mt_rand(1,35), 1)(TIME); //Randomize Ticket ID So this would definitely give a unique ID as the time (i.e. 1209 - 12:09) can be added to the end of the so called "Random mt_rand" function. Is this viable? Thanks Chris
  3. Hi there, I've been running Epix Power support ticketing system for a few months now and it's been working very well. Recently however, it's started to duplicate the ticket id's. So from a ticket entered a few months back, someone entering a new ticket would put their information on that original ticket. This obviously is not good for a support site. The code that is running the generation of the number is the following: for($id=0; $id<10; $id++){ $p_id .= substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", mt_rand(1,35), 1); //Randomize Ticket ID } Is there a way to make the generation of that ID more random than it is now? If there is, how would I go about doing it? Thanks a lot, Chris
  4. Hey everyone, How would I put $_POST data into an automatic email being sent.. Code for the email page is: <?php           $to      = 'chris@blabhblah.com'; $subject = 'A booking has been entered for San Lameer'; $message = "Hello Ben, \n\n  "$_POST['Email']" This is an automated message informing you that someone has entered booking information for San Lameer. \n\nYou cannot view details as we're not keeping a dbase of the information \n\nRegards \n\nThe San Lameer Website \n\n"; $headers = 'From: admin@blah.com' . "\r\n" .   'Reply-To: admin@blah.com' . "\r\n" .   'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> So what are the doodads I need to change on the $_POST to be able to have that part of the email being sent? Over all I need to have a : Name : $_POST['FirstName'] Surname : $_POST['Surname'] etc.. kind of idea.. displayed in the email.. Thanks all, Chris
  5. Hi, found the problem. I had to change $message = 'Hello, this is an automated "\r\n" message new line and text \r more line \r\n and another line'; to $message = "Hello, this is an automated \n\nmessage new line and text \r more line \r\n and another line"; and it works.. just the double quotes. Thanks Chris
  6. Hi, I've been looking all around but can't find exactly how to fix adding line breaks into my automated mail. Can someone tell me what to do to modify this code to get line breaks in. <?php $to      = $_POST['Email']; $subject = 'This is the subject'; $message = 'Hello, this is an automated "\r\n" message <br> new line and text \r more line \r\n and another line'; $headers = 'From: admin@site.com' . "\r\n" .   'Reply-To: admin@site.com' . "\r\n" .   'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> All I ever get is the actual \r \r\n "\r\n" in my mail.. Thanks a lot.
  7. Hey, That works. So is this just something with IIS as on my Apache it works still with the old vars.. Thanks a lot!! Made my life tons easier Chris
  8. Hi, I have PHP/Mysql running on my local server and everything works 100% I have now started running PHP on a windows 2003 IIS. The issue I am having is with a standard POST display. I have 2 files, test.php and test2.php. The following is what they contain: Test.php::: <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form1" method="post" action="test2.php">   <p>     <input name="First_Name" type="text" id="First_Name">   </p>   <p>     <input type="submit" name="Submit" value="Submit">   </p> </form> </body> </html> Test2.php <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form1" method="post" action="">   <p><?php echo $HTTP_POST_VARS['First_Name']; ?> the name</p>   <p>&nbsp; </p> </form> </body> </html> On my machine, the Post_Vars works fine. On the IIS server, nothing comes up. It's blank. I can't figure out what is wrong with the setup. Any ideas? Thanks a lot, Chris
  9. Hi, for something as little as this, I dont' want to go and learn a whole new thing. it's 1 page I need to do this. Hmm.. must thing harder then. Thanks,
  10. Hi everyone, Here's my issue. I have a form with normal data entry which inserts into a database. Quite simple stuff. On one of the pieces of the form, I have an "Onchange" event. Basically this is related to 3 drop down boxes which fetches information from my Dbase. The problem is that the drop down boxes, onchanging, reloads the page with page.php?cat=2&cat3=4 type of thing. When I click on the box and it reloads the page, all the information I have already filled out is taken out. Is there a way I can reload the page with keeping the information I have already filled out to stay? Thanks a lot, Chris
  11. Hi everyone, Here's my issue. I have a form with normal data entry which inserts into a database. Quite simple stuff. On one of the pieces of the form, I have an "Onchange" event. Basically this is related to 3 drop down boxes which fetches information from my Dbase. The problem is that the drop down boxes, onchanging, reloads the page with page.php?cat=2&cat3=4 type of thing. When I click on the box and it reloads the page, all the information I have already filled out is taken out. Is there a way I can reload the page with keeping the information I have already filled out to stay? Thanks a lot, Chris
×
×
  • 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.