<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with cs310]]></title><description><![CDATA[A list of topics that have been tagged with cs310]]></description><link>https://community.secnto.com//tags/cs310</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 19:54:27 GMT</lastBuildDate><atom:link href="https://community.secnto.com//tags/cs310.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[CS310 GDB 1 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Dear Students!</p>
<p dir="auto">Graded Discussion Board (GDB) will be launched on Monday, July 27, 2020 and it will close on Tuesday, July 28, 2020.</p>
<p dir="auto">GDB Scenario:</p>
<p dir="auto">Suppose, as a PHP developer, you are assigned a task to develop a Shopping Store Application. The application should fulfill the following requirements.</p>
<p dir="auto">·        Application should be able to track the type of products users are visiting. By looking at each user’s interest, the application should suggest some related products to each user in current and future visits of store.</p>
<p dir="auto">·        Application should have an option to add products into the cart and wish list but only for registered users.</p>
<p dir="auto">From cookies and PHP session or blend of both, which technique you will prefer to use for the development of required Shopping Store Application? Discuss it with precise and detailed comments.</p>
<hr />
<p dir="auto">Instructions:</p>
<p dir="auto">·        Your answer should not exceed 5 – 6 lines of text in justification of your selected technique.</p>
<p dir="auto">·        A concise, coherent and to the point answer is preferred over lengthy comment having irrelevant details.</p>
<p dir="auto">·        Answers, posted on regular lesson’s MDB or sent through email will NOT be considered in any case.</p>
<p dir="auto">Please note GDB does not have any grace day. We are giving you about a full week to prepare your comments and 48 hours to just post them. GDB comments will not be accepted through email in any case.</p>
<p dir="auto">Best of Luck!</p>
]]></description><link>https://community.secnto.com//topic/2017/cs310-gdb-1-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/2017/cs310-gdb-1-solution-and-discussion</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[CS310 Assignment 1 Solution and Discussion]]></title><description><![CDATA[@Zara-Rana-Ilyas
No its sample code not Solution
]]></description><link>https://community.secnto.com//topic/1774/cs310-assignment-1-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/1774/cs310-assignment-1-solution-and-discussion</guid><dc:creator><![CDATA[cyberian]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[CS310 Assignment 3 Solution and Discussion]]></title><description><![CDATA[Solution Idea!
php file
CS301.php
&lt;?php
$host = "localhost";
$user = "root";
$password = "";
$dbname = "bc12345";

// Create connection
$conn = mysqli_connect($host, $user, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

$sql = "INSERT INTO `sales` (`ID`, `Name`, `Region`, `Client_Name`, `Unit`, `Unit_Cost`, `Date`) 
VALUES ('5', 'boll point', 'south', 'Jhon', '230', '120.99', '2020-01-12')";

if (mysqli_query($conn, $sql)) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "&lt;br&gt;" . mysqli_error($conn);
}

mysqli_close($conn);
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;CS310 Assignment&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;/body&gt;
&lt;/html&gt;

]]></description><link>https://community.secnto.com//topic/988/cs310-assignment-3-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/988/cs310-assignment-3-solution-and-discussion</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[CS310 Assignment 2 Solution and Discussion]]></title><description><![CDATA[Idea Solution
&lt;?php

if(!isset($_GET['customer_id']) || !isset($_GET['units'])){
$customer_id = 0;
$units = 0;
}
else{
	$customer_id = $_GET['customer_id'];
$units = $_GET['units'];
}
$amount = 0;

if($units &gt; 0 &amp;&amp; $units &lt;= 50)
    {
        $amount = $units * 0.50;
    }
    else if($units &lt;= 150)
    {
        $amount = 50 * 0.5 + (($units - 50) * 0.75);
    }
    else if($units &lt;= 250)
    {
        $amount = 50 * 0.5 + 100 * 0.75 + (($units - 150) * 1.00);
    }
    else
    {
        $amount = 50 * 0.5 + 100 * 0.75 + 100 * 1.0 + (($units - 250) * 1.50);
    }


$tax = $amount * 0.18;
$payable = $amount + $tax;
$lp_surcharge = $payable * 0.05;

$late_payable = $payable + $lp_surcharge;
?&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Assignment No. 2 (Solution) - Fall 2019&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor="#CCCCCC"&gt;
&lt;table width="1800" border="0" align="center" cellpadding="20" cellspacing="0"&gt;
  &lt;tr&gt;
    &lt;td height="200" colspan="2" align="center" valign="middle" bgcolor="#CC6633"&gt;&lt;h1&gt;Natural Gas Company Pakistan&lt;/h1&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td width="300"  align="center" valign="top" bgcolor="#FF9966"&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="20"&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;strong&gt;Customer ID&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;strong&gt;Units Consumed&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;strong&gt;Cost of Gas&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;p&gt;&lt;strong&gt;Taxes (18%)&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;strong&gt;Payable within Due Date&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;strong&gt;Late Payment Surcharge (5%)&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="right"&gt;&lt;strong&gt;Payable after Due Date&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
&lt;/td&gt;
  &lt;td height="500" align="left" valign="top" bgcolor="#FFDECE"&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="20"&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;&lt;?php echo $customer_id; ?&gt;&lt;/strong&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $units; ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $amount; ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;?php echo intval($tax*100) / 100; ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;?php echo intval($payable * 100) / 100; ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;&lt;?php echo intval($lp_surcharge * 100) / 100; ?&gt;&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;&lt;?php echo intval($late_payable * 100) / 100; ?&gt;&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td height="140" colspan="2" align="center" valign="middle" bgcolor="#CC6633"&gt;&lt;h4&gt;Copy Rights: NGCP&lt;/h4&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;


Ideas 2
&lt;?php

if (isset($_POST[‘submit’])) {

$salary = $_POST[‘salary’];

if ($salary&gt;50000) {

$insurance = (20/100)*$salary;

echo “Your salary is “.$salary . ” And Calculated insurance is “. $insurance;

}elseif($salary&gt;40000){

$insurance = (15/100)*$salary;

echo “Your salary is “.$salary . ” And Calculated insurance is “. $insurance;

}elseif($salary&gt;30000){

$insurance = (10/100)*$salary;

echo “Your salary is “.$salary . ” And Calculated insurance is “. $insurance;

]]></description><link>https://community.secnto.com//topic/727/cs310-assignment-2-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/727/cs310-assignment-2-solution-and-discussion</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[CS310 Assignment 1 Solution and Discussion]]></title><description><![CDATA[Solution Code:
&lt;?php
$header = "Virtual University of Pakistan";
$quicklist = "QUICK LINKS";
$about = "About Us";
$admissions = "Admissions";
$faculties = "Faculties";
$student = "Student";
$campuses = "Virtual Campuses";
$contact_us = "Contact Us";
$intro = "INTRODUCTION";
$content = "Pakistan’s first University based completely on modern Information and Communication Technologies.";
$footer = "M.A Jinnah Campus, Defence Road,&lt;br&gt; Off Raiwind Road, Lahore";


?&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Assignment No. 1 (Solution) - Fall 2019&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor="#CCCCCC"&gt;
&lt;table width="1800" border="0" align="center" cellpadding="20" cellspacing="0"&gt;
  &lt;tr&gt;
    &lt;td height="200" colspan="2" align="center" valign="middle" bgcolor="#CC6633"&gt;&lt;h1&gt;&lt;?php echo $header; ?&gt;&lt;/h1&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="300" rowspan="2" align="center" valign="top" bgcolor="#FF9966"&gt;&lt;h3&gt;&lt;?php echo $quicklist; ?&gt;&lt;/h3&gt;
		&lt;a href="#"&gt;&lt;?php echo $about; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
		&lt;a href="#"&gt;&lt;?php echo $admissions; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $faculties; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $student; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $campuses; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $contact_us; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
&lt;/td&gt;
    &lt;td width="1500" height="50" align="center" valign="top" bgcolor="#FFDECE"&gt;&lt;h3&gt;&lt;?php echo $intro; ?&gt;&lt;/h3&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="500" align="left" valign="top" bgcolor="#FFDECE"&gt;&lt;p&gt;&lt;?php echo $content; ?&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="140" colspan="2" align="center" valign="middle" bgcolor="#CC6633"&gt;&lt;h4&gt;&lt;?php echo $footer; ?&gt;&lt;/h4&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;


Ideas 2
&lt;?php
$header = "Virtual University of Pakistan";
$quicklist = "QUICK LINKS";
$about = "About Us";
$admissions = "Admissions";
$faculties = "Faculties";
$student = "Student";
$campuses = "Virtual Campuses";
$contact_us = "Contact Us";
$intro = "INTRODUCTION";
$content = "Pakistan’s first University based completely on modern Information and Communication Technologies.";
$footer = "M.A Jinnah Campus, Defence Road,&lt;br&gt; Off Raiwind Road, Lahore";


?&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Assignment No. 1 (Solution) - Fall 2019&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor="#CCCCCC"&gt;
&lt;table width="1800" border="0" align="center" cellpadding="20" cellspacing="0"&gt;
  &lt;tr&gt;
    &lt;td height="200" colspan="2" align="center" valign="middle" bgcolor="#CC6633"&gt;&lt;h1&gt;&lt;?php echo $header; ?&gt;&lt;/h1&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="300" rowspan="2" align="center" valign="top" bgcolor="#FF9966"&gt;&lt;h3&gt;&lt;?php echo $quicklist; ?&gt;&lt;/h3&gt;
		&lt;a href="#"&gt;&lt;?php echo $about; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
		&lt;a href="#"&gt;&lt;?php echo $admissions; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $faculties; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $student; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $campuses; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
        &lt;a href="#"&gt;&lt;?php echo $contact_us; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; 
&lt;/td&gt;
    &lt;td width="1500" height="50" align="center" valign="top" bgcolor="#FFDECE"&gt;&lt;h3&gt;&lt;?php echo $intro; ?&gt;&lt;/h3&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="500" align="left" valign="top" bgcolor="#FFDECE"&gt;&lt;p&gt;&lt;?php echo $content; ?&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="140" colspan="2" align="center" valign="middle" bgcolor="#CC6633"&gt;&lt;h4&gt;&lt;?php echo $footer; ?&gt;&lt;/h4&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;


]]></description><link>https://community.secnto.com//topic/571/cs310-assignment-1-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/571/cs310-assignment-1-solution-and-discussion</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[CS310 Quiz 2 Solution and Discussion]]></title><description><![CDATA[said in CS310 Quiz 2 Solution and Discussion:

If we want to show all the session variable values for a user session then following code will be used.

To see every variable currently stored in a user’s session, you use the print_r() or var_dump() function on the $_SESSION superglobal.
These functions allow you to output the entire contents of the associative array in a readable format, which is extremely helpful for debugging.
The Code
&lt;?php
session_start(); // You must always start the session first

// Option 1: Using print_r (Cleanest for reading)
echo "&lt;pre&gt;";
print_r($_SESSION);
echo "&lt;/pre&gt;";

// Option 2: Using var_dump (Provides more detail like data types)
var_dump($_SESSION);
?&gt;



Why use &lt;pre&gt;?
When using print_r() or var_dump(), wrapping the code in HTML &lt;pre&gt; (preformatted text) tags is a “pro-tip.” It forces the browser to display the array with proper indentation and line breaks, making it much easier for you to read than a single long line of text.
Common Session Commands Summary



Purpose
Command




Start/Resume
session_start();


Show All Values
print_r($_SESSION);


Check if a variable exists
isset($_SESSION['key']);


Clear all values
session_unset();



Would you like me to show you how to loop through the session variables using a foreach loop if you want to format the output as a list?
]]></description><link>https://community.secnto.com//topic/337/cs310-quiz-2-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/337/cs310-quiz-2-solution-and-discussion</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[CS310 Assignment No. 03  Solution and Discussion]]></title><description><![CDATA[Ideas Solution
[image: 1564644957221-384b637f-d1b2-48b8-ade7-64dcae490f6f-image.png]
]]></description><link>https://community.secnto.com//topic/251/cs310-assignment-no-03-solution-and-discussion</link><guid isPermaLink="true">https://community.secnto.com//topic/251/cs310-assignment-no-03-solution-and-discussion</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>