Jump to content

Save page data for later viewing


ironman32

Recommended Posts

each user would need a unique username and password along with their workout schedule stored in a database.

 

You would then use a login system to identify which user has visited and display their personal workout schedule. If you wanted you could make the page interactive so that users can edit their schedule which would update the database.

 

The database would keep track of everything a save any changes automatically.

 

However to tell you specifically how to achieve it would require us almost writing the entire code for you. Learn php, a good book is "php and mysql for dummies", or hire someone else to do the work for you.

Link to comment
Share on other sites

Ok, I already have a login system setup with usernames and passwords.

 

The exercises for the workout are displayed in tables. Here's an example of this code

<table border="1">

Session 1
<tr><td>Stretch/Warm up</td></tr>
<tr><td><?php echo $input[$rand_keys[0]] . "\n";?></td></tr>
<tr><td><?php echo $input1[$rand_keys[1]] . "\n";?></td></tr>
<tr><td><?php echo $input2[$rand_keys[1]] . "\n";?></td></tr>
<tr><td><?php echo $input3[$rand_keys[1]] . "\n";?></td></tr>
<tr><td><?php echo $input4[$rand_keys[0]] . "\n";?></td></tr>
</table>

Now if I wanted to send this table and its data to the database, how would I go about doing it? The only time I have sent data to the database was with a form but I don't know how to do it with a table.

 

 

Link to comment
Share on other sites

I think what you are looking for is using ob_start(), ob_end_flush(), and ob_get_contents() to basically store your results into a cache and then use ob_get_contents() to store the resulting data into a variable which could be saved out to a database.  Hopefully this is a good start.

Link to comment
Share on other sites

Ignore what the guy above me said. He's not thinking too clearly.

 

Let's take a step forward, ironman.

 

How about you start by implementing the database for the form and we can go about pulling that data out and translating that to a table.

Link to comment
Share on other sites

I already have a database set up. So whats' next? I'll have to set up a table for the data right?

Would something like this be along the right lines?

 

CREATE TABLE `php_session` (
  `session_id` varchar(32) NOT NULL default '',
  `id` varchar(16) default NULL,
  `date_created` datetime NOT NULL default '0000-00-00 00:00:00',
  `last_updated` datetime NOT NULL default '0000-00-00 00:00:00',
  `session_data` longtext,
  PRIMARY KEY  (`session_id`),
  KEY `last_updated` (`last_updated`)
) ENGINE=MyISAM

 

I borrowed this from a tutorial on saving session data.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.