GliderPilot 33 Posting Whiz

Check the directory permissions on your online server to make sure the folder is writeable

momonq1990 commented: thank you :D +2
GliderPilot 33 Posting Whiz

Did you try what I just posted?

echo "<tr align='center' bgcolor='#93dafb'><td height='25px'><a href='Profile.php?id=" . $results['id'] . "'>" . $results['Name'] . "</a>.</td> <td>".$results['Type']."</td></tr>";

GliderPilot 33 Posting Whiz

You'll need to add some relative and absolute positioning into your CSS to get the effect you're looking for. Take a look at this, should help you out: http://www.barelyfitz.com/screencast/html-training/css/positioning/

GliderPilot 33 Posting Whiz

Looks like you copied some un-needed code into your echo statement

[code]echo "<tr align='center' bgcolor='#93dafb'><td height='25px'><a href='Profile.php?id=" . $results['id'] . "'>" . $results['Name'] . "</a>.</td> <td>".$results['Type']."</td></tr>";
[/code]

*Sorry, stuck on a machine with IE7 at the moment which won't let me make the above into a code block

GliderPilot 33 Posting Whiz

Can you provide more info? It's diffacult to say with the limited info you've given.

Are there any error messages displayed on screen or in the server's error logs? What kind of file are you trying to upload? What is the size of the file you're trying to upload? Also posting your code may be helpful.

GliderPilot 33 Posting Whiz

If your host allows remote MySQL, you'll have to add your local server's IP to their remote MySQL settings to their firewall allows the access. If you're host uses cPanel just look for the remote MySQL icon in the Database Tools section.

GliderPilot 33 Posting Whiz

This is always going to evaluate to FALSE as you do not have a manager variable being passed from your form:

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

I'm guessing you want to change that to username to see if a form was submitted.

Also in your form, your username input field has the U is capatalized, but in the PHP script it is not.

<input name="Username" type="text" id="Username" /> -> $manager = mysql_real_escape_string($_POST['username']);

Make those changes and give it a shot.

GliderPilot 33 Posting Whiz

Line 2 of your JS, your missing the t in Element for your getElementByID

GliderPilot 33 Posting Whiz

Line 81 and 118, the new Image() is a function, remove the x and z from that function call

GliderPilot 33 Posting Whiz

Correct, don't forget to change your second function call (Line 145) to showImageA()

GliderPilot 33 Posting Whiz

That would only work if your loading the page locally (If you double click the HTML file to open it in you default browser). If you try that through a web address on a server it will not work, the browser will not allow a page access to the C drive, not to mention that it would be looking on the c drive of whoever is looking at the page, not of the server.

You can do the following, but again it will only work on your machine:

<img src="file://C:/xampp/htdocs/images/logo.jpg">

OR

<img src="http://localhost/images/logo.jpg">

Hope that helps

GliderPilot 33 Posting Whiz

Not exactly the most efficient way but you would need to change the name for all occurances of the following variables in your second script:

theImages
imgSize
p
whichImage
GliderPilot 33 Posting Whiz

Try this:

function validateEmptytextBox() {
    var inputField = document.getElementById("textArea1").value;
    inputField = inputField.replace(/^\s+/, '').replace(/\s+$/, '');
    if(inputField == ""){
        alert("please enter a value, textarea cannot be empty");
    }else{ 
        alert("Success");
    }

}
GliderPilot 33 Posting Whiz

Are you looking to have two seperate groups of images and choose an image from each group two display (I.E. Pool A has 5 images and Pool B has 6 images. Choose 1 random image from Pool A and one from Pool B)

Or are you looking to just have one set of images and you want the script to pick two of those images instead of just one and display both of them.

GliderPilot 33 Posting Whiz

You're missing the last 10 lines of your original code.

        }
        else {
            echo "<tr align='center' bgcolor='#fdee03'><td colspan='2' height='25px'>Sorry..No data found for $query if you are owner for Business company / Organization you can add your content for submiting your content click here</td><tr>";

             echo "</table>";

      }
    }
    else {
        echo "<tr align='center' bgcolor='#fdee03' font size='10'><td colspan='2' height='25px'>Your search keyword contains letters only ".$min_length;

    }


?>
GliderPilot 33 Posting Whiz

Try replacing lines 554 - 558 with the following:

function startUpload() {
    if (!$("input[name='type']").is(':checked')) {
        alert('You must select an option before submitting');
    }
    else {

        document.getElementById("imageForm").target = "my_iframe"; //'my_iframe' is the name of the iframe
        document.getElementById("imageForm").submit();
        document.getElementById("post-loader9999999999").style.visibility = "visible";
    }
}
GliderPilot 33 Posting Whiz

Can you post the Javascript code for the startUpload() function?

GliderPilot 33 Posting Whiz

That means you missed a closing } or ). Double check you didn't delete an extra one when you were changing the code. If not post all of your code here and I will take a look for you.

GliderPilot 33 Posting Whiz

Can you not just add the link to your output, I see no need to add it to your variable. Try this:

while($results = mysql_fetch_array($result))
{

  ?>

    <tr align='center' bgcolor='#93dafb'>
      <td height='25px'>
        <?= $results['Name']; ?> <a href="Get-Details.php?id=<?= $results['id']; ?>View Details</a>
      </td> 
      <td>
        <?= $results['Type']; ?>
      </td>
      <td>
        <?= $results['Address']; ?>
      </td>
    </tr>


  <?php

}
GliderPilot 33 Posting Whiz

I would never use this for a few different reasons, but it will accomplish what you're asking

<html>
<head>
    <script type="text/javascript" src="jquery-2.0.3.min.js"></script>
    <script type="text/javascript">
                    $(document).ready(function(){
                    $(".mylinktempnum").click(function(){
                        alert($(this).attr('href').match(/tempnum=([0-9]+)/)[1]);
                    });
                    });
    </script >

</head>
<body>
</body>
</html>


<?php
<a class=\"mylinktempnum\" href=\"home.php?tempnum=$num\"></a>
?>
GliderPilot 33 Posting Whiz

you would have to use a regex expression to extract that from the url which is somewhat pointless in this case. Not sure what you're trying to accomplish but it may be easier to use the html onclick attribute to call a function with the parameter passed to it:

<script>
    function link_click(tempnum)
    {
        alert(tempnum);
    }
</script>

<a href="javascript:" onclick="link_click('<?= $num; ?>');">Click Me</a>

But again I don't know what you're trying to accomplish so this may not be the best route for you.

GliderPilot 33 Posting Whiz

Disabled check boxes to not send their data on POST. Few alternatives:

1) Keep a hidden element with the check boxes with the same value.
2) Use javascript to enable all the check boxes on submit before the data is sent so they are included
3) Use CSS and JS to emulate a disabled box (prevent default event) without actually disabling them

GliderPilot 33 Posting Whiz
    <div style="float: left; background-color: white;">
    <img src="Images/Books.jpg" alt="Books" width="225" height="125"/>
    </div>

    <div class="clear: both;">&nbsp;</div>

    <div id="left-col">some text</div>
GliderPilot 33 Posting Whiz

Your load call is only within the document ready so it will only ever get called the once. If you add it to your submit event handler as well it will re-load it on the submit. You might want to add it to the ajaxSubmit success option so it only reloads if the comment was posted successfully:

        <script type="text/javascript">  
    $(document).ready(function() {

            $('#myForm').ajaxForm(function() { 

               // attach handler to form's submit event 
            $('#myForm').submit(function() { 
            // submit the form 

            $(this).ajaxSubmit({ success: function() { $('#list').load("feedbackdisplay.php"); } }); 

            // return false to prevent normal browser submit and page navigation 
            return false; 

            });


         }); 


            $('#list').load("feedbackdisplay.php");

}); 



        </script>
GliderPilot 33 Posting Whiz

Setup two CSS classes one for offline and one for online. Simple if statement, if they are online make their name class="online" if they're offline make their name class="offline" than you can set all the coloring and formatting to the text you want in CSS

GliderPilot 33 Posting Whiz

Create a LastOnline timestamp row in the DB.

When someone is logged in, everytime they load a page, update the timestamp

When you want to know who is logged in do a DB query and get everyone who's timestamp is within the previous x amount of time. For example on our site I have it set to 5 minutes, so I run a query to select all users who's timestamp is within the last 5 minutes. If they have done something within the last 5 minutes there is a good chance they are logged in. It's not 100% accurate but's it's fairly close, simple and effective

GliderPilot 33 Posting Whiz

you want to get the offsetTop preoprty of the main menu than get the scrollbar position. If the scrollbar is down more pixels than the main menu, add your top menu. Here is a small example in jQuery (untested):

    var main_menu_top = $('#main_menu').offset().top;
    //Change the number to the height of your menu
    var menu_bottom = main_menu_top + 100;

    $(window).scroll(function(){    
        var scroll_top = $(window).scrollTop(); // our current vertical scroll position from the top

        // Check to see if we've scrolled more than the top menu
        if (scroll_top > menu_bottom) {
            //Our scroll is lower than the main menu, check if the top menu is already displayed
            if ( ($("#top_menu").is(":visible") == false) ) {
              //Menu isn't visible, so show it
              $('#top_menu').show();
            }
        } else {
            //Scroll bar is higher than the bottom of the main menu so make sure the top menu isn't visible
            if ( $("$top_menu").is(":visible") ) {
                $('#top_menu').hide();
            }
        }
    });
GliderPilot 33 Posting Whiz

After your main content add:

<div style="clear:both;">&nbsp;</div>

GliderPilot 33 Posting Whiz

Add a stopPropagation() call to the live functions on your action images, ie:

$("delete_img").live('click',function(e) {
  e.stopPropagation();
  //other actions here
});
GliderPilot 33 Posting Whiz

But this one I can't believe you asking this question. You can't write a query for this plus creating a table?

I don't think they want the code to do queries, they are just asking on an opinion if the table structure they came up with was a good one or not.

Personally I would not use the cart table unless you want to save a cart so it's available to the user on a different PC, I would handle that with cookies.

I would also add an orders table that would keep a record of all orders so a user can view their previous orders and for record keeping.

GliderPilot 33 Posting Whiz

This should work for re-routing the domain, just change domain to your wanted domain:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com$
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
GliderPilot 33 Posting Whiz

Sorry I missed the brackets, it happens. Anyways, good luck.

GliderPilot 33 Posting Whiz

More than likely the script in the body of your page is trying to run prior to the jQuery being loaded. Try putting it in an onload function and adding a type:

script.type = 'text/javascript';
script.onload=scriptLoaded;
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js';
document.getElementsByTagName('head')[0].appendChild(script);

function scriptLoaded {
  $('#main').click(function(){ alert('hi'); });
}

That being said I see no advantage of loading jQuery at run time. If you're going to use jQuery why not just include it originally.

GliderPilot 33 Posting Whiz

All your DIV's have absolute positioning so that overrides the margin: o auto; you can use the Jorge's example but you'll need to change a few things.

First you'll need to add relative positioning to your wrapper:

#wrapper {width:##px;margin:0 auto;position:relative;}

Than you're going to have to play with the left / right positioning of all your DIV's. Because you used a WYSIWYG editor there is a lot of uneeded code and fill that could really be done away with to make this much easier and efficient.

GliderPilot 33 Posting Whiz

try this:

.button:focus,
.button:active {
  background-color: #FFF;
  color: #385D8A;
}
LastMitch commented: Nice! +9
GliderPilot 33 Posting Whiz

Is your XML declared as XML??

<?xml version="1.0" encoding="ISO-8859-1"?>

GliderPilot 33 Posting Whiz

I'm sorry I wrote it in backwards should be this:

if(value.indexOf(re) !== -1)

GliderPilot 33 Posting Whiz

What happens when you alert(form.firstName.value); ?

GliderPilot 33 Posting Whiz

Try this:

var re = form.firstName.value;
if(re.indexOf(value) !== -1) 
 {alert(alerttxt);return false}
else {return true}
GliderPilot 33 Posting Whiz

Nothing is standing out, the only thing I can think of is mix-matching a field. Make sure your DB cols are of the correct type for the data your supplying... i.e. the to col isn't of type CHAR or something to the effect

GliderPilot 33 Posting Whiz

The mysql_num_rows if failing because your query is failing not because it returned 0 results. Add a die statement to your query to output the error to see what's happening:

$tinysql = mysql_query("SELECT * FROM products WHERE subcategory ='". $subcategory ."' LIMIT 4") or die (mysql_error());

On a side note you're not using your tinyProductCount variable anywhere so you're wasting resources by storing it in a variable. You can combine the two lines into one

$tinysql = mysql_query("SELECT * FROM products WHERE subcategory ='". $subcategory ."' LIMIT 4");

if (mysql_num_rows($tinysql) > 0) {
...

On another side note mysql functions are being depreciated, you should use mysqli or PDO

GliderPilot 33 Posting Whiz

He has three different DB queries, one is getting admins ($row1) one is geting staff with a banned account ($row) and the other gets Staff withour a banned account (no variable set for this one). While this method works it would be just as easy to make this all one DB query to reduce the number of DB queries you need to make (And don't forget we shouldn't be using mysql_ functions anymore)

All that asside your IF statements on lines 9 and 33 are assigning variables to your POST data rather than checking them as you only have single statements

9  if ($_POST['user']='Admin'){
33 if ($_POST['user']='Staff'){

should be

9  if ($_POST['user']=='Admin'){
33 if ($_POST['user']=='Staff'){
GliderPilot 33 Posting Whiz
input:hover{
  color: #FFF;
}

input:focus{
  color:#FFF;
}

input:active{
  color:#FFF;
}
GliderPilot 33 Posting Whiz

The close numbers are multiplying to give you a number outside of the range causing it all to evaluate to your 'high' class:

<script>
            function get(ID) {
                return document.getElementById(ID);
            }
            function MultiplicationTable() {
                var start = parseInt(get('start').value);
                var end = parseInt(get('end').value);
                var last = end - start;
                var incr = Math.floor( end / 3);

                var MultTbl = '<table>';
                if (start > end) {
                    alert("Invalid Data");
                    return;
                }
                for (var i = " "; i <= end; i++) {
                    MultTbl += '<th>' + i + '</th>';
                    for (var i = start; i <= end; i++) {
                        MultTbl += '<th>' + i + '</th>';
                    }
                }
                for (var i = start; i <= end; i++) {
                    MultTbl += '<tr>';
                    MultTbl += '<th>' + i + '</th>';
                    for (var j = 0; j <= last; j++) {
                        var val = (i * (start + j));
                        MultTbl += '<td class="' + getValueCss(val,start,incr) + '">' + val + '</td>';
                    }
                    MultTbl += '</tr>';
                }
                function getValueCss(val,start,incr) {

                    var high_d = start + incr;
                    var low_d = high_d + incr;
                    if (val < high_d)
                        return 'high';
                    else if (val >= high_d && val < low_d)
                        return 'middle';
                    else
                         return 'low';
                }
                MultTbl += '</table>';
                get('MultTbl').innerHTML = MultTbl;
            }
</script>
GliderPilot 33 Posting Whiz

Can you post the final code you have?

GliderPilot 33 Posting Whiz

I think the math is a little off there... try this:

//Get our start, end and total number of numbers
var start = parseInt(get('start').value);
var end = parseInt(get('end').value);
var total = end - start;
var val = (i * (start + j));



function getValueCss(val, start, total) {

  //Find out what our two dividers are
  var d = Math.floor( total / 3);
  var low_d = start + d;
  var high_d = low_d + d;

    if ( val <= low_d ) {
        return 'low';
    }
    else if ( val > low_d && val <= high_d) {
        return 'middle';
    }
    else {
        return 'high';
    }
}
GliderPilot 33 Posting Whiz
GliderPilot 33 Posting Whiz

You just need to add <td class="high">378</td>, <td class="low">234</td> etc...

GliderPilot 33 Posting Whiz

Yes that's what I understood your question to be, what I'm saying is that if the select is appended the the current form properly it should already be available in your POST data without needing to do any additional work, unless you're building your own custom AJAX call, there is no way to really modify the POST data . As blocblue stated we might be able to figure out what's going on if you post the full code.

GliderPilot 33 Posting Whiz

Just thinking outside the box here, could always be a misconfigured session setting in php.ini or cookies disabled.