PHP - Moved: Do Variable Values In Urls Effect Seo?
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=357878.0 Similar TutorialsThis topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=357747.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359560.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=323272.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=326189.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=329079.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=357656.0 Hi all, Just curious why this works: Code: [Select] while (($data = fgetcsv($handle, 1000, ",")) !== FALSE){ $import="INSERT into $prodtblname ($csvheaders1) values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]')"; } And this does not: $headdata_1 = "'$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]'"; while (($data = fgetcsv($handle, 1000, ",")) !== FALSE){ $import="INSERT into $prodtblname ($csvheaders1) values($headdata_1)"; }it puts $data[#'s] in the database fields instead of the actual data that '$data[0]','$data[1]'... relates to. I wrote a script to create the values in $headdata_1 based on the number of headers in $csvheaders1 but can't seem to get it working in the sql statement. Thanks This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=315930.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=359215.0 Hi all, I am looking a developing a script that instead of using something like mysite.com/showproduct.php?id=1 I would like it to appear as mysite.com/php-editor Is their a simple way of doing this? I would still need to pull info from a database so the page would still need to be dynamic, I just want it to appear static! I am used to using the get id function of php, what would the workaround be? would the id be hidden from the url but still usable in a query? I have had a look at the apache mod_rewrite, but quite frankly, I dont understand it! Cheers Hi Guys, I don't know how to do this but basically I want the value of $postcode3 to equal the value of $postcodep1 aswell as $postcodep2 like this... else {$postcode3 = $postcodep1 $postcodep2;} That doesn't work... Say $postcodep1 = LS14 $postcodep2 = 2AB Then $postcode3 = LS14 2AB How do I write this in the above php code?! Thanks, S i've google but no luck on finding what i need....is there a way in javascript to compare 2 variables ie.
var him = "jack"; var her = "jill"; if (him == her){ alert('same name'); }thank you Hey everyone, I'm new to this forum and I came here looking for some help with PHP. I've just started getting into PHP and you guys are probably a smile ahead. So basically, I have some inputs and want them to be sent to my email in a basic layout shown below. Code: [Select] Inputs: Title = _title Forum Name = _forumname Name = _irlname Age = _age I want the email to be sent to me like: Code: [Select] Email Title --------------- Forum Name: TextGiven Real Life Name: TextGiven Age: TextGiven Here is my current code which titles the email correctly, but I want to figure out how to make $message set to the example email I showed above. Code: [Select] <?php $to = "******@*********.net"; $subject = $_REQUEST['_title']; $headers = "From: ***** Applicant \r\n"; $headers .= "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\r\n" . "Content-Transfer-Encoding: 7bit\r\n"; $message = $_REQUEST['_forumname' & '_irlname']; <--- Part I want fixed if(mail($to, $subject, $message, $headers)) { echo 'MAIL SENT'; } else { echo 'MAIL FAILED'; } ?> I have this code, and it works. But I want $message = "" to make the message contain not just the forum name, but as well as the name, age, and all other inputs I want. Hi folks, I was wondering how to do this. I want the if statement to detect if the query string has any of these values. so im trying to assign them all to the same variable. However, this code wont work. Whats the trick here? <?php $primary=$_GET['intro']; $primary=$_GET['port']; $primary=$_GET['about']; $primary=$_GET['contact']; if(isset($primary)){ echo "<img src='graphics/left-a.png'>";} else {echo "<img src='graphics/leftb.png'>";}?> are all of the following same, or some same or all different: $variable="" $variable=0 $variable=NULL and which of the above will satisfy if(empty($variable)) { blah!; } I am building a website that uses session variables extensively. The site is getting a little complicated, and I am starting to lose track of which session variables are assigned, and what their values are. Is there some way where I can create a piece of code that will display all of the existing session variables and their values? I have 2 file names, which are uploaded, stored in the variable $files. I want to be able to assign a variable to each file name. What's the best way of doing it?? I want to be able to insert each file into a mysql database on the same line but in different fields. Here is a sample part of my code: Code: [Select] var_dump($files); print_r(array_slice(array($files),0)); //I want to split this into 2 variables. One for each file name??????? list($file1)=$files; //insert the values/filenames into mysql fields "itm_pic_name & itm_pic_name2" $mysqli = new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME); $this->execSQL("INSERT INTO itm_pic_detail(itm_pic_name,itm_pic_name2,itm_pic_type, itm_pic_size) VALUES (?,?,?,?)", array('ssss',$file1,$file1,$type, $size),true); I would really like some input. : The php web script that I’m trying to modify shows an html page of transactions. I’d like to change what is displayed there. The array that generates what is displayed begins on approx line 184 (in bold, near the bottom of the code below, with the line: $ads_list .= PT_LoadPage('transactions/list',array( I’d like help to substitute what appears on the html transaction page by changing what is listed in the transaction/list array (with data from the ‘u_paid_videos’ table, which has these columns: id, id_user, id_video, video_title, time, user_id_uploaded, time_date, earned_amount, currency). Here is current the php code: <?php error_reporting(-1); // set maximum errors ini_set('display_errors' , 'true'); if (!IS_LOGGED || ($pt->config->sell_videos_system == 'off' && $pt->config->usr_v_mon == 'off') ) { header('Location: ' . PT_Link('404')); exit; } $currency = '$'; if ($pt->config->payment_currency == 'EUR') { $currency = '€'; } $types = array('today','this_week','this_month','this_year'); $type = 'today'; if (!empty($_GET['type']) && in_array($_GET['type'], $types)) { $type = $_GET['type']; } if ($type == 'today') { $start = strtotime(date('M')." ".date('d').", ".date('Y')." 12:00am"); $end = strtotime(date('M')." ".date('d').", ".date('Y')." 11:59pm"); $array = array('00' => 0 ,'01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0 ,'13' => 0 ,'14' => 0 ,'15' => 0 ,'16' => 0 ,'17' => 0 ,'18' => 0 ,'19' => 0 ,'20' => 0 ,'21' => 0 ,'22' => 0 ,'23' => 0); $ads_array = $array; $date_type = 'H'; $pt->cat_type = 'today'; $pt->chart_title = $lang->today; $pt->chart_text = date("l"); } elseif ($type == 'this_week') { $time = strtotime(date('l').", ".date('M')." ".date('d').", ".date('Y')); if (date('l') == 'Saturday') { $start = strtotime(date('M')." ".date('d').", ".date('Y')." 12:00am"); } else{ $start = strtotime('last saturday, 12:00am', $time); } if (date('l') == 'Friday') { $end = strtotime(date('M')." ".date('d').", ".date('Y')." 11:59pm"); } else{ $end = strtotime('next Friday, 11:59pm', $time); } $array = array('Saturday' => 0 , 'Sunday' => 0 , 'Monday' => 0 , 'Tuesday' => 0 , 'Wednesday' => 0 , 'Thursday' => 0 , 'Friday' => 0); $ads_array = $array; $date_type = 'l'; $pt->cat_type = 'this_week'; $pt->chart_title = $lang->this_week; $pt->chart_text = date('y/M/d',$start)." To ".date('y/M/d',$end); } elseif ($type == 'this_month') { $start = strtotime("1 ".date('M')." ".date('Y')." 12:00am"); $end = strtotime(cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y'))." ".date('M')." ".date('Y')." 11:59pm"); if (cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y')) == 31) { $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0 ,'13' => 0 ,'14' => 0 ,'15' => 0 ,'16' => 0 ,'17' => 0 ,'18' => 0 ,'19' => 0 ,'20' => 0 ,'21' => 0 ,'22' => 0 ,'23' => 0,'24' => 0 ,'25' => 0 ,'26' => 0 ,'27' => 0 ,'28' => 0 ,'29' => 0 ,'30' => 0 ,'31' => 0); }elseif (cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y')) == 30) { $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0 ,'13' => 0 ,'14' => 0 ,'15' => 0 ,'16' => 0 ,'17' => 0 ,'18' => 0 ,'19' => 0 ,'20' => 0 ,'21' => 0 ,'22' => 0 ,'23' => 0,'24' => 0 ,'25' => 0 ,'26' => 0 ,'27' => 0 ,'28' => 0 ,'29' => 0 ,'30' => 0); }elseif (cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y')) == 29) { $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0 ,'13' => 0 ,'14' => 0 ,'15' => 0 ,'16' => 0 ,'17' => 0 ,'18' => 0 ,'19' => 0 ,'20' => 0 ,'21' => 0 ,'22' => 0 ,'23' => 0,'24' => 0 ,'25' => 0 ,'26' => 0 ,'27' => 0 ,'28' => 0 ,'29' => 0); }elseif (cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y')) == 28) { $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0 ,'13' => 0 ,'14' => 0 ,'15' => 0 ,'16' => 0 ,'17' => 0 ,'18' => 0 ,'19' => 0 ,'20' => 0 ,'21' => 0 ,'22' => 0 ,'23' => 0,'24' => 0 ,'25' => 0 ,'26' => 0 ,'27' => 0 ,'28' => 0); } $ads_array = $array; $pt->month_days = count($array); $date_type = 'd'; $pt->cat_type = 'this_month'; $pt->chart_title = $lang->this_month; $pt->chart_text = date("M"); } elseif ($type == 'this_year') { $start = strtotime("1 January ".date('Y')." 12:00am"); $end = strtotime("31 December ".date('Y')." 11:59pm"); $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0); $ads_array = $array; $date_type = 'm'; $pt->cat_type = 'this_year'; $pt->chart_title = $lang->this_year; $pt->chart_text = date("Y"); } $day_start = strtotime(date('M')." ".date('d').", ".date('Y')." 12:00am"); $day_end = strtotime(date('M')." ".date('d').", ".date('Y')." 11:59pm"); $this_day_ads_earn = $db->rawQuery("SELECT SUM(amount) AS sum FROM ".T_ADS_TRANS." c WHERE `time` >= ".$day_start." AND `time` <= ".$day_end." AND type = 'video' AND video_owner = ".$pt->user->id); //$this_day_video_earn = $db->rawQuery("SELECT * FROM ".T_VIDEOS_TRSNS." c WHERE `time` >= ".$day_start." AND `time` <= ".$day_end." AND user_id = ".$pt->user->id); $this_day_video_earn = $db->rawQuery("SELECT * FROM u_paid_videos c WHERE `time` >= ".$day_start." AND `time` <= ".$day_end." AND user_id_uploaded = ".$pt->user->id); $day_net = 0; foreach ($this_day_video_earn as $tr) { if ($tr->currency == "USD") { //$day_net = $day_net + ($tr->amount - $tr->admin_com); $day_net = $day_net + ($tr->earned_amount); } } $today_earn = $this_day_ads_earn[0]->sum + $day_net ; $month_start = strtotime("1 ".date('M')." ".date('Y')." 12:00am"); $month_end = strtotime(cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y'))." ".date('M')." ".date('Y')." 11:59pm"); $this_month_ads_earn = $db->rawQuery("SELECT SUM(amount) AS sum FROM ".T_ADS_TRANS." c WHERE `time` >= ".$month_start." AND `time` <= ".$month_end." AND type = 'video' AND video_owner = ".$pt->user->id); //$this_month_video_earn = $db->rawQuery("SELECT * FROM ".T_VIDEOS_TRSNS." c WHERE `time` >= ".$month_start." AND `time` <= ".$month_end." AND user_id = ".$pt->user->id); $this_month_video_earn = $db->rawQuery("SELECT * FROM u_paid_videos c WHERE `time` >= ".$month_start." AND `time` <= ".$month_end." AND user_id_uploaded = ".$pt->user->id); $month_net = 0; foreach ($this_month_video_earn as $tr) { if ($tr->currency == "USD") { //$month_net = $month_net + ($tr->amount - $tr->admin_com); $month_net = $month_net + ($tr->earned_amount); } } $month_earn = $this_month_ads_earn[0]->sum + $month_net ; //$trans = $db->where('user_id',$user->id)->orderBy('id','DESC')->get(T_VIDEOS_TRSNS); $trans = $db->where('user_id_uploaded',$user->id)->orderBy('id_user')->get('u_paid_videos'); $ads_trans = $db->where('time',$start,'>=')->where('time',$end,'<=')->where('video_owner',$pt->user->id)->where('type','video')->get(T_ADS_TRANS); $total_ads = 0; if (!empty($ads_trans)) { foreach ($ads_trans as $key => $ad) { if ($ad->time >= $start && $ad->time <= $end) { $day = date($date_type,$ad->time); if (in_array($day, array_keys($ads_array))) { $ads_array[$day] += $ad->amount; $total_ads += $ad->amount; } } } } $ads_list = ""; $total_earn = 0; if (!empty($trans)) { foreach ($trans as $tr) { //$video = PT_GetVideoByID($tr->video_id, 0, 0, 2); $video = PT_GetVideoByID($tr->id_video, 0, 0, 2); $user_data = PT_UserData($tr->id); $currency = ""; $admin_currency = ""; $net = 0; if ($tr->currency == "USD") { $currency = "$"; //$admin_currency = "$".$tr->admin_com; $net = $tr->earned_amount; } else if($tr->currency == "EUR"){ $currency = "€"; //$admin_currency = "€".$tr->admin_com; //$net = $tr->amount - $tr->admin_com; $net = $tr->earned_amount; } elseif ($tr->currency == "EUR_PERCENT") { $currency = "€"; //$admin_currency = $tr->admin_com."%"; //$net = $tr->amount - ($tr->admin_com * $tr->amount)/100; $net = $tr->earned_amount; } elseif ($tr->currency == "USD_PERCENT") { $currency = "$"; //$admin_currency = $tr->admin_com."%"; //$net = $tr->amount - ($tr->admin_com * $tr->amount)/100; $net = $tr->earned_amount; } if ($tr->time >= $start && $tr->time <= $end) { $day = date($date_type,$tr->time); if (in_array($day, array_keys($array))) { $array[$day] += $net; } } $total_earn = $total_earn + (float)$net; if (!empty($video) && !empty($user_data)) { **$ads_list .= PT_LoadPage('transactions/list',array(** 'ID' => $tr->id, 'PAID_USER' => substr($user_data->name, 0,20), 'PAID_URL' => $user_data->url, 'USER_NAME' => $user_data->username, 'VIDEO_NAME' => substr($video->title, 0,20) , 'VIDEO_URL' => $video->url, 'VIDEO_ID_' => PT_Slug($video->title, $video->video_id), 'AMOUNT' => $tr->earned_amount, "CURRENCY" => $currency, "A_CURRENCY" => $admin_currency, "NET" => $net, "TIME" => PT_Time_Elapsed_String($tr->time) )); } } } $total_earn = $total_earn + $total_ads; $pt->array = implode(', ', $array); $pt->ads_array = implode(', ', $ads_array); $pt->page_url_ = $pt->config->site_url.'/transactions'; $pt->title = $lang->earnings . ' | ' . $pt->config->title; $pt->page = "transactions"; $pt->description = $pt->config->description; $pt->keyword = @$pt->config->keyword; $pt->currency = $currency; $pt->content = PT_LoadPage('transactions/content',array( 'CURRENCY' => $currency, 'ADS_LIST' => $ads_list, 'TOTAL_EARN' => $total_earn, 'TODAY_EARN' => $today_earn, 'MONTH_EARN' => $month_earn )); any help/guidance/suggestion is appreciated
Hi there, I am working on a PHP web form and I have a very simple situation I guess, I have a variable named: $MyVal When I do print_r($MyVal); To see whats inside, I get: SimpleXMLElement Object ( [0] => 8.23 ) Now I am assigning this variable into a session variable so that I can do calculations with it. So I assign: $_SESSION['MySesVal'] = $MyVal; But after assigning to session variable, when I do my calculations: $finalValue = $_SESSION['MySesVal'] * 4; I get 0. So is it because the actual $MyVal variable has some XML stuff as: SimpleXMLElement Object ( [0] => 8.23 ) So what is the right way to properly assign $MyVal variable to a session variable to do calculations. Please reply. All comments and feedbacks are always welcome. Thank you! This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=314466.0 |