Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:52:32+00:00 2026-06-17T13:52:32+00:00

i’m new to HTML5 and i just want to know how can i save

  • 0

i’m new to HTML5 and i just want to know how can i save the canvas data ( i have drawn a square on the canvas ). I wanna save x,y,h,w or scale on the database and use that data to recreate the drawing again. How can i do this ?

Thank You.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:52:33+00:00Added an answer on June 17, 2026 at 1:52 pm

    Well you could store them into a mysql database or a server file.

    In case of mysql create a table named entities with the columns you want or even 1 column and serialize the data you want to store.

    For example

    id | x | y | h | w | scale
    1    4   4   4   4    0.5
    

    or

    $object_cube = array();
    $object_bube['x'] = 4;
    $object_bube['y'] = 4;
    $object_bube['h'] = 4;
    $object_bube['w'] = 4;
    $object_bube['s'] = 0.5;
    

    then serialize and create your PDO query

    $host =     "localhost";
    $user =     "someuser";
    $pass =     "somepass";
    $database = "db_name";
    
    $db = new PDO("mysql:host=$host;dbname=$database", $user, $pass,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")) or die("Connection error!");
    $ser_obj = serialize($object_cube);
    $query = "INSERT INTO entities ('cube') VALUES (:object)";
    $params = array(':object' => $ser_obj );
    db_query($query, $params);
    
    function db_query($q,$p = array())
    {
        global $db;
    
        if($stmt = $db->prepare($query))
        {
    
            if(count($p) > 0)
            {
                foreach ($p as $key => $value) {
                    $stmt->bindParam($key,$value);
                }
            }
    
            $stmt->execute();
    
        }
    
    }
    

    this should take care of saving after that is up to you to load what you want whenever you need it by mining the database 🙂

    You ‘ll have to be familiar with AJAX -> http://www.w3schools.com/ajax/default.asp
    and some server side language like php or asp. Otherwise you could store it locally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
I want to construct a data frame in an Rcpp function, but when I
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.