Jump to content

markbett

Members
  • Posts

    133
  • Joined

  • Last visited

    Never

Posts posted by markbett

  1. lol the irony that you have PHP tutorials on your site... well that and your flash logo is illegable...

    just so you know descending means it starts big and gets small at this very moment the list isnt in desc order....  furthermore you will need to explain WHAT is not working... saying ITS NOT WORKING will do no good and is the reason why "none of (us) are helping you"
  2. on my site when a user logs in a number of session variables are set for them

    [code]                           
       if(mysql_num_rows($validate) == 1){
          while($row = mysql_fetch_assoc($validate)){
             $_SESSION['login'] = true;
             $_SESSION['userid'] = $row['id'];
             $_SESSION['first_name'] = $row['first_name'];
             $_SESSION['last_name']  = $row['last_name'];
             $_SESSION['email_address'] = $row['email_address'];
    $_SESSION['username'] = $row['username'];
             $_SESSION['cid'] = $row['cart_id'];
             setcookie('cid', $unique_cid, time()+24*3600*60);
    //security for sess hijack//
    $_SESSION['user']->fingerprint =
    md5($_SERVER['HTTP_USER_AGENT']);[/code]
    as you can see in the code

    additionally in my code i set
    [code]session_start();
    session_name('SBQA');
    header("Cache-control: private"); // Fix for IE
    [/code]
    before i spit anything out

    the problem i am having is when you are logged in ( http://www.mygaysf.com/sbqa  you can log in using phpfreaks / password ) you will see that it correctly knows that you first name is "PHP Freaks"

    now if you click on lets say the 15th in the calendar then VIEW EVENT
    if you select the EVENT HOSTS name (a link so you will be able to send them a message) you will see that it has now changed your name in the welcome box.  There is NOTHING that should be resetting this session variable....

    that code is simply:
    [code]<?php
    if($_SESSION['login'] == true){
       // show logout hyperlinks
       echo 'Welcome</td></tr><tr><td>- Welcome '.$_SESSION[first_name].' to the SBQA website. Click '.$nav_class.'../sbqa/logout.php">HERE</a> to end your session and log out.<br />';
    if($_SESSION['useradmin'] != TRUE){
    echo  '</td></tr></table>';[/code]

    also on the next page is has changed who you are (the FROM box)

    i only set the session variable FIRST NAME one time when you log in... the only change i do make is on the event view page i do add a session variable so that I can determine who the evnet host is for the last event they viewed but that should not have any effect on this at all as that code is simply:

    [code] //we set variables here for the contacts

    $_SESSION['host_name']= $event_host;
    $_SESSION['host_email']= $host_email;
    $_SESSION['subject']= "Re: SBQA Event ".$title;[/code]

    so WHY oh why is this happening to me??
  3. my code (see below) should work as follows
    1) run a sql query and get get all the topics and their ID# (this returns 4 topics right now)

    2) while the topics are being returned 1 row at a time I take the topic ID and run a second SQL query using it to find all the links in the link table and echo them out

    3) once all the links are done, we should move on to the next topic and then so on doing the same thing for each of the 4 topics

    the problem is that this code is only working for the very first topic.... WHY!?!?!

    [code]<?php
    include $_SERVER['DOCUMENT_ROOT'].'/sbqa/layout2.php';
    $row='';
      $sql = mysql_query("SELECT * FROM link_types");
    while($row = mysql_fetch_array($sql)){
    stripslashes(extract($row));
    echo '<table border="0" align="center">
      <tr>
    <td colspan="2" class="box_title">'.$type.'</td>
      </tr>';
    $sql = mysql_query("SELECT * FROM
    links WHERE (type_1='$type_id' OR type_2='$type_id' OR type_3='$type_id') ORDER BY title");
    while($row = mysql_fetch_array($sql)){
    stripslashes(extract($row));
    echo'<tr><td><a href="'.$url.'">'.$title.'</a></td><td>'.$description.'</td>
      </tr>';
      $url='';
      $title='';
      $description='';
    }
    echo '</table> <br /> <br />';
    }

    ?>[/code]
  4. [code]thats no different the the first query i tried
    {code]SELECT anti_spam.as_email
    FROM anti_spam LEFT JOIN users ON anti_spam.as_email = users.email_address
    WHERE newsletter = 0
    OR users.email_address IS NULL[/code]

    all i need to do is pull all the email addresses where the anti_spam table doesnt have a 1 for the column
  5. example data?  well there isnt any... when i run that query i come back with NO results...  there are users in the USERS table and nothing is stored inthe anti_spam table so i want all the users to be returned...
  6. i've tried a bunch of queries and im still not getting what i need...

    [code]SELECT anti_spam.as_email
    FROM anti_spam
    LEFT JOIN users ON anti_spam.as_email = users.email_address
    WHERE newsletter =0
    OR newsletter IS NULL [/code]
  7. thank you for your help but this isn't quiet right

    running the query comes back with no results
    [code]SELECT anti_spam.as_email
    FROM anti_spam LEFT JOIN users ON anti_spam.as_email = users.email_address
    WHERE newsletter = 0
    OR users.email_address IS NULL[/code]

    this query also doesnt seem correct because i dont need where the users.email doesnt exist.... the problem is that users can exist in the anti spam DB and not exist in the users.... this is so you can say i am not a member and i never want to see anything ever from you...  additionally if you are a member you may not want to be in the anti_spam db so you wont eer have an entry in there
  8. I am strugling with how to properly write this sql query.  I have 2 tables

    users and anti_spam

    I need to select the email address of all users who have not unsubscribed... antispam has columns id email_address, events, newsletter, invitations, news.... so if a column is marked then the email address in question has unsubscribed so basically its is a query where i say join on email addresses where newsletter = '0'

    is that right? Im not too good with complex sql queries...

    oh and for clarification there are email addresses that will appear in the anti_spam database table that will not be in the users table..... so essentially i need to get all the email addresses and drop ones where a column has a value of 1 but if there is not match for that column then we assume its 0


    wow my explination suxs but i dont know how to explain it
  9. [quote author=thorpe link=topic=108587.msg437613#msg437613 date=1158714131]
    php runs on the server while javascript runs on the client. You are mistaken in your belief of how your code works. Maybe you are using some ajax type trickery or are reloading the page, but you sure ARE NOT executing php from within an onmouseover.

    Good luck getting a patent.
    [/quote]

    probably they are calling na actual page so the on mouseover is actually opening a new page cause the server to parse that new info....
  10. I am strugling with how to properly write this sql query.  I have 2 tables

    users and anti_spam

    I need to select the email address of all users who have not unsubscribed... antispam has columns id email_address, events, newsletter, invitations, news.... so if a column is marked then the email address in question has unsubscribed so basically its is a query where i say join on email addresses where newsletter = '0'

    is that right? Im not too good with complex sql queries...
×
×
  • 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.