Jump to content

Greaser9780

Members
  • Posts

    326
  • Joined

  • Last visited

    Never

Posts posted by Greaser9780

  1. I am trying to create a series of if statements. If the var is equal to null it should update the db. If it is not equal to null and has a value it should go to the next if statement. I have tried if ($var = 'NULL") and it always lets me write to the db even if there is a greater value there. I have tried if($var == 'NULL') and it never lets me write to the db no matter what value is in the db. I have also tried each of these with = '0' instead of null. Any suggestions?

  2. I have tried dozens of mehtods for this. I run an alert to describe the xmlhttp. In firefox it returns  "object xmlhttprequest" in IE all I get is "object". The odd part is that I get no errors. I checked all of my browser settings and everything is ok. I even updated to IE7 which should show it just as FF but it doesn't. The following is my .js file:

    var xmlHttp
    
    
    function showUser(str)
    { 
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request")
    return
    } 
    alert(xmlHttp);
    var url="showUser.php"
    url=url+"?q="+str
    url=url+"&sid="+Math.random()
    xmlHttp.onreadystatechange=stateChanged 
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
    }
    
    function stateChanged() 
    { 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
    document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
    } 
    }
    
      
    function GetXmlHttpObject()
    {
    var xmlHttp=null;
    try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
    //Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
    return xmlHttp;
    }

     

    This is supposed to bring up another dropdown box with the info from the first one. It only brings up the dropdown box with empty options. IT's like it creates an object but isn't passing all the info. showUser is the function that set the var q. It gets added where it says url="?q="+str  str is the value of the first dropdown. I just can't figure out why this doesn't work in IE but it does everywhere else even netscape. I even have the added number to stop the cache issue.

  3. The problem I can see is that in IE the value of q is not read by the next script. It doesn't make sense to me as to why it won't. I currently get no object type of error. The only error I do get is a small error symbol at the bottom of my browser. A little yellow ! in a triangle. I ran it in firefox. It works and I get no errors in the console other than css errors and that's only due to where the files currently reside. I can't even echo $q in IE so I know the problem is that IE won't get the value. It does however display the next dropbox like it's supposed to. It's just empty because I use $q to pull data with a query.

  4. well if intro has php in it save it as a .php file in the same directory as your index. If it's only html save it as such and place it in the same place. Just make sure that whatever you name it (.php,.html) you include that where you have ?=intro .

  5. You could do this with php but considering all the links on that page you might be better off trying to get a javascript that makes all links active or inactive depending on user status. Why not just send paid members to a different page. If user id matches database include("page2.php") or if userid doesn't match db include("page3.php"); which you could just copy and paste the other page and disable the links. Would probably be faster. Plus you could add another statement as to why they should join.

  6. <form action="#" method="POST">

    <input name="button1"  type="submit"  value="image" src="http://www.newcomedy.net/imgs/button_01.gif" />

    </form>

     

    <form action="#" method="POST">

    <input name="button2" type="submit"  value="image"  src="http://www.newcomedy.net/imgs/button_02.gif" />

    </form>

    <br><br>

     

    <?php

    if(isset($_POST['button1'])){

    echo "Button1 was pressed";

    }else{

            if(isset($_POST['button2']))

      echo "Button2 was pressed";

    }else{

    echo "None of the buttons were pressed";

    }

    ?>

  7. First select page:

    <html>
    <head>
    
    
    
    <script src="selectuser.js"></script>
    </head>
    <body>
    <div align="center">
    <form>
    <select name="users"  onchange="showUser(this.value)">
    <option>QB
    <option>WR
    <option>RB
    <option>TE
    <option>K
    <option>DF
    </select>
    </form>
    </div>
    <div id="txtHint"> </div>
    </BODY>
    </html>

    You already have the .js script

    And here is the second dropdown page:

    <?php
    $q=$_GET['q'];
    include("db.php");
    
    
    
    $sql="SELECT name FROM players  WHERE position='".$q."' ORDER BY name ASC";
    
    $result = mysql_query($sql);
    ?>
    <html>
    <head>
    </head>
    <body>
    
    <form action="select.php" method="post">
    Comment:<input type='text' name='com' maxlength='80'><br>
    <select name="playername">
    <?php
    while($row = mysql_fetch_array($result))
    {
      echo "<option value='" . $row['name'] . "'>" . $row['name']."</option>" ;
    
      }
    ?>
    </select>
    <input type="submit" name="submit" value="select">
    </form>
    
    </body>
    </html>

    I thought the showuser function used at onchange sent (this.value) to the .js file as the (str) in the function description and was included with the url as url=url+"?q="+str  . So I figured the value of q was equal to the choice that the user made. If I am wrong in this please chow me where I went wrong and give an opinion of how to fix it.

  8. $userid = $_GET['id'];
    $con = db_connect();
    $sql = "SELECT * FROM nexus_users WHERE userid = '$userid';
    $result = mysql_query($sql,$con);
    $row = mysql_fetch_array($result);
    $cStatus = $row['cStatus'];
    
    if ($cStatus == "p"){
    $tb_stat="Active PRO Member";
    }else{
    $tb_stat="ACTIVE FREE Member";
    }
    
    echo $tb_stat;
    

     

    This is how I would do it providing you are not posting the information to this page. If the userid gets posted to here from a form then it's a different story. This is also assuming that cStatus is in the db.

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