ko ko 97

String concatenation error on line 15 inside while loop.
echo 'There are . $result . 'members';}

Try this:

$result=mysql_query("SELECT COUNT(*) AS total FROM registration") or DIE(mysql_error());

$row = mysql_fetch_row($result);

if($row[0]['total'] > 0) {
    echo 'There are ' . $row[0]['total'] . ' members.';
}

It should work (not tested).

ko ko 97

I'm not sure what's the problem ? I don't get any problem. Is it not working ?

ko ko 97

Oop ! Sound likes suck! But, you're right. :) Thanks for alert @blocblue.

ko ko 97

str_pos() returns boolean (TRUE or FALSE). Should be

if (strpos($html->href, 'http://') !== FALSE) {
    //there is http in the url, then do this statement
    // your code
}

Or use @diafol method.

ko ko 97

Remove your scripts and just check mine, and then, alter those codes according to your needs. You've wrong syntax and also I can't tell without seeing your HTML.

ko ko 97

With my thought, better pick up a CSS framework such Twitter Bootstrap or 960.gs would help you to make your template easily with their default CSS properties in a short while. You can also try free CSS templates to download into your PC and customize those templates according to your needs. Or post your web site link here and then, no one need to download your CSS and everyone can see your CSS via their browser view source and they can also fix your CSS bugs and let you know what you need to do. Good luck. Table layout sucks yet! :)

ko ko 97

Here is my script and markup with your getCookie and setCookie functions. It does work properly.

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title> - jsFiddle demo by wasimkazi</title>
    <style type="text/css">
    <!--
    body {
        color: #171717;
        font: 11pt/14pt Arial, Tahoma, Sans-serif;
    }
    h3 {
        font-size: 11pt;
        margin: 0 0 10px;
        padding: 0;
    }
    p {
        margin: 0;
    }
    #boxes {
        margin: 2em;
        width: 300px;
    }
    .button {
        background: #f2f2f2;
        border: 1px solid #aaaaaa;
    }
    .button span {
        cursor: pointer;
        display: block;
        font-weight: bold;
        padding: 0.4em 1em;
    }
    .box {
        border-color: #aaaaaa;
        border-style: none solid solid;
        border-width: 1px;
        display: none;
        margin-bottom: 1em;
        padding: 1em;
    }
    -->
    </style>
    <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
    <script type='text/javascript'>//<![CDATA[ 
    function getCookie(c_name) {
        var i, x, y, ARRcookies = document.cookie.split(";");
        for (i = 0; i < ARRcookies.length; i++) {
            x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
            y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
            x = x.replace(/^\s+|\s+$/g, "");
            if (x == c_name) {
                return unescape(y);
            }
        }
    };
    function setCookie(c_name, value, exdays) {
        var exdate = new Date();
        exdate.setDate(exdate.getDate() + exdays);
        var c_value = escape(value) + ((exdays === null) ? "" : "; expires=" + exdate.toUTCString());
        document.cookie = c_name + "=" + c_value;
    };
    $(document).ready(function(){

        if(getCookie('openbox'))
        {
            $('#' + getCookie('openbox')).slideDown('fast');
        }

        $('.button').click(function(o){
            var obj = $(this);
            $('.box').slideUp('fast', function(){
                $(obj).next('.box').slideDown('fast');
                var openBoxID = $(obj).next('.box').attr('id');
                setCookie('openbox', openBoxID);
            });
        })
    });
//]]>  
</script>
</head>
<body>
    <div id="boxes">
        <div class="button"><span>Box 1</span></div>
        <div class="box" id="box1">
            <h3>Box 1</h3>
            <p>Box 1 content.</p>
        </div>
        <div class="button"><span>Box 2</span></div>
        <div class="box" id="box2">
            <h3>Box 2</h3>
            <p>Box 2 content.</p>
        </div>
    </div>
</body>
</html>

ko ko 97

If I am not wrong, toFixed() must be custom javascript function which fills zero to float number with one position. You can pass the current value within that function and assign to variable as new value. Like

amount += parseFloat($(this).metadata().amount);
amount = toFixed(amount);

ko ko 97

Try to read the text file via php and echo out instead of using 'include()' function to show the text file.

<?php include($datadir."file_date.txt"); ?>

Instead

<?php include($data_dir . 'read_data.php'); ?>

Read the text file and echo the result in 'read_data.php'. Set file permission for that text file to 755 would be better.

ko ko 97

It may be cache. Better check file_date.txt directly.

ko ko 97

var_dump($arraydata['newda']);

How look like the above value before json_decode() function ? It contains any slash or escape ?

ko ko 97

Echo $rs_insert_scan before mysql_query() statement and see what returns. Is it the right query syntax what you're expecting ?

ko ko 97

Mark as Solved then.

ko ko 97

Well. No one listen to the forum rules. You might mark as Solved when your problem was solved.

ko ko 97

Solved ? Marked it as Solved then.

ko ko 97

Probably, you may have XMLHTTPRequest problem. Are you sure crearXMLHttpRequest() works on IE and you get new XMLHTTPRequest ? Should try what @pritaeas said.

ko ko 97

Check RegEx.

ko ko 97

You must use HEADER with proper MIME type to prompt the download immediately when you click the download button. The above @tyson567 methods just send you the new page where the image located, it'll not prompt you to download the image when you reached that page. Here is the example for method 1. The method 2 can be done with Javascritp or jQuery plugin. You just need to google for that.

ko ko 97

It's not notepad what @veedeoo is mentioning. Notepad is not good IDE to write the code or any programming language. You should use another IDE which has more features and good supporting for multiple programming languages such as PHP, HTML, ASP or Java. Here are some good tools you should try. Notepad++ ( http://notepad-plus-plus.org/download/v6.1.3.html ), SublimeText2 ( http://www.sublimetext.com/2 ), AptanaStudio3 ( http://www.aptana.com/products/studio3/download ). I prefer to use Notepad++ and SublimeText2 rather than AptanaStudio3. These two IDEs are comfortable with small projects like PHP, HTML, Javascript and any web development.

ko ko 97

Only submit button should be identified for one form. No matter how much submit buttons are you using within the same form, they've only submission of that form.

Try what @Glider Pilot mentioned above.

ko ko 97

[B][COLOR="Red"]datatype[/COLOR]: 'json',[/B] should be [B]dataType[/B]

ko ko 97

Post the error what you're getting. Actually, you need web server and MySQL for installing Magneto.

ko ko 97

There is no one who write the code for you. Post what you've and what you got. We'll point you the correct way.

ko ko 97

[CODE]<?php
mysql_connect("localhost", "root", "test") or die(mysql_error());
echo "Connected to MySQL
";
mysql_select_db("testdb") or die(mysql_error());
?>

<?php

@$username = $_POST['name'];
@$country = $_POST['country'];

?>[/CODE]
Put this in form.php, remove [B]include(form.php)[/B] and try. If you want to show the form again. Redirect to that page when the INSERT finished with custom message, FAILS or SUCCESSES. There is a lot of tutorials on the internet. You can google for that.

ko ko 97

[CODE=php]<?php
phpinfo();
?>[/CODE]
What does it return ? Also, don't put the bracket with [B]echo[/B] statement.
[code=php]
<?php
echo "Hello";
?>
[/code]
It should be.

ko ko 97

You might have wrong db structure.
Separate the user table and order table. User table should has ID numbers, names and ordered. Also, order table should has ID numbers, names and quantities.

For example, if one user click cheese to order, then update the ordered field (insert the ID number of the ordered item) from user table where username/id is the user/user's id who made the order. If the user made more than one orders, you can store the id numbers of the ordered item together with comma (1,2,3 etc).
And then, you might update quantities field from order table where the field 'quantities' is Cheese. So, you can analyze how many orders exist for each item. Once, the user has finished the ordered process or logged out without finishing the order process, you must remove the order from that user.

Hope this help.

ko ko 97

[CODE][B]$qtyProd= $_POST['qtySelectProd'];[/B][/CODE]

  • Where is [B]qtySelectProd[/B] in the form ? I don't see that field in the form.
  • [B]qtySelectSer[/B], you have only [B]qty[/B] value [B]qtySelectSer[/B], check your HTML option value within the loop.
    [QUOTE]for ($n=0; $n<11; $n++){ echo "<option value=[B][COLOR="Red"]qty[/COLOR][/B]>".$n."";
    }[/QUOTE]

ko ko 97

Solved ? If then, mark as Solved.

ko ko 97

Post the codes in site.php.

ko ko 97

Try this:
[code=php]
if(isset($_POST['firstName'] && $_POST['lastName'])) {
$text=$_POST['firstName']." ".$_POST['lastName'];
$to="anubhavjhalani09@gmail.com";
$subject="Message from php";

//data insert into database
$sql="INSERT INTO entries (contents)
VALUES
('$text')";

echo $text;
}
[/code]