This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//connect to the xml and create an xml object from it | |
$session = curl_init('http://www.chinabuye.com/mivec/rss/data/apple.xml'); | |
curl_setopt($session, CURLOPT_RETURNTRANSFER,true); | |
$xml = new SimpleXMLElement(curl_exec($session)); | |
//craete the csv file | |
$apple = "apple.csv"; | |
$handle = fopen($apple, 'a'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//create a PDO object to interface with the database | |
try { | |
$dbh = new PDO('mysql:localhost:3306', 'root', ''); | |
} | |
catch (PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo ' <link href="common/style.css" rel="stylesheet" type="text/css" />'; | |
echo "<body onLoad='document.getElementById('song').select();'>"; | |
//create a PDO object to interface with the database | |
try { | |
$dbh = new PDO('mysql:localhost:3306', 'root', ''); | |
} | |
catch (PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
$dbh->exec("USE isp5;"); | |
$order = 'song'; | |
$sth = $dbh->prepare("SELECT * FROM songs ORDER BY $order"); | |
$sth->execute(); | |
$result = $sth->fetchAll(PDO::FETCH_ASSOC); | |
echo "<form action='' method='POST'>"; | |
echo "<table><tr><th><a href=''>Song</a></th><th><a href=''>Artist</a></th><th><a href=''>Votes</a></th><th></th></tr>"; | |
foreach($result as $r){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo ' <link href="common/style.css" rel="stylesheet" type="text/css" />'; | |
echo "<body onLoad='document.getElementById('song').select();'>"; | |
//create a PDO object to interface with the database | |
try { | |
$dbh = new PDO('mysql:localhost:3306', 'root', ''); | |
} | |
catch (PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo ' <link href="common/style.css" rel="stylesheet" type="text/css" />'; | |
echo "<body onLoad='document.getElementById('song').select();'>"; | |
//create a PDO object to interface with the database | |
try { | |
$dbh = new PDO('mysql:localhost:3306', 'root', ''); | |
} | |
catch (PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$state=array(song=>FALSE, artist=>FALSE, votes=>FALSE); | |
$order = 'song'; | |
if (isset($_GET['order'])){ | |
$order = $_GET['order']; | |
echo $order; | |
echo $state[$order]; | |
$state[$order]=!$state[$order]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$state=array('song'=>'FALSE', 'artist'=>'FALSE', 'votes'=>'FALSE'); | |
$order = 'song'; | |
if (isset($_GET['order'])){ | |
$order = $_GET['order']; | |
echo $state[$order]." "; | |
$state[$order] = ! $state[$order]; | |
echo $state[$order]." "; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('lotto.Class.php'); | |
$handle = new lotto(); | |
$handle->printpick3(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class lotto{ | |
require('File.Class.php'); | |
function init(){ | |
$dbName = lotto; | |
try { |
OlderNewer