• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

What is the difference between client-side and server-side programming?

javascriptphpclient-sideserver-side


PHP Snippet 1:

<script type="text/javascript">
    var foo = 'bar';
    <?php
        file_put_contents('foo.txt', ' + foo + ');
    ?>

    var baz = <?php echo 42; ?>;
    alert(baz);
</script>

PHP Snippet 2:

<script type="text/javascript">
    var foo = 'bar';

    var baz = 42;
    alert(baz);
</script>

Related Snippets

Woocommerce Checkout - Add conditional field required if one field is filled

The difference when using if statement true === something() vs something() === true [duplicate]

I want to display default profile image if user do not have profile image

woocommerce get_order_report_data to show order_item_id

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

php echo xml documents with header

Make certain characters of a word from string bold

Using Associative arrays

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

Best way to scrolldown onpageload

How to add a sidebar to Woocommerce Shop Page?

How to Make Laravel Eloquent "IN" Query?

Laravel: Create morphs() relationship nullable

Why does array_map() with null as callback create an "array of arrays"?

Webscraping Symfony/Panther: Can't get HTML

About Contact Privacy policy Terms and conditions