domingo, 31 de diciembre de 2017
php printing a date object
<?php
$date=date_create("2013-03-15");
echo date_format($date,"Y/m/d H:i:s");
?>
https://www.w3schools.com/php/func_date_date_format.asp
lunes, 25 de diciembre de 2017
php jquery pagination
https://datatables.net/
http://www.kodingmadesimple.com/2017/12/jquery-datatables-php-mysql-ajax.html?utm_content=buffer1b30d&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer
http://www.kodingmadesimple.com/2017/12/jquery-datatables-php-mysql-ajax.html?utm_content=buffer1b30d&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer
sábado, 23 de diciembre de 2017
php curl example
<?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://www.php.net");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_close ($curl);
print $result;
?>
<?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,"http://localhost/posttest.php"); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Baz=Wombat"); curl_exec ($curl); curl_close ($curl); ?>
http://php.net/manual/en/function.curl-setopt.php
http://www.hackingwithphp.com/15/10/2/your-first-curl-scripts
<?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,"http://localhost/posttest.php"); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Baz=Wombat"); curl_exec ($curl); curl_close ($curl); ?>
http://php.net/manual/en/function.curl-setopt.php
http://www.hackingwithphp.com/15/10/2/your-first-curl-scripts
jueves, 21 de diciembre de 2017
twilio response to sms
<?php
$number = $_POST['From'];
$body = $_POST['Body'];
header('Content-Type: text/xml');
?>
<Response>
<Message>
Hello <?php echo $number ?>.
You said <?php echo $body ?>
</Message>
</Response>
https://www.twilio.com/blog/2016/08/receive-sms-php-twilio.html
$number = $_POST['From'];
$body = $_POST['Body'];
header('Content-Type: text/xml');
?>
<Response>
<Message>
Hello <?php echo $number ?>.
You said <?php echo $body ?>
</Message>
</Response>
https://www.twilio.com/blog/2016/08/receive-sms-php-twilio.html
Setup Twilio Phone Number
Sign up for a free Twilio account if you don’t have one.
Buy a phone number, then click Setup Number. Scroll to the Messaging section and find the line that says “A Message Comes In.”

Fill in the full path to your file (i.e., https://yourserver.com/message.php) and click Save.
Now, send an SMS to your shiny new phone number number and revel in the customized response that comes back your way.
miércoles, 20 de diciembre de 2017
php xml
<!DOCTYPE html>
<html>
<body>
<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML;
$xml=simplexml_load_string($note);
echo $xml->getName() . "<br>";
foreach($xml->children() as $child)
{
echo $child->getName() . ": " . $child . "<br>";
}
?>
</body>
</html>
Tove
Jani
Reminder
Don't forget me this weekend!
------------------------------------------------
<!DOCTYPE html>
<html>
<body>
<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML;
$xml=simplexml_load_string($note);
echo $xml->to . "<br>";
echo $xml->from . "<br>";
echo $xml->heading . "<br>";
echo $xml->body;
?>
</body>
</html>
Tove
Jani
Reminder
Don't forget me this weekend!
https://www.w3schools.com/PhP/func_simplexml_load_string.asp
<html>
<body>
<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML;
$xml=simplexml_load_string($note);
echo $xml->getName() . "<br>";
foreach($xml->children() as $child)
{
echo $child->getName() . ": " . $child . "<br>";
}
?>
</body>
</html>
Tove
Jani
Reminder
Don't forget me this weekend!
------------------------------------------------
<!DOCTYPE html>
<html>
<body>
<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML;
$xml=simplexml_load_string($note);
echo $xml->to . "<br>";
echo $xml->from . "<br>";
echo $xml->heading . "<br>";
echo $xml->body;
?>
</body>
</html>
Tove
Jani
Reminder
Don't forget me this weekend!
https://www.w3schools.com/PhP/func_simplexml_load_string.asp
jueves, 14 de diciembre de 2017
php loading xml into array
<?php
$xmlstring=file_get_contents("http://180.110.13.81/default/en_US/send_sms_status.xml");
$xml = simplexml_load_string($xmlstring);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
print_r($array);
echo " $array[smskey1] $array[status1] $array[error1]";
?>
$xmlstring=file_get_contents("http://180.110.13.81/default/en_US/send_sms_status.xml");
$xml = simplexml_load_string($xmlstring);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
print_r($array);
echo " $array[smskey1] $array[status1] $array[error1]";
?>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<send-sms-status>
<smskey1>697409980</smskey1>
<status1>DONE</status1>
<error1/>
<smskey2/>
<status2/>
<error2/>
<smskey3/>
<status3/>
<error3/>
<smskey4/>
<status4/>
<error4/>
<smskey5/>
<status5/>
<error5/>
<smskey6/>
<status6/>
<error6/>
<smskey7/>
<status7/>
<error7/>
<smskey8/>
<status8/>
<error8/>
</send-sms-status>
php .=
<?php
$rand="18097143489_";
$rand .= rand();
$rand="18097143489_";
$rand .= rand();
echo $rand;
?>
18097143489_1693751741
Suscribirse a:
Entradas (Atom)