Announcement

Collapse
No announcement yet.

Problem with Script - please take a look

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JoshFink
    replied
    Actually, they are used if the condition is met. For instance, if you have already made a request. It checks and then if it is true it populates that variable with some table code that will display a message.

    Yeah, those are the only two lines that don't work. Every other line works all the time.. It just seems very strange for it to only work sometimes. I wish I could find a pattern, then I could narrow down the problem.. Unfortuantely not though.

    Josh

    Leave a comment:


  • Mark Hensler
    replied
    It looks alright, I was just wondering why you set a variable, and didn't use it.

    Are those the two lines that only work some of the time?
    Have you found a pattern as to when they do or don't work?

    Leave a comment:


  • JoshFink
    replied
    Because the variable NS_requestcontent is used inside the template : 'NS_requestcomm_error'

    I figured this way I could change the message based on criteria.

    Is that not correct?

    Josh

    Leave a comment:


  • Mark Hensler
    replied
    Question...
    PHP Code:
    eval("\$NS_requestcontent = \"".gettemplate('NS_requestcomm_complete')."\";");
    eval(
    "dooutput(\"".gettemplate('NS_requestcomm_error')."\");"); 
    Why do you save a value to $NS_requestcontent?

    Leave a comment:


  • JoshFink
    started a topic Problem with Script - please take a look

    Problem with Script - please take a look

    Ok, I have the following in a file called "requestcomm.php"

    The script runs well everytime but it is supposed to show the last two lines after the person selects submit. It does the correct operation to the database, but it intermittantly shows the last two lines which call a template.

    I don't know if this is enough info, but here is the script.

    Thanks

    PHP Code:
    <?php

    require("./global.php");

    $outstanding_request mysql_query("Select requestid from comm_request where username = '$bbuserinfo[username]'");
    list(
    $requestid) = mysql_fetch_row($outstanding_request);


    if (
    $bbuserinfo[username] == Unregistered) {
      eval(
    "\$NS_requestcontent = \"".gettemplate('NS_requestcomm_notloggedin')."\";");
      eval(
    "dooutput(\"".gettemplate('NS_requestcomm_error')."\");");
    } elseif (
    $requestid){
      eval(
    "\$NS_requestcontent = \"".gettemplate('NS_requestcomm_outstanding')."\";");
      eval(
    "dooutput(\"".gettemplate('NS_requestcomm_error')."\");");
    }else{  
      eval(
    "dooutput(\"".gettemplate('requestcomm')."\");");
    }

    //if ($Submit == "Submit")
    if ($action =="requestcom"){

        
    $DB_site->query("INSERT INTO comm_request (username, useremail, userdomain, usercname, userrequest, address, city, state, zipcode) VALUES ('$username', '$useremail', '".addslashes($userdomain)."', '".addslashes($usercname)."', '".addslashes($userrequest)."', '".addslashes($requestaddress)."', '".addslashes($city)."', '".addslashes($state)."', '$zipcode')");
    }

        eval(
    "\$NS_requestcontent = \"".gettemplate('NS_requestcomm_complete')."\";");
        eval(
    "dooutput(\"".gettemplate('NS_requestcomm_error')."\");");


    ?>
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X