Jump to content

hcdarkmage

Members
  • Posts

    326
  • Joined

  • Last visited

Posts 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. 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";
    
    }
    

  6. 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.

  7.  $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'];
    }
    

  8. 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>

  9. 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

  10. Please refer to code below, I came up with following code but cannot find a way to get username from address bar http://mydomain.com/flash/test.php?username=picaso99& using

    echo $_GET["username "];
    

    instead of the red highlighted content

    $result = mysql_query("SELECT * FROM forum
    WHERE UserName=' How to get username from browser address to here'");
    
    
    <?php
    echo "<script type='text/javascript' src='swfobject.js'></script>";
    echo "<div id='player'>This text will be replaced</div>";
    echo "<script type='text/javascript'>";
    echo "var so = new SWFObject('player.swf','mpl','480','360','9');";
    echo "so.addParam('allowfullscreen','true');";
    echo "so.addParam('allowscriptaccess','always');";
    echo "so.addParam('wmode','opaque');";
    echo "so.addVariable('plugins','livestream-1');";
    echo "so.addParam('flashvars','&file=";
    echo $_GET["channelname"];
    echo ".flv&streamer=";
    $con = mysql_connect("localhost","database","password");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("forum", $con);
    
    $result = mysql_query("SELECT * FROM forum
    WHERE UserName=' How to get username from browser address to here'");
    
    while($row = mysql_fetch_array($result))
      {
      echo $row['FirstName'];
      }
    echo "&stretching=exactfit&logo.file=logo.png&logo.hide=false&logo.position=top-left&logo.link=http://www.mydomain.com&autostart=true');";
    echo "so.write('player');";
    echo "</script>";
    ?>
    

     

    Whole point of geting first name from MySQL database so when i delete the user, there is nothing to display as firstname so the flash file dont work

     

    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.

×
×
  • 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.