Jump to content

rockman

Members
  • Posts

    8
  • Joined

  • Last visited

rockman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I was studying through the CANVAS LMS and looked at a few demonstrations that were at dev cons. The problem is the canvas LMS is built with Ruby I believe so all the demos to connect to the API were using Ruby. Unfortunately the app that I'm working this into is using PHP, so once I develop the module for this part of the app I nned to figure out what the best way to do this is. Will I be able to use Ruby to do in this app as well? It's using something called Kurogo and most of the other modules that call data use PHP. So I'd prefer to use PHP, but I see no good documentation for getting it (CANVAS LMS API) running with PHP. I'm just trying to study up on this for when I'll be building this new part of the app in the summer most likely (or fall) and want to figure out the best course of action or where I can find decent documentation ofr this. Thanks in advance!
  2. I've got some code that displays a feed from a wordpress xml and it does perfectly on my mamp localhost but when I put it on the windows server everthing just falls apart. <?php $curl = curl_init(); curl_setopt_array($curl, Array( CURLOPT_URL => 'http://blog.thisisfusion.com/feed/', CURLOPT_USERAGENT => 'spider', CURLOPT_TIMEOUT => 120, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_ENCODING => 'UTF-8' )); $data = curl_exec($curl); curl_close($curl); $xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA); ?> And the loop portion here: <?php $i = 0; foreach ($xml->channel->item as $item) { $creator = $item->children('dc', TRUE); echo '<h2>' . $item->title . '</h2>'; echo '<small>Posted on '. date('l F d, Y', strtotime($item->pubDate)) .' by '.$creator.'</small> </p>'; echo '<p class="description">' . $item->description . '</p>'; if (++$i > 2) break; } ?> It's having a fit on the server saying that THIS section foreach ($xml->channel->item as $item) is trying to get the property of a nonobject and that it's an invalid argument in foreach. If this was truly the case, why is it working on my localhost? I've tried a lot of different methods and I have no clue what to do anymore. I var_dumped and didn't see anything maybe something in $xml is null and I missed it? But I checked to make sure that wasn't the case. I don't know. I would appreciate some help. Thank you.
  3. Hey all I was wondering what are my options for generating a report? I developed the database and the table in myphpadmin and I was wondering what were the common tools to gernate reports that only pull specific info from the form data? My boss wants reports that also show what images a user uplaods, I'm a bit confused about how to go about doing this since I just started out and am a Junior Dev. I figured report generations were handled through Access and whatever admins have access to the databases. I did try to find some tutorials so I can run through them, but everything I find is suggesting actual management programs and report generating programs. I'll be setting this up over the weekend it looks like. And I would to learn this and grow. Thank you for your time.
  4. On the index.php page I think I had this and I'm on a test server so all I really had was just a location: verify.php <?php session_start(); if(!isset($_SESSION['verifyok'])){ header("location: verify.php"); exit; } ?> So it just checks if there is no set session and redirects if there is not.
  5. For some reson it keeps looping and the redirects are not working, so if I get the verification right it doesn't save the session I just go to index and it attempts to redirect be back to the verification page!
  6. Okay, mabye I will change this then! Also, it seems that when I submit the data it takes me to the verify page again. Then I have to do the form again, then it sends me to the corect site. Not sure what's going on there. <?php session_start(); if(isset($_SESSION['verifyok'])) { header("location: index.php"); } if(isset($_SESSION['verifyfail'])) { header("location: http://www.centurycouncil.org/"); } if($_POST) { $remember = $_REQUEST ['remember']; $day = $_POST ['day']; $month = $_POST ['month']; $year = $_POST ['year']; $country = $_POST ['country']; $birthday = mktime(0,0,0,$month,$day,$year); $difference = time() - $birthday; $age = floor($difference / 31556926); if($age >= 21) { $_SESSION ['verifyok'] = 1; header ("location: index.php"); } else { $_SESSION ['verifyfail'] = 0; header("loaction: http://www.centurycouncil.org/"); } if($remember == 'save') { setcookie("verifyok", 1,mktime(0,0,0,01,01,date("Y")+30)); $_SESSION ['verified'] = 1; header("location: index.php"); exit(0); } } ?>
  7. Thanks kicken, I will keep that in mind for next time, but I just decided to go with if($_POST) for the time being. I still value this because I would have enver known this was the case with type=image otherwise.
  8. Hello everyone! This is my first post here! I was hoping I could get some help! I'm trying to create an age gate form and I'm running into a problem. The index page that I created actually works fine, but when I create the form and set up the php code the form is not interacting with the data beyond the action. I really don't understand what's going on here. I have a verify.php page that has a form on it and the php that should interact with it is at the top like so: <?php session_start(); if(isset($_POST['submit'])) { $remember = $_REQUEST ['remember']; $day = $_POST ['day']; $month = $_POST ['month']; $year = $_POST ['year']; $country = $_POST ['country']; $birthday = mktime(0,0,0,$month,$day,$year); $difference = time() - $birthday; $age = floor($difference / 31556926); echo $age; if($age >= 21) { $_SESSION ['verifyok'] = 1; header ("location: index.php"); } else { $_SESSION ['verifyfail'] = 0; header("loaction: http://www.centurycouncil.org/"); } if($remember == 'save') { setcookie("verifyok", 1,mktime(0,0,0,01,01,date("Y")+30)); $_SESSION['verified'] = 1; header("location: index.php"); exit(0); } } ?> And here I have the form that does not interact with the php and has the action as verify.php, the test server works and the php at the top of my index.php does redirect me to the verify page, but the verify page just isn't working. <form action="verify.php" method="POST"> <span class="heading">ENTER YOUR BIRTH DATE</span> <div id="dob"> <select name="day" class="styled" /> <option selected="selected" disabled="disabled">DD</option> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option> </select> <select name="month" class="styled" /> <option selected="selected" disabled="disabled">MM</option> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> </select> <select name="year" class="styled" /> <option selected="selected" disabled="disabled">YYYY</option> <option>2013</option> <option>2012</option> <option>2011</option> <option>2010</option> <option>2009</option> <option>2008</option> <option>2007</option> <option>2006</option> <option>2005</option> <option>2004</option> <option>2003</option> <option>2002</option> <option>2001</option> <option>2000</option> <option>1999</option> <option>1998</option> <option>1997</option> <option>1996</option> <option>1995</option> <option>1994</option> <option>1993</option> <option>1992</option> <option>1991</option> <option>1990</option> <option>1989</option> <option>1988</option> <option>1987</option> <option>1986</option> <option>1985</option> <option>1984</option> <option>1983</option> <option>1982</option> <option>1981</option> <option>1980</option> <option>1979</option> <option>1978</option> <option>1977</option> <option>1976</option> <option>1975</option> <option>1974</option> <option>1973</option> <option>1972</option> <option>1971</option> <option>1970</option> <option>1969</option> <option>1968</option> <option>1967</option> <option>1966</option> <option>1965</option> <option>1964</option> <option>1963</option> <option>1962</option> <option>1961</option> <option>1960</option> <option>1959</option> <option>1958</option> <option>1957</option> <option>1956</option> <option>1955</option> <option>1954</option> <option>1953</option> <option>1952</option> <option>1951</option> <option>1950</option> </select> </div> <span class="heading" id="heading2">ENTER YOUR LOCATION</span> <div id="location"> <select name="country" class="styled" id="country" /> <option>USA</option> </select> </div> <div id="cookie"> <div id="box"><input type="checkbox" name="remember" value="save" class="styled" /></div><span id="notice"><b>Remember Me</b><br> <i>Do not check this box if you use a shared computer.</i> </span> </div> <div class="clear"></div> <div id="button"> <input id="enter" type="image" name="submit" src="images/enter_inactive.png" WIDTH="117" HEIGHT="44" BORDER="0" ALT="SUBMIT!"> </div> </form> I put a couple of divs inside the form but I don't see how that would really effect the PHP at all, the whole form is still together. I can't even get an echo test to work. I'm completely stumped here. I would greatly appreciate some help! Thanks You!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.