Jump to content

_Chris

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by _Chris

  1.    //make connection with mysql and select the database
    $mysql_connect = mysql_connect($host, $mysql_user, $mysql_password) ;
    if(!$mysql_connect) {echo ("<P>Connection issues. No results displayed.</P>");}
    $db_select = mysql_select_db($mysql_db);
    if(!$db_select) {echo ("<P>Connection issues. No results displayed.</P>");}

    $subject = "Subject Text";
    $body = "Body text;
    $event_date = '2015-01-31';    //Y-m-d FORMAT

    but I would also like to put into the email at the beginning:
    Hi first_name, (with the comma and then a couple of line spaces within the $body)
    In the mysql the first name is listed as first_name, so I would want the email to automatically insert the recipients first name at the beginning, at the top of the email. How do you do that please?

    Dez.

     

  2. I have been working on this:

    <?php

    date_default_timezone_set('GMT');

    #echo date("l, \\t\h\e jS of F, Y");

    echo date('l, \\t\h\e dS \of F, Y', strtotime('-2 weekdays')); ?>

    But, it comes out as :

    Wednesday, the 05th of December, 2012

    Is there any way of the 0 in the 05th being omitted please?

     

    Any help appreciated.

     

    Chris

  3. Been on this for a while, and really getting stuck. Anyone know how to add more class names for tables to the code below please? For example, for other tables with the class names of timetable and table-six please??

     

    try
    {
    	$html = file_get_html($input);
    	$tables = $html->find('table[class=table-one]');
    	foreach( $tables as $table)
    
    {
    

     

    Any help appreciated.

     

    Chris

  4. Is there some way of a php include which is visible on every page (footer), itself having two php includes, but only one of which would be visible, then on the user refreshing the page or on visiting another page on the site, that include would be replaced with another php include?  Preferably done without any js.

     

    Any help appreciated.

     

    Chris

     

  5. Very true, in fact, I would imagine quite a few people do that - I've been doing it myself for many years.

     

    Any other ideas ?

     

    Also, how do these look to you :

     

    Make sure there's an @ and it is not at the end or beginning of the email

     

    Make sure there's at least one dot and it is not at the end or beginning of the email.

     

    Make sure there's one dot after the @ but not right next to it

     

    Make sure that there are at least two characters after the last 'dot'

     

    Make sure that there's no commas anywhere

     

    Make sure that there's only one @ sign

     

    Make sure that only the characters 0123456789abcdefghijklmnopqrstuvwxyz@.-_ are used  (should others be allowed, like !£$%*&+?)

     

    Any others that could be added ?

  6. 4 things..

     

     

    1. Make them enter their email twice.

    2. Show on the page if the email is valid.

    3. Do a server side check to see if the email is valid.

    4. You could use ajax to show if the email is taken or dHTML to check if the emails match.

    Many thanks to you both for that, for this post - I understood No 1, but can you expand a little on the others at all please ?

     

     

  7. I should imagine others here have experienced it. The user completes your form, and they unintentionally input their email address incorrectly. Then when you reply to their form, you then get the mailer daemon returning your email !

     

    Now, there's a couple of ways that some websites try to solve this problem - some ask the user to input their email address twice, some show the forms results on the next page, so that the user has a last chance to check, before completing the submission.

     

    Two things - firstly, are there any other ways of trying to ensure that, as much as possible, that the user inputs the correct email address ?

     

    Secondly, what have you found works really well for you please ?

     

    Any help much appreciated.

     

    Chris

     

  8. Many thanks for the quick help on this - it's really appreciated.  I'm now using the code below, and is giving the correct format, but are you saying that it would it give me 02 Apr on the 2nd of April, and not 2 Apr ?

     

    <?php

     

    $table8 .= "\n".'<td class="styles1"><div class="day">'.substr(date('l',strtotime($dates[1][$i].' '.date('Y'))), 0, 3).'</div><div class="date">'.substr($datestr, 0, 6).'</div>'.str_replace('<span>Two</span>','',str_replace('Three.','Four',$Six[0][$i])).'</td>';

     

    ?>

  9. Crikey, I was told that you lot were not only helpful but very quick as well - looks as though it was the total truth  :)  How would you change the code below to reflect the amendments please :

     

    $table8 .= "\n".'<td class="styles1"><div class="day">'.date('l',strtotime($dates[1][$i].' '.date('Y'))).'</div><div class="date">'.$datestr.'</div>'.str_replace('<span>Two</span>','',str_replace('Three.','Four',$Six[0][$i])).'</td>';

     

    Chris.

     

     

  10. Hi all, Was recommended here as you're all a very helpful lot  :)  Basically, the code below, gets information from another page, but in the string for the day, it's coming in as the full name and for the date string, it's coming in as the full name for the month - with str_replace how do you get all days of the week and all months of the year, to change to the first 3 letters please ? ie, Monday changes to Mon, Tuesday to Tue, April changes to Apr, October changes to Oct?

     

    $table8 .= "\n".'<td class="styles1"><div class="day">'.date('l',strtotime($dates[1][$i].' '.date('Y'))).'</div><div class="date">'.$datestr.'</div>'.str_replace('<span>Two</span>','',str_replace('Three.','Four',$Six[0][$i])).'</td>';

     

    Any help much appreciated.

     

    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.