Jump to content

hcdarkmage

Members
  • Posts

    326
  • Joined

  • Last visited

Everything posted by hcdarkmage

  1. you forgot to close your style tags: if($value == $index1) { echo '<table border="0" width="70%" align="center">'; echo '<tr>'; echo '<td width="2%"><font color="FFFF1A"><u><i>'.$index.'</i></u></font></td>'; //<--- Here echo '<td width="33%"><font color="FFFF1A"><u><i>'.$artist.'</i></u></font></td>'; //<--- Here echo '<td width="33%"><font color="FFFF1A"><u><i>'.$title.'</i></u></font></td>'; //<--- Here echo '<td width="32%"><font color="FFFF1A"><u><i>'.$album.'</i></u></font></td>'; //<--- And Here echo '</tr>'; echo '<tr>'; echo '<td colspan="4"><hr></td>'; echo '</tr>'; echo '</table>';
  2. I think it may be that you are not defining the $pc before you call it: foreach($hmm1->$pc as $inde) { $pc = 'player-command'; $index1 = $inde->value; You may want to try this: $pc = 'player-command'; foreach($hmm1->$pc as $inde) { $index1 = $inde->value; or foreach($hmm1->player-command as $inde) { $index1 = $inde->value;
  3. Well, you forgot a couple of things in your code: foreach($hmm->player-command as $inde) { $pc = 'player-command'; //<--- Forgot the semicolon $index1 = $inde->value; echo "This is Index1: ".$index1; //<--- Do not need the extra ' ' $hmm = simplexml_load_file('http://www.durhamit.ca:8181/1.0/?method=player.getPlayQueue');
  4. To check if you got $index1 properly you could do something like: echo "This is Index1: ".$index1; anywhere after it has been defined. Plus you are not using the ==: $hmm = simplexml_load_file('http://www.durhamit.ca:8181/1.0/?method=player.getActiveIndex'); foreach($hmm->player-command as $inde) { $pc = 'player-command' $index1 = $inde->value; echo "This is Index1: ".$index1; //<--- Added for error checking $hmm = simplexml_load_file('http://www.durhamit.ca:8181/1.0/?method=player.getPlayQueue'); foreach($hmm->tracks->track as $tracks) { $artist = $tracks->artist; $title = $tracks->title; $album = $tracks->album; $index = $tracks->index; $id = $tracks->id; //If we submitted the form if($value = $index1) //<--- Here. Should be '==' not '='
  5. You where close: if($artist == "eminem"){ //Do code stuffs } else { //Do other stuffs }
  6. if ($_POST['pass'] && ($_POST['pass']==$ama[code1]||$_POST['pass']==$ama[code2]))
  7. Sorry, mgallforever, still half dead. Long day at work and I wasn't paying attention very well. As for the problem at hand you may want to put your if ($username==$dbusername&&$password==$dbpassword) statement into the if ($username&&$password) statement: //setting the first variables $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { // connecting $connect = mysql_connect("localhost","root","") or die ("couldn't connect"); mysql_select_db("phplogin") or die ("no sign of db"); $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); $row = mysql_fetch_assoc($query); $dbusername = $row['username']; $dbpassword = $row['password']; // check to see if they match! if ($username==$dbusername&&$password==$dbpassword) echo "logged in! <a href='member.php'>Click</a> view your live feed"; else echo "Login failed, check username and password"; }
  8. Son of monkey biscuits . . . I am having the hardest time figuring this out . . . I thought the last code would work. You would think that a simple if-else statement would solve your problem. You may want to check if $form->error is being set by throwing some test text in the if statement and checking to see if it shows up. something like: if(isset($form->error)){ echo "This is test 1.<br />"; if(($form->error = ("pass")) && !($form->error = ("user"))){ echo "This is test 2.<br />"; echo $form->error("pass"); } else { echo "This is test 3.<br />"; echo $form->error("user"); } } Just to see where it is failing, or if it is hitting those statements at all.
  9. $row = mysql_fetch_assoc($query); $dbusername = $row['username']; $dbpassword = $row['password']; should be: while($row = mysql_fetch_assoc($query)){; $dbusername = $row['username']; $dbpassword = $row['password']; }
  10. Okay let's try a new tactic: if(isset($form->error)){ if(($form->error = ("pass")) && !($form->error = ("user"))){ echo $form->error("pass"); } else { echo $form->error("user"); } }
  11. Cheaters cop out: if(isset($form->error)){ echo "There was a problem with your login. Username/Password incorrect."; } But that probably doesn't help.
  12. Could you post the code where $form->error is getting set? The code I posted is looking for matches that may not be there.
  13. I see it now . . . long day here too, lol. if(isset($form->error)){ if($form->error == ("pass") && $form->error != ("user")){ //<--- Missed a ) echo $form->error("pass"); } else { echo $form->error("user"); } }
  14. Try this: if(isset($form->error)){ if($form->error == ("pass") && $form->error != ("user"){ echo $form->error("pass"); } else { echo $form->error("user"); } }
  15. If you look in your code for that line, it is already in there. All you have to do is change the number from 1 to 0. var ShowArrow=1; // Uses arrow gifs when 1 should be var ShowArrow=0; // Uses arrow gifs when 1
  16. actually it can be turned off with the line right here: var ShowArrow=1; // Uses arrow gifs when 1 <--- Set to 0
  17. Have you taken a look at the YouTube APIs yet? http://code.google.com/apis/youtube/getting_started.html#player_apis
  18. Sometimes it takes a second eye to check your work. Thanks for that. I would have spent hours looking for the wrong issue.
  19. Okay, this is a very odd problem. I had this code working for a total of 30 seconds and then it wouldn't work anymore. All I added was some header-location script, but even with that commented out, the code doesn't work anymore. Maybe a little help, please? session_start(); include_once("/home/www-data/landing_pages/configtest.php"); $title="Voucher Blitz"; foreach ($_POST as $key => $value){ $$key = $value; } $errors = false; echo "Default: ".$errors."<br />"; //testing code echo $submit."<br />Blah blah blah!"; //testing code if(isset($submit)){ //Validation Checks echo "<br />First: ".$first_name; //testing code if($first_name == ""){ $errors = true; $disError = "You must enter your first name!<br />"; } echo "<br />Last: ".$last_name; //testing code if($last_name == ""){ $errors = true; $disError .= "You must enter your last name!<br />"; } echo "<br />Email: ".$email; //testing code if($email == ""){ $errors = true; $disError .= "You must enter your email!<br />"; } echo "<br />Errors: ".$errors; //testing code echo "<br />".$disError; //testing code if($errors = false){ //<----- Wasn't going in here echo "This should be working!"; //testing code //enter info into table //header("Location: http://whereitshouldgo.yes"); //exit(); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $title?></title> <style> .leftbar { float:left; background: url('<?php echo $basePath?>img/edge.jpg'); width: 5px; height: 31px; } </style> <link rel="icon" href="<?php echo $basePath?>img/logosmall.png" type="image/png"> <link href="<?php echo $basePath?>css/style.css" rel="stylesheet" type="text/css" /> <script src="<?php echo $basePath?>js/jQuery.js"></script> <script src="<?php echo $basePath?>js/jquery.corners.min.js"></script> <script src="<?php echo $basePath?>js/main.js"></script> </head> <body> <center> <div id="mainCont"> <div id="top" class="rounded"> <div id="header"><a href="http://voucherblitz.biz"><img src="<?php echo $basePath ?>img/header_1a.jpg" border="0" alt="Voucher Blitz" /></a></div> <div class="leftbar"></div> <div id="nav" class="fLeft"> <ul> <li><a href="http://voucherblitz.biz/index.php">Home</a></li><li><a href="http://voucherblitz.biz/pages/contact.php">Contact</a></li> <li><a href="http://www.memberweb.com/memberweb/NewLogin.asp?groupID=2150">Login</a></li> </ul> </div> <div id="rightMenu" class="fLeft"><img src="<?php echo $basePath ?>img/header_2.jpg" border="0" alt="Voucher Blitz"/></div> <div class="clear"> </div> </div> <div class="space"></div> <div id="main" class="rounded"> <div class="clear"></div> <div id="leftBox" class="fLeft rounded"> <center> <form action="" method="POST" id="demo" name="demo"> <?php if($errors == true){?> //<---- This stopped showing up when there are errors! <div class="box rounded"> <table width="260px" class="info"> <tr> <td><h3 style="color: #ff0000; text-align: center;">Errors</h3></td> </tr> <tr> <td><font style="color: #ff0000;"><?php echo $disError; ?></font></td> </tr> </table> </div> <?php }?> <div class="box rounded"> <table width="260px" class="info"> <tr> <td><center>* Please fill out all the information to proceed to the demo.</center></td> </tr> </table> </div> <div class="box rounded"> <table width="260px" class="info"> <tr> <td colspan="2"><h3 style="color: #4b678b; text-align: center;">Personal Information</h3></td> </tr> <tr> <td><strong>First Name *</strong></td> <td><input type="text" value="<?php echo $first_name ?>" id="first_name" name="first_name" /></td> </tr> <tr> <td><strong>Last Name *</strong></td> <td><input type="text" value="<?php echo $last_name ?>" id="last_name" name="last_name" /></td> </tr> <tr> <td><strong>Email *</strong></td> <td><input type="text" value="<?php echo $email ?>" id="email" name="email" /></td> </tr> </table> </div> <div class="box rounded"> <table width="260px" class="info"> <tr> <td><input style="height: 30px; width: 250px;" id="submit" type="submit" action="Submit" value="Go To Demo" name="submit" /></td> </tr> </table> </div> </form> </center> </div> <div class="clear"> </div> </div><!--end mainCont--> <div class="space"></div> <center> <div id="footer" class="rounded">© 2009 Voucher Blitz :: <a href="http://voucherblitz.biz/pages/contact.php">Contact Us </a>::</div> </center> </div> </center> </body> </html>
  20. I usually say, "If it works, don't complain." That way you don't over complicate things . There may be a better way to write the code, but if it works then go with it.
  21. Just a quick question: The time frame"thing" you are trying to add. Are the variables from a dropdown box, checklist or radio list? It might help if I/we had a visual of the form that you are working with. More code is better then less.
  22. Actually, i do believe that Alex's code is sound logic. Did you even try it? If you look at the code it states that if there is something in the $Tel variable, then add it to the body. An expanded look could be: if ($name != "") { $Body = "Name: ".$name; } if($Tel != "") { $Body .= "<br />Phone: ".$Tel; } if($email != "") { $Body .= "<br />Email: ".$email; } echo $Body; If done properly, then if any field is blank it wouldn't even bother with showing the line: No Name Phone: 123-456-7890 Email: yes@test.com No Phone Name: Joe Test Email: yes@test.com No Email Name: Joe Test Phone: 123-456-7890
  23. Simple enough . . . maybe. $uName = $_GET['username']; //<--- Set the get to a variable $result = mysql_query("SELECT * FROM forum WHERE UserName='".$uname."'"); //<--- Insert variable where needed EDIT: Or what Pikachu beat me to say.
  24. Your missing a beginning {: if(mysql_num_rows($result) == 1) { //<--- Here
×
×
  • 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.