THT Community (TCom)

Full Version: Having trouble verifying
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm creating a way so that users can make promotional codes from within the admin menu, and I got it to successfully create the promotional codes, but when it comes to checking it in the order form it never shows the check marks. Under my /includes/tpl/orderform.tpl I have
Code:
<tr>
       <td>Promotional Code:</td>
       <td><input type="text" name="name" id="name" onchange="check('name', this.value)" /></td>
       <td align="left"><a title="Optional: Enter a valid promotional code" class="tooltip"><img src="<URL>themes/icons/information.png" /></a></td>
       <td id="name" align="left">&nbsp;</td>
</tr>

And under my ajax.php
Code:
public function namecheck() {
    global $main, $db;
    if(!$main->getvar['name']) {
       $_SESSION['check']['name'] = false;
       echo 0;
       return;
    }
    $query = $db->query("SELECT * FROM `<PRE>promotions` WHERE `name` = '{$main->getvar['name']}'");
    if($db->num_rows($query) != 0) {
       $_SESSION['check']['name'] = false;
       echo 0;
       return;
    }
    else {
        if($main->check_name($main->getvar['name'])) {
            $_SESSION['check']['name'] = true;
            echo 1;
        }
        else {
            $_SESSION['check']['name'] = false;
            echo 0;
        }
    }

Kinda just followed what was dont to email, expect my values are under a tht_promotions where the promo code is under the value 'name'. Can someone explain why this isn't working?
Found out that the problem was that I needed

<td id="name" align="left">&nbsp;</td>

to be

<td id="namecheck" align="left">&nbsp;</td>

But its still not showing a check mark even when I set the namecheck() to just pass it
Got it working all working now after hours
nice job.
Great work xpack. Waiting for this promotional code plugin badly. It is probably one of the most wanted feature THT needs.
Yeah I knew it would be thats why I decided to start working on it. It may be completed but I'm getting errors when creating users. I thought it was just I had broken something but its not creating accounts for any of my 3 installs even the one I haven't edited. So it must be something with the server. Gonna figure this out then I can check if its working or not
Sorry for the delay on this. THT doesn't seem to work on my vps now no matter what I do. What PHP version is best for this?
any 5.x should work, I'd try the new 5.3.3.
Make sure it's not a MySQL problem.
Well I have nginx proxied to apache with php 5.3.3 and mysql 5.1.47 and still not working. Reinstalling everything just to make sure.
Whys it not working? WHats it saying?
Pages: 1 2
Reference URL's