function create_new_site($domain,$path){ #### the themes database connect#### $themes=array(); $cont_data=DB_connect::connect_content_db(); $results = mysqli_query($cont_data, "select theme, subtheme from themes;"); while($offset_rowin= mysqli_fetch_assoc( $results )){ $themes[]=$offset_rowin; } DB_connect::disconnect_content_db($cont_data); $newarray=array(); foreach($themes as $item){ if(!in_array($item['theme'],$newarray)){ $newarray[$item['theme']]=array(); } } foreach($themes as $item){ if(array_key_exists($item['theme'],$newarray)){ $newarray[$item['theme']][]=$item['subtheme']; } } $options=array_keys($newarray); $select=''; $java_opts="{"; foreach($options as $opt){ $select.=' '.$opt.' '; $java_opts.='"'.$opt.'":['; $java_opts.='{text:"Please Select",value:""},'; $java_opts.='{text:"Generic",value:""},'; foreach($newarray[$opt] as $value){ $java_opts.='{text:"'.$value.'",value:"'.$value.'"},'; } $java_opts=rtrim($java_opts, ","); $java_opts.='],'; } $java_opts=rtrim($java_opts, ","); $java_opts.='}'; #################### ### the themes header part### $new_site['content_1']=' '; ########################## ################## ###The themes form part: ########################## ################## if($path=='/create_new_site'){ if(isset($_POST['site_info'])){ $server_name_path=dirloc::$dirlocation."server_name.txt"; $handle = fopen($server_name_path, "r"); $server_name=fread($handle,filesize($server_name_path)); fclose($handle); $fulladdress=$domain.$path; $site_logo=$_POST['sitelogo']; $site_logo=str_replace('\'',"\'",$site_logo); $slogan=$_POST['slogan']; $slogan=str_replace('\'',"\'",$slogan); $site_company=$_POST['company']; $site_company=str_replace('\'',"\'",$site_company); $site_email=$_POST['email_bit']; $site_email=str_replace('\'',"\'",$site_email); $site_sidebar=$_POST['side_bar_1']; $site_sidebar=str_replace('\'',"\'",$site_sidebar); // this is for the homepage content $site_title=$_POST['title']; $site_title=str_replace('\'',"\'",$site_title); $site_heading=$_POST['heading']; $site_heading=str_replace('\'',"\'",$site_heading); $site_content=$_POST['content_1']; $theme=$_POST['fieldone']; $subtheme=$_POST['findone']; $site_content=str_replace('\'',"\'",$site_content); # $leftfooter1='

2016 © Copyright '.$site_logo.' - '.$domain.' All rights reserved. |

© '.$site_logo.' 2016 | www.'.$domain.' | Email: '.$site_email.'@'.$domain.' | Privacy | Terms & Conditions | Cookie Policy | All rights reserved. Contact: '.$site_email.'@'.$domain.'.

[domain] [average] out of 5 based on [ratings] ratings. [reviews] user reviews.

2013 © Copyright '.$sitelogo.' - '.$domain.' All rights reserved. Email: '.$email.'