Project / Support Center
Welcome, Guest. Please login or register. March 31, 2023, 04:52: AM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Recent Posts
Pages: 1 ... 3 4 5 6 7 [8] 9 10

 71 
 on: June 13, 2016, 08:28: PM 
Started by admin - Last post by admin
The field in the mysql database is a DATE field - 0000-00-00   (year-month-day)

<?
$now = time(); // current date
$start = strtotime(@$row_rsgroup['event_date']); // event date from a recordset
$days = ($start - $now) / 86400; // gets the # of days between now and the start date
?>
<?php
// Show IF Conditional
if ($days > 0) {
?>// only shows if the number of days left is greater than 0
                               <strong>  Only <?php
echo floor($days);
?>  // floor rounds down to whole number you can use ceil to round up

Days until the event</strong>
 


                                 <?php }
// endif Conditional
?>



 72 
 on: March 03, 2016, 06:18: PM 
Started by admin - Last post by admin
Upload the /tiny_mce/ directory to where you want it and make sure red area is pointing to it correctly

The Add this to the head area:

<!-- TinyMCE -->
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
   tinyMCE.init({
      mode : "textareas",
      theme : "simple",
      width: "400px",
      height: "300px",
      editor_selector : "reg_note"
   });
</script>
<!-- /TinyMCE -->

The editor_selector is the textarea name and also add it as the class for the textarea itself

 <textarea name="reg_note" class="reg_note" id="reg_note">

<?php echo $row_rsreg['reg_note']; ?>

</textarea>


Thats it the simple text editor should show up now in the textfield you wanted it to work with.

If it is not make sure red section is pointing to the tiny_mce directory correctly.
Adjust Width and height as you want

 73 
 on: December 23, 2015, 05:23: PM 
Started by admin - Last post by admin
I had an issue - A new photo upload program i used stored the directory information with the actual file name - i.e. - /class/gallery/image.jpeg

The problem was I had over 10,000 photos in the system that just stored the image name and not the directory information (i.e. image.jpeg ) which meant that the image display coding I already had would not work. So I needed to make the new name storage conform to the way I had things setup - I needed to remove the directory information ( /class/gallery/ ) from the way the new file name was stored (  /class/gallery/image.jpeg )

After much searching this is what I came up with that worked

<?php
        $filename = $row_rsphotos['photo_file'];
   $takeout = array ('/class/gallery/');
   $replacewith ='';
    $newstring = str_replace($takeout,$replacewith,$filename);
   
    echo $newstring;
?>

Since /class/gallery/ was not in the older file names stored this did not affect them at all

 74 
 on: December 22, 2015, 11:42: PM 
Started by admin - Last post by admin
There are 3 parts to this
1. Detecting if a mobile device
2. Creating a function that says its a mobile device
3. Using function in a  If Then Else statement to show of hide something on a page

Put Detection script (1)  and Function (2) anywhere on your page before If Then Else statement (3)

1. Detection Script

Code:
<?php

$useragent
=$_SERVER['HTTP_USER_AGENT'];

if(
preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4)))
?>

2. Function

Code:
<?php function isMobile() {
    return 
preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i"$_SERVER["HTTP_USER_AGENT"]);
}
?>

3. If Then Else Statement

Code:
<?php  // Using the function begin if then else
if(isMobile()){?>


If mobile device show this

<?php } else { ?>

    If NOT a mobile device show this  

<?php //End if then else 
}?>

 75 
 on: December 21, 2015, 10:59: PM 
Started by admin - Last post by admin
<?php
// Show IF Conditional region11
if (strtotime(@$row_rsclassphotos['submit_date']) <= strtotime('2015-12-21')) {
?>
show this
                                                                  
<?php
// else Conditional region11
} else { ?>
                                                                  
Else show this

  <?php }
// endif Conditional region11
?>

>= great than or equal to this date
<= less than or equal to this date

 76 
 on: July 28, 2015, 01:51: PM 
Started by admin - Last post by admin
<?php echo substr(($_GET['owed']),0,7); ?>

0 id the number of characters to start at (0 means the first character)
7 represents the number of characters to display

all must be enclosed in () with a ; at the end

 77 
 on: May 21, 2015, 07:47: PM 
Started by admin - Last post by admin



I wanted to know if a High School class was having a 10 year reunion so I put this above the doc type

<? $classyear= $row_rsreunionreg['class_year'];
$currentyear= date('Y');
$years=$currentyear-$classyear;
?>

date('Y') echos the current year into the variable $currentyear

<?php
// Show IF Conditional 
if ($years <= 11) {
?>

Your Info Here


<?php }
// endif Conditional
?>

I made it less than or equal to 11 to account for those that signed up a year early

 78 
 on: May 05, 2015, 08:37: PM 
Started by admin - Last post by admin
Try placing this at the top of your page

 <?php
ob_start();
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED | E_STRICT));
?>

Bold portion - It buffers the header information or in essence slows it down (not the page itself) so things can load correctly

 79 
 on: December 30, 2014, 11:51: PM 
Started by admin - Last post by admin
<?php
   echo date('m-d-Y', mktime(date('h'),date('i'),date('s'),date('m'),date('d')+30,date('Y')))."\n";

?>

change bold for # of days added  -
Red add a new line at the end of the date - below is without the new line
Maroon is the way the date will display.
To insert into a mysql date field - display as Ymd - no spaces or dashes in between

<?php echo date('m-d-Y', mktime(date('h'),date('i'),date('s'),date('m'),date('d')+365,date('Y')));?>

 80 
 on: November 17, 2014, 05:01: PM 
Started by admin - Last post by admin
<?php   
$now = time(); // or your date as well
$your_date = strtotime(@$row_rsecho['transaction_date']);  // dynamic recordset date
$datediff = $now - $your_date;
$days= ($datediff / (60 * 60 * 24))
   ?>

Show if based on # of days less than
 <?php
// Show IF Conditional region for 60 days
if($days >
 60) {
?>
Your text or image that will show if greater than 60 days past start date
?> // end show if

Show if based on # of days less than
 <?php
// Show IF Conditional region for 180 days or 6 months
if($days <
 180) {
?>
Your text or image that will show if less than 180 days past start date
?> // end show if

Pages: 1 ... 3 4 5 6 7 [8] 9 10
Web Global Net Web Application & Web Development Project Center  |  Recent Posts


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!