Jump to content

jbwebdesign

Member
  • Posts

    167
  • Joined

  • Last visited

Everything posted by jbwebdesign

  1. Hello, I am working on creating an angular js directive for using HTML5 Canvas My goal is to output a canvas and use Font Awesome icons for writing inside of the canvas. My code is the following, however the problem i have is that the font awesome icons don't seem to render: angular.module('myApp') .directive('customButtonCanvas', ['$document', function($document) { return { restrict: 'A', scope: { width : '=', height : '=', options : '=' }, link: function(scope, element){ console.log(scope); console.log(element); //first lets get the canvas element from our template.... var ctx = element[0].getContext('2d'); ctx.font = "40px FontAwesome"; ctx.fillText("\uf000", 120, 120); console.log(ctx); } }; }]); any help with this will be greatly appreciated. thanks!
  2. Hello guys, i am trying to create an api request but the problem i have is that the code is not written in PHP. they only have Ruby and Python samples. can someone please help me so that i can create a request to the api with PHP. import hashlib import hmac import urllib2 import time API_KEY = 'YOUR-API-KEY' API_SECRET = 'YOUR-API-SECRET' def get_http(url, body=None): opener = urllib2.build_opener() nonce = int(time.time() * 1e6) message = str(nonce) + url + ('' if body is None else body) signature = hmac.new(API_SECRET, message, hashlib.sha256).hexdigest() opener.addheaders = [('ACCESS_KEY', API_KEY), ('ACCESS_SIGNATURE', signature), ('ACCESS_NONCE', nonce)] try: return opener.open(urllib2.Request(url, body)) except urllib2.HTTPError as e: print e return e print get_http('https://thewebsite.com/api/v1/account/').read()
  3. Hello, i have been researching some real time functionality and i would like to create a realtime website. something that can function similar to an auction. for this, i would like to use web sockets but i can't figure out how to use web sockets with php. can anyone help me? i have some code below..... server.php #!/php -q <?php /* >php -q server.php */ error_reporting(E_ALL); set_time_limit(0); ob_implicit_flush(); $master = WebSocket("localhost", 8752); $sockets = array($master); $users = array(); $debug = false; while(true){ $changed = $sockets; socket_select($changed,$write=NULL,$except=NULL,NULL); foreach($changed as $socket){ if($socket==$master){ $client=socket_accept($master); if($client<0){ console("socket_accept() failed"); continue; } else{ connect($client); } } else{ $bytes = @socket_recv($socket,$buffer,2048,0); if($bytes==0){ disconnect($socket); } else{ $user = getuserbysocket($socket); if(!$user->handshake){ dohandshake($user,$buffer); } else{ process($user,$buffer); } } } } } //--------------------------------------------------------------- function process($user,$msg){ $action = unwrap($msg); say("< ".$action); switch($action){ case "hello" : send($user->socket,"hello human"); break; case "hi" : send($user->socket,"zup human"); break; case "name" : send($user->socket,"my name is Multivac, silly I know"); break; case "age" : send($user->socket,"I am older than time itself"); break; case "date" : send($user->socket,"today is ".date("Y.m.d")); break; case "time" : send($user->socket,"server time is ".date("H:i:s")); break; case "thanks": send($user->socket,"you're welcome"); break; case "bye" : send($user->socket,"bye"); break; default : send($user->socket,$action." not understood"); break; } } function send($client,$msg){ say("> ".$msg); $msg = wrap($msg); socket_write($client,$msg,strlen($msg)); } function WebSocket($address,$port){ $master=socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("socket_create() failed"); socket_set_option($master, SOL_SOCKET, SO_REUSEADDR, 1) or die("socket_option() failed"); socket_bind($master, $address, $port) or die("socket_bind() failed"); socket_listen($master,20) or die("socket_listen() failed"); echo "Server Started : ".date('Y-m-d H:i:s')."\n"; echo "Master socket : ".$master."\n"; echo "Listening on : ".$address." port ".$port."\n\n"; return $master; } function connect($socket){ global $sockets,$users; $user = new User(); $user->id = uniqid(); $user->socket = $socket; array_push($users,$user); array_push($sockets,$socket); console($socket." CONNECTED!"); } function disconnect($socket){ global $sockets,$users; $found=null; $n=count($users); for($i=0;$i<$n;$i++){ if($users[$i]->socket==$socket){ $found=$i; break; } } if(!is_null($found)){ array_splice($users,$found,1); } $index = array_search($socket,$sockets); socket_close($socket); console($socket." DISCONNECTED!"); if($index>=0){ array_splice($sockets,$index,1); } } function dohandshake($user,$buffer){ console("\nRequesting handshake..."); console($buffer); list($resource,$host,$origin,$strkey1,$strkey2,$data) = getheaders($buffer); console("Handshaking..."); $pattern = '/[^\d]*/'; $replacement = ''; $numkey1 = preg_replace($pattern, $replacement, $strkey1); $numkey2 = preg_replace($pattern, $replacement, $strkey2); $pattern = '/[^ ]*/'; $replacement = ''; $spaces1 = strlen(preg_replace($pattern, $replacement, $strkey1)); $spaces2 = strlen(preg_replace($pattern, $replacement, $strkey2)); if ($spaces1 == 0 || $spaces2 == 0 || $numkey1 % $spaces1 != 0 || $numkey2 % $spaces2 != 0) { socket_close($user->socket); console('failed'); return false; } $ctx = hash_init('md5'); hash_update($ctx, pack("N", $numkey1/$spaces1)); hash_update($ctx, pack("N", $numkey2/$spaces2)); hash_update($ctx, $data); $hash_data = hash_final($ctx,true); $upgrade = "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" . "Upgrade: WebSocket\r\n" . "Connection: Upgrade\r\n" . "Sec-WebSocket-Origin: " . $origin . "\r\n" . "Sec-WebSocket-Location: ws://" . $host . $resource . "\r\n" . "\r\n" . $hash_data; socket_write($user->socket,$upgrade.chr(0),strlen($upgrade.chr(0))); $user->handshake=true; console($upgrade); console("Done handshaking..."); return true; } function getheaders($req){ $r=$h=$o=null; if(preg_match("/GET (.*) HTTP/" ,$req,$match)){ $r=$match[1]; } if(preg_match("/Host: (.*)\r\n/" ,$req,$match)){ $h=$match[1]; } if(preg_match("/Origin: (.*)\r\n/",$req,$match)){ $o=$match[1]; } if(preg_match("/Sec-WebSocket-Key2: (.*)\r\n/",$req,$match)){ $key2=$match[1]; } if(preg_match("/Sec-WebSocket-Key1: (.*)\r\n/",$req,$match)){ $key1=$match[1]; } if(preg_match("/\r\n(.*?)\$/",$req,$match)){ $data=$match[1]; } return array($r,$h,$o,$key1,$key2,$data); } function getuserbysocket($socket){ global $users; $found=null; foreach($users as $user){ if($user->socket==$socket){ $found=$user; break; } } return $found; } function say($msg=""){ echo $msg."\n"; } function wrap($msg=""){ return chr(0).$msg.chr(255); } function unwrap($msg=""){ return substr($msg,1,strlen($msg)-2); } function console($msg=""){ global $debug; if($debug){ echo $msg."\n"; } } class User{ var $id; var $socket; var $handshake; } ?> and client.php <html> <head> <title>WebSocket</title> <style> html,body{font:normal 0.9em arial,helvetica;} #log {width:440px; height:200px; border:1px solid #7F9DB9; overflow:auto;} #msg {width:330px;} </style> <script> var socket; function init(){ var host = "ws://localhost:8752/websocket/server.php"; try{ socket = new WebSocket(host); log('WebSocket - status '+socket.readyState); socket.onopen = function(msg){ log("Welcome - status "+this.readyState); }; socket.onmessage = function(msg){ log("Received: "+msg.data); }; socket.onclose = function(msg){ log("Disconnected - status "+this.readyState); }; } catch(ex){ log(ex); } $("msg").focus(); } function send(){ var txt,msg; txt = $("msg"); msg = txt.value; if(!msg){ alert("Message can not be empty"); return; } txt.value=""; txt.focus(); try{ socket.send(msg); log('Sent: '+msg); } catch(ex){ log(ex); } } function quit(){ log("Goodbye!"); socket.close(); socket=null; } // Utilities function $(id){ return document.getElementById(id); } function log(msg){ $("log").innerHTML+="<br>"+msg; } function onkey(event){ if(event.keyCode==13){ send(); } } </script> </head> <body onload="init()"> <h3>WebSocket v2.00</h3> <div id="log"></div> <input id="msg" type="textbox" onkeypress="onkey(event)"/> <button onclick="send()">Send</button> <button onclick="quit()">Quit</button> <div>Commands: hello, hi, name, age, date, time, thanks, bye</div> </body> </html> the problem i have is..... when i use server.php from shell, it seems to return the following: Server Started : 2013-07-08 09:58:50 Master socket : Resource id #4 Listening on : localhost port 8752 However, when i try to use it on the Client side, it doesn't connect at all. can someone please help me to figure out what i am doing wrong? any suggestion will be appreciated.
  4. I've just looked into some realtime stuff and it looks like Websockets can be good for what i am looking to do. does anyone know weather websockets is the best way for me to go?
  5. Try to use the foreach loop for the entire table....for example: <?php foreach($rotadetails as $rotadetail): ?> <table align="center" border=0 cellspacing=0 cellpadding=0 width=633> <tr> <td colspan=7 valign=top style="height:4px; "></td> </tr> <tr align="center"> <td width="70" rowspan="2">Week <?php echo $i; ?></td> <td width="80" colspan=1 bgcolor="#DBE5F1">Breakfast</td> <td width="80" colspan=1 bgcolor="#DBE5F1">Lunch</td> <td width="80" colspan=1 bgcolor="#DBE5F1">Dinner</td> <td width="80" colspan=1 bgcolor="#DBE5F1">Bed</td> <td width="120" colspan=2 bgcolor="#DBE5F1">Extra Time</td> </tr> <tr align="center" bgcolor="#DBE5F1"> <td width="80" colspan=1>08:00-09:00</td> <td width="80" colspan=1>13:30-14:30</td> <td width="80" colspan=1>17:00-18:00</td> <td width="80" colspan=1>22:00-23:00</td> <td width="120" colspan=1>Start</td> <td width="60">Duration</td> </tr> <tr> <td colspan=1><?php echo date("l",$rotadetail['pa_rotaDate']); ?></td> <td colspan=1><?php echo $rotadetail['pa_hrs0800']; ?></td> <td colspan=1><?php echo $rotadetail['pa_hrs1300']; ?></td> <td colspan=1><?php echo $rotadetail['pa_hrs1700']; ?></td> <td colspan=1 bgcolor="#DBE5F1"><?php echo $rotadetail['pa_hrs2200']; ?></td> <td ><?php echo $rotadetail['pa_rotaETime']; ?></td> <td><?php echo $rotadetail['pa_rotaETimeDur']; ?></td> </tr> <tr> <td colspan=7 valign=top style="height:4px; "></td> </tr> <tr> <td colspan=1 align="right" valign=top>TOTAL </td> <td colspan=1><?php echo $bttot1; ?></td> <td colspan=1><?php echo $lttot1; ?></td> <td colspan=1><?php echo $tttot1; ?></td> <td colspan=1 bgcolor="#DBE5F1"><?php echo $nttot1; ?></td> <td colspan=2><?php echo $ettot1; ?></td> </tr> </table> <?php endforeach; ?>
  6. well what i am trying to do is take the TABLE and convert it into a php array so that i can insert it into a MySQL database.
  7. hello everyone, i am working on a script and i want to do the following i have a table that looks like this... <table> <tr> <td>Tuesday</td> <td>12/31</td> <td>New Years Eve</td> <td>Test</td> <td>Apples</td> <td>Oranges</td> <td>Bananas</td> </tr> <tr> <td>Monday</td> <td>12/30</td> <td>New Years Eve EVE</td> <td>Test</td> <td>Apples</td> <td>Oranges</td> <td>Bananas</td> </tr> <tr> <td>Sunday</td> <td>12/29</td> <td>New Years Eve Eve EVE</td> <td>Test</td> <td>Apples</td> <td>Oranges</td> <td>Bananas</td> </tr> </table> I want to convert EACH TR into a PHP ARRAY I want the code to look something like this and it does in the console, however i need to output all of it into a string: <?php array( "data" => 0, array( "Tuesday", "12/31", "New Years Eve", "Test", "Apples", "Oranges", "Bananas" ), "data" => 1, array( "Monday", "12/30", "New Years Eve EVE", "Test", "Apples", "Oranges", "Bananas" ), "data" => 2, array( "Sunday", "12/29", "New Years Eve Eve EVE", "Test", "Apples", "Oranges", "Bananas" ), ); ?> My Current Javascript code is as follows: var count = 0; $("#output").find('tr').each(function(){ count++ var array_str = 'array(' + '"data" => "' + count + '", array('; console.log(array_str); $(this).find('td').each(function(value){ var str = '"'+ value +'" => "'+$(this).text()+'",'; //this makes the php array keys //var str = Array(value); console.log(str); }); console.log("));"); }); Can anyone please help me to output the entire console code that gets returned into a string or into a DIV. thanks
  8. Hello everyone, I am working on a website and i am using AJAX. I am sending requests to the server constantly to have a "LIVE" FEED. I am sending an ajax request to the server to reload a table constantly and another one to reload a different piece of data constantly etc. is there anything bad with doing this? will this run slow if i start to have more traffic?
  9. Hello everyone, i am working on a website that uses facebook api to login with facebook. However i am having a problem with the Javascript and PHP sdk. The problem is that i keep getting an unexpected error which basically expires the facebook Auth Token and then it logs the user out of the website then logs them back in. The code that i am using is below.... <?php require 'facebook.php'; $facebook = new Facebook(array( 'appId' => 'MY_APP_ID_HERE', 'secret' => 'MY_APP_SECRET', 'cookie' => true )); // See if there is a user from a cookie $user = $facebook->getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>'; $user = null; } } ?> <!DOCTYPE html> <html xmlns:fb="http://www.facebook.com/2008/fbml"> <body> <?php if ($user) { ?> Your user profile is <pre> <?php print htmlspecialchars(print_r($user_profile, true)) ?> </pre> <?php } else { ?> <fb:login-button></fb:login-button> <?php } ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId: '<?php echo $facebook->getAppID() ?>', cookie: true, xfbml: true, oauth: true }); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); }); FB.Event.subscribe('auth.logout', function(response) { window.location.reload(); }); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script> </body> </html> The error that i get when the user logs out is this: [error] => Array ( [message] => An active access token must be used to query information about the current user. [type] => OAuthException [code] => 2500 ) Can someone please tell me if i am doing something wrong? How can i get the session to NOT expire so fast?
  10. Hello everyone, I have been thinking of making a casino (poker) game for iOS/Android/Website/facebook etc. Basically i want a clone of Zynga Poker app for iphone. The problem is that i'm not sure where to start. Does anyone have any suggestions on where i could start to make an app exactly like Zynga Poker?? I don't have much knowledge about Servers or Application Security. Also, if i need to hire a team to make this work, what type of job positions would be needed?
  11. yes there is khanahk but sometimes when you have a Large database to import, that will not work because of php's limitations. so the best solution for that is to run a LOAD DATA query on the SQL.
  12. For anyone who is trying to do something similar to what i have to do which is to LOAD a large database onto phpmyadmin..... here is what i did to solve my issue..... 1.) Login to cPanel and white list your ip address. ( go to the mysql remote access and enter your ip address) 2.) Download a program called MySQL Work Bench 3.) Connect to MySQL Workbench using the ip address that shows on on the left side of your cPanel (in my case it's a shared ip address because i am on a shared hosting account) 4.) After you have connected, create a table with the same fields that appear in your Large database file. (in my case it is a .csv file) 5.) use a similar query like the one below (i am on my mac, the path should be your own computer's path): in the example below, i am using the table name "targets" and the fields in my table are State,NPANXX,LATA,ZipCode,ZipCodeCount,ZipCodeFreq,NPA,NXX LOAD DATA LOCAL INFILE '/Users/mycomputername/Downloads/2012-8-StandardAreaCodeDatabase-csv/2012-8-StandardAreaCodeDatabase.csv' INTO TABLE targets FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (State,NPANXX,LATA,ZipCode,ZipCodeCount,ZipCodeFreq,NPA,NXX); I hope i was able to help anyone else who had the same problem as me
  13. hello, i am trying to load a large CSV file in the database and it's not working can someone please tell me what i'm doing wrong?? here is my query for the SQL LOAD DATA LOCAL INFILE '/tmp/2012-8-StandardAreaCodeDatabase.csv' INTO TABLE targets FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (State,NPANXX,LATA,ZipCode,ZipCodeCount,ZipCodeFreq,NPA,NXX); but i get the following error: #2 - File 'tmp/2012-8-StandardAreaCodeDatabase.csv' not found (Errcode: 2)
  14. i have no idea what the problem was..... but i found a way around it. by the way, i think the switch case statement is working correctly. i am trying to say that if the $_SERVER['HTTP_USER_AGENT'] contains any of the following: ipad, iphone, android, ipod, webos then return is mobile. so that i can re-direct the user to a mobile compatible website. Thanks for your help
  15. Hello, i am trying to understand why this is happening to me..... can someone please explain why when i use a boolean inside of a function, it echo's out the number 1 instead of returning it? I am doing this on a Wordpress website inside of the index.php file at the first line. when it redirects the user, the number 1 appears at the very top of the page. here is my code for trying to use it: <?php if($tm->mobile_check()){ header("Location: http://m.mywebsite.com/"); } ?> here is my code for the function: <?php function mobile_check() /* THIS FUNCTION IS FOR MOBILE WEBSITE USE */ { $iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); $iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad"); $Android= stripos($_SERVER['HTTP_USER_AGENT'],"android"); $webOS= stripos($_SERVER['HTTP_USER_AGENT'],"webOS"); $mobile = FALSE; switch($mobile) { case $iPod: case $iPhone: case $iPad: case $Android: case $webOS: $mobile = TRUE; break; } } ?>
  16. Hello, I have been trying to figure out How to calculate the amount of HOURS remaining between 2 datetime fields in MySQL. Can someone please help me ..... I am trying to do something like this: <?php $datetime1 = "2012-08-06 08:46:00"; //this is the later date $datetime2 = "2012-08-05 08:45:00"; //this is the earlier date //I want to return the difference between $datetime1 and $datetime2 in HOURS, MIN, and SECONDS remaining. ?>
  17. Hello, I have a question..... I am working on a script that requires PayPal IPN..... I am trying to code up a subscription based website and for some reason when i test the IPN in the Sandbox Test Site under "Test Tools" for IPN, the script doesn't seem to work if it's in the VERIFIED section. The Script only works when i have the Data above the following lines instead of inside of the "VERIFIED"..... Does this mean that my script would be coded incorrectly? Shouldn't the script be working inside of the code below instead of outside? <?php if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation } ?> Here is the entire IPN script.... <?php // read the post from PayPal system and add 'cmd' $req = 'cmd=' . urlencode('_notify-validate'); foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.paypal.com/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.paypal.com')); $res = curl_exec($ch); curl_close($ch); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $txn_type = $_POST['txn_type']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; //-------Lets Begin Here.............. //item name will be the Authorization Mobile Number //item number will be the Rep ID /* $_POST['subscr_date'] = Transaction-specific Start date or cancellation date depending on whether transaction is "subscr_signup" or "subscr_cancel"*/ /* "subscr_signup" This Instant Payment Notification is for a subscription sign-up. "subscr_cancel" This Instant Payment Notification is for a subscription cancellation. "subscr_modify" This Instant Payment Notification is for a subscription modification. "subscr_failed" This Instant Payment Notification is for a subscription payment failure. "subscr_payment" This Instant Payment Notification is for a subscription payment. "subscr_eot" This Instant Payment Notification is for a subscription's end of term. */ switch($txn_type) { case 'subscr_signup': //New Subscription.... //lets connect to the database and activate the mobile line //this is a test below mail("info@affordablewebdev.com","Testing IPN","$txn_type","From: info@affordablewebdev.com"); break; case 'subscr_cancel': //Subscription Has Been Canceled //Lets connect to the database and De-Activate the mobile line break; case 'subscr_modify': //----N/A----- break; case 'subscr_failed': //Subscription Payment Failed, Lets Connect to the database and De-Activate the mobile line break; case 'subscr_payment': //Subscription Payment Success.... //Lets Connect to the database and log our payment details for this rep break; case 'subscr_eot': //----N/A----- break; } if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation } ?>
  18. Never mind, i found my problem! it turns out that since i am using Cufon.replace for the (".gridX3") i can't have white spaces in the HTML coding itself. my new code looks like this: <div class="gridX3"><div class="widget"><h2>Jane Doe, ESQ.</h2><h3>Corporate Attorney</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> instead of this: <div class="gridX3"> <div class="widget"> <h2>Jane Doe, ESQ.</h2> <h3>Corporate Attorney</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width -->
  19. Hello everyone, I am working on a website using cufon and i seem to be having a problem with an extra space rendered by cufon. Does anyone know how to fix this? Cufon adds this extra line of code which i don't want: <cufon class="cufon cufon-canvas" alt=" " style="width: 5px; height: 15px; "><canvas width="20" height="19" style="width: 20px; height: 19px; top: -2px; left: -1px; "></canvas><cufontext> </cufontext></cufon> everything else renders properly..... here is my HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Company Name</title> <link href="reset.css" rel="stylesheet" type="text/css" /> <link href="main.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="js/cufon.js" type="text/javascript"></script> <script src="js/Trebuchet_MS_400-Trebuchet_MS_700-Trebuchet_MS_italic_400.font.js" type="text/javascript"></script><script type="text/javascript"> Cufon.replace("#mainnav"); Cufon.replace(".gridX2"); Cufon.replace(".gridX3"); </script> </head> <body> <!--We need this for head wrap --> <div id="headwrap"></div> <div id="container"> <div id="header"> <div class="gridX2"> <div id="logo"> <h2><a href="#">Company Name</a></h2> <h3><a href="#">1234 dummy rd. Suite 201 Dummy NY 10003</a></h3> </div><!--End Logo --> </div><!--End Grid %50 of width --> <div class="gridX2"> <div id="headerUL"> <ul> <li>Phone: (555) 555-<span>LAW1</span> (555) 555-5555</li> <li>Fax: (555) 555-<span>LAW2</span> (555) 555-5555</li> </ul> </div><!--End Header UL --> </div><!--End Grid %50 of width --> <div class="gridFull"> <div id="mainnavheadwrap"></div><!--We need this for nav head wrap--> <div id="mainnav"> <ul> <li><a href="#">HOME</a></li> <li class="active"><a href="#">ABOUT</a></li> <li><a href="#">SERVICES</a></li> <li><a href="#">RESOURCES</a></li> <li><a href="#">CONTACT</a></li> </ul> </div> </div><!--End Grid %100 Full width --> </div><!--End Header --> <div id="primary_content"> <div class="gridFull"> <div class="gridX3"> <div class="widget"> <h2>Terms And Conditions</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> <div class="gridX3 middle"> <div class="widget"> <h2>Contractual Agreements</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> <div class="gridX3"> <div class="widget"> <h2>Raise Capital For Your Entity</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> <div class="gridX3"> <div class="widget"> <h2>Jane Doe, ESQ.</h2> <h3>Corporate Attorney</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> <div class="gridX3 middle"> <div class="widget"> <h2>Jane Doe, ESQ.</h2> <h3>Corporate Attorney</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> <div class="gridX3"> <div class="widget"> <h2>Jane Doe, ESQ.</h2> <h3>Corporate Attorney</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut est lectus, bibendum eu vestibulum nec, vulputate quis sem. Vivamus nunc neque, auctor non ultricies in, gravida tincidunt massa. Duis eu volutpat ipsum. Sed ultricies dictum nulla.</p> <p class="right"><a href="#" class="btn">READ MORE</a></p> <div class="clear"></div><!--End Clear Fix --> </div><!--End Widget --> </div><!--End Grid %33.3 width --> </div><!--End Grid %100 Full Width --> <div class="clear"></div><!--End Clear Fix --> </div><!-- End Primary Content --> <div class="clear"></div><!--End Clear Fix --> </div><!--End Container--> <div id="footer"> <div id="gridwrap"> <div class="gridX2"> <p>COPYRIGHT © 2012 company name. ALL RIGHTS RESERVED</p> <div class="clear"></div><!--End Clear Fix --> </div><!-- End Grid %50 width --> <div class="gridX2"> <div class="right"> <ul> <li><a href="#">HOME</a></li> <li><a href="#">ABOUT</a></li> <li><a href="#">SERVICES</a></li> <li><a href="#">RESOURCES</a></li> <li><a href="#">CONTACT</a></li> </ul> </div> <div class="clear"></div><!--End Clear Fix --> </div><!-- End Grid %50 width --> <div class="clear"></div><!--End Clear Fix --> </div><!--End Grid Wrap--> <div class="clear"></div><!--End Clear Fix --> </div><!-- End Footer --> </body> </html>
  20. hello, i need help with a code that i am trying to work on. It doesn't seem to work for me at all..... i am using JQUERY SLIDE EFFECTS and i can't seem to get this to work how i want it to. Basically i want to get the image to swap back to "bear.gif" when the effect has finished. Here is my code... $(window).load(function() { $('#slider').nivoSlider(); //polar bear menu action $("#logo").toggle(function(){ $("#polarbear a img").attr('src','images/polarbearcub.gif'); $("#menu").show('slide', {direction: 'left'}, 3000); //after animation is complete i want to change polarbear image src back to images/bear.gif $("#polarbear a img").attr('src','images/bear.gif'); },function(){ $("#polarbear a img").attr('src','images/polarbearcub.gif'); $("#menu").hide('slide', {direction: 'left'}, 3000); }); });
  21. jbwebdesign

    REST API

    Thanks, i'll check it out. It would be cool to make a video on using REST
  22. What does your grade_post.php file look like?? What does your database structure look like? i'm not sure if this helps but you can try doing something like here: <?php //first build the query.... $re6 = mysql_query('select username from users where course = "BSIT" and yearlevel = "FOURTH"') or die(mysql_error()); //lets create the html form tag outside of our loop. ?> <form action="grade_post.php" method="post"> <?php while($row = mysql_fetch_array($re6, MYSQL_ASSOC)) { //this is where our loop begins.... //we only want to loop our input fields with the different usernames as values inside them. ?> <input type="text" name="recip[]" value="<?php echo $row['username']; ?>"><br> <?php } ?> <input type="submit" value="Submit Form!"> </form> <?php //the code above should output all your users in a seperate input. (i'm not sure why you would need this done but if that's what you want, then this is how you would do it.) //if you explain a bit more in detail on what you are looking to do then maybe i can help you solve this problem. ?>
  23. jbwebdesign

    REST API

    Hello, I am trying to build my first REST API. I have been looking all around for a video tutorial on how to do this but I can't seem to find any video tutorials. I was just wondering if anyone can tell me where i should start to learn how to do this? Do i need a dedicated server for in order to build my own REST API??
  24. yes, that was the issue that i was having. It was printing to the browser instead of returning the result and allowing me to store it in a variable.
×
×
  • Create New...