New Game: Find the Error.

Okay, this is not so much dolphin code (it's not at all) as it is a very basic little file.  Within this section of code I'm posting is an error and the game is to see who can find the error in the code.  Now, I could easily pull some D files and post those up, but that'd make it to easy as some would literally just go look up the file name.  The goal here is to teach the newer folks coming in how to find an error in the code when the server throws it out.  In the end they become better and stronger coders and will be able to do more and more things. 

So, if you would like to play the game, here is the code and the error is below.


<?
session_start();
$_SESSION['username'] = $_POST['user'];
$_SESSION['userpass'] = $_POST['pass'];
$_SESSION['authuser'] = 0;

//Check username & password information
 if (($_SESSION['username'] == 'Joe') and
  ($_SESSION['userpass'] == '12345')) {
  } else {
  echo "Sorry, but you don't have permission to view this page.  Go away Loser!";
exit();
?>
<html>
<head>
<title>Find my Favorite Movie!</title>
</head>
<body>
<?
 $myfavmovie = urlencode("Life of Brian");
 echo "<a href='moviesite.php?favmovie=$myfavmovie'>";
 echo "Click here to see information about my favorite movie!";
 echo "</a>";
?>
</body>
</html>

 


 

Parse error: syntax error, unexpected $end in /home/xxx/public_html/file1.php on line 27

Yes, this one is pretty simple, but that's the best way to start the game isn't it.  LOL

Quote · 17 Mar 2010

Yes, it has to do with a wiggly thing.  LOL

Can anyone tell where the wiggly thing is missing or extra or in the wrong place?

 

 

Quote · 17 Mar 2010

It seems you've lost your curly. Want it back?

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 17 Mar 2010

I see it, but i thought this test was for newbies, so it would not be fair if i answered it.

https://www.deanbassett.com
Quote · 17 Mar 2010

 

I see it, but i thought this test was for newbies, so it would not be fair if i answered it.

 

 

The game is for the newbies, but us old folks have to play to so they can see some of the stuff.  If you can show them where it's missing and how you found it quickly (meaning, not having to read every single line of code, but using the right tools to help it pop out easier, then go for it.  But it's up to you if you want to say where or not Deano.  I do have more of these games to toss in here.  The next one has lots of issues in it.  Be fun who can make it work first.  LOL

 

**Hint:  Drop the entire code into a good Code Editor like Notepad++ and it will literally pop right out at you. (That hint is for the newbies if they're playing and the curly/wiggly looks like this:  { or } .  We need to know which one is missing and where it goes.

Quote · 17 Mar 2010

MMMMMMMM.. Curly fries.. hehe

Nothing to see here
Quote · 17 Mar 2010

How do you know if your a noob?

Quote · 17 Mar 2010

How do you know if your a noob?

Admitting is the first step.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 17 Mar 2010

Admitting is the first step.

Hmm... them I'm noob and know where the problem i

Quote · 17 Mar 2010

OK.... I got one.

Below is part of the code for a D7 - IPB integration:

<iframe src="/ibp/" frameborder="0" width="100" Height="wtf"></iframe>


The challenge is to enter the code that completes the integration.  I'll enter what I have so far to get you started.


<?php

//enter you're code below this line

Error: the height says "wtf"


Completion: I see what you did there.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 17 Mar 2010

You didn't by chance know I had this come up weeks ago?  lol.

Yes, I do have notepad++  and seriously, it didn't show where the unmatched } was.  I did look for un-matched thingies, spent days looking at php files to look for similar functions and commands to see if I could spot the anomoly.

As soon as I entered it, the matching beginning thingie turned pink and they made a cute matching set.  

       <cue cupid music and send out a match notice! if your cron is running> 

That's why I mailed it to someone who would spot it right away. I started getting that error back on Feb 7th, but finally mailed it to someone for help 5 days ago.  I am going to pull out that way old kevin yank book on building php sites.. if I could find that, I might have been able to spot it myself

This is a great little game.  I don't mind losing to you guys.   

Quote · 18 Mar 2010

BTW, Shouldn't MD's game be "closed" before going to another code...hehe

Nothing to see here
Quote · 18 Mar 2010

 

How do you know if your a noob?

 When you're so used to the old way you're starting over alla time.   I used plain notepad for html and css, til vivvo required an editor that supported UTF-8 and I was saving with 8859-1 blahblah. So moved to notetab pro.  Got used to that, then found it didn't do what I thought it was, so over to notepad++ .   Notepad was so simple.  and clean.  file, edit, save, open, close,  that's how life should be.

All these colors and stuff freak me out. 

It is supposed to make things easier, I know, but it feels like I'm back in the 60's licking a rainbow.

Quote · 18 Mar 2010

BTW, Shouldn't MD's game be "closed" before going to another code...hehe

I propose a new forum: Find the Error

People post in the forums with topics concerning a certain error in a script, with other people expected to attempt to solve the puzzle to win the game. BoonEx will use it's shadow accounts to post code examples from the next release of Dolphin, so that they know where they actually screwed up.

It sounds fun, actually.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 18 Mar 2010

 

OK.... I got one.

Below is part of the code for a D7 - IPB integration:

The challenge is to enter the code that completes the integration.  I'll enter what I have so far to get you started. 

LOL.  Great way to get the mod written by committee.  Can I vote we skip the iframe and just make the ipb skin look like dolphin?

No wait, that'd make for a reall ugly IPB.

Quote · 18 Mar 2010

OK.... I got one.

Below is part of the code for a D7 - IPB integration:

The challenge is to enter the code that completes the integration.  I'll enter what I have so far to get you started.

LOL.  Great way to get the mod written by committee.  Can I vote we skip the iframe and just make the ipb skin look like dolphin?

No wait, that'd make for a reall ugly IPB.

That's only an opinion. I find the current look of Dolphin to be very clean and professional.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 18 Mar 2010

 

 

BTW, Shouldn't MD's game be "closed" before going to another code...hehe

I propose a new forum: Find the Error

 

People post in the forums with topics concerning a certain error in a script, with other people expected to attempt to solve the puzzle to win the game. BoonEx will use it's shadow accounts to post code examples from the next release of Dolphin, so that they know where they actually screwed up.

 

It sounds fun, actually.

 They do that pretty ell over on WebMaster World.   It's actually a good idea. Educational, helps folks in need, and the debates on the best ways to do stuff are pretty entertaiing.  Oht!  we could call it "de-bugging lounge". 

'k, I gotta go now. 

Re Dolphin looking clean and professional...  I'll go with that, was a joke.  It's just that ipb and dolphin look pretty different, they have diff functions, and the forum look of dolphins orca would not fit ipb.

Quote · 18 Mar 2010

Okay, it's time for a new round of "Who Can Find The Error?"  But, this time you not only get to find it, you also get to explain where it is and why it's an error.  Let's stick with the movie theme for the game and go with this little string of code.  It's a full php file with some small editing done to ensure security of course.


 

<?
$link = mysql_connect("localhost", "theserver_movies", "you_wish_Id_give_this_out")
 or die ("Check your server connection.");
 
//Make sure the DB is the Active One
mysql_select_db("theserver_moviesite");
 
$query = "SELECT movie_name, movie_director, movie_leadactor " .
 "FROM movie";
 
$result = mysql_query($query, $link)
 or die (mysql_error());
$num_movies = mysql_num_rows($result);

$movie_header=<<<EOD
 <h2 align="center">Movie Review Database</h2>
 <table width="70%" border="1" cellpadding="2" cellspacing="2" align="center">
 <tr>
  <th>Movie Title</th>
  <th>Movie Director</th>
  <th>Movie Lead Actor</th>
 </tr>
 
EOD;

function get_director() {
 global $movie_director;
 global $director;
 
 $query_d = "SELECT people_fullname " .
      "FROM people " .
      "WHERE people_id='$movie_director'";
 $results_d = mysql_query($query_d)
  or die (mysql_error());
 $row_d = mysql_fetch_array($results_d);
 extract($row_d);
 $director = $people_fullname;
 }
 
function get_leadactor() {
 global $movie_leadactor;
 global $leadactor;
 
 $query_a = "SELECT people_fullname " .
      "FROM people " .
      "WHERE people_id='$movie_leadactor'";
 $results_a = mysql_query($query_a)
  or die (mysql_error());
 $row_a = mysql_fetch_array($results_a);
 extract($row_a);
 $leadactor = $people_fullname;
 }
 
while ($row = mysql_fetch_array($result)) {
 $movie_name = $row['movie_name'];
 $movie_director = $row['movie_diretor'];
 $movie_leadactor = $row['movie_leadactor'];
 
//get director's name from people table
get_director();

//get lead actors name from people table
get_leadactor();

$movie_details .=<<<EOD
<tr>
 <td>$movie_name</td>
 <td>$director</td>
 <td>$leadactor</td>
EOD;
}

$movie_details .=<<<EOD
 <tr>
  <td>Total :$num_movies Movies</td>
 </tr>
EOD;

$movie_footer ="</table>";

$movie =<<<MOVIE
    $movie_header
    $movie_details
    $movie_footer
MOVIE;

 echo "There are $num_movies movies in our database";
 echo $movie;
?>


Notice, this time I have gone so far as to highlight the section with the issue and even the specific line the server is yelling at.  Again, not a Dolphin script here, just a little toy for everyone to play with and help the noobs see how we do it.  This time, let's get the more experienced guys in here and show them how it's done.  And HL, we'll start using your beloved IPB integration if you can win 10 of these games in a row.  LOL... Course that means you gotta beat everyone else.  Keep in mind too guys, not only do you have to identify and explain the issue, but also explain the solution that will work.  We'll test it out at mydatery.com/movietest/table1.php here in about 10 minutes.

 

 

Quote · 22 Mar 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.