HTML: How to design profile page that is used for different users - html

I want to make a website for my Android social networking app and need some assistance with a basic concept regarding user profile pages. So right now I have a native Android app where users have their own profile page displaying their profile stats, e.g. followers etc. and I would like to do something similar in HTML. My question is how can I design a generic profile.html page that displays the current user's username/stats and that can be used for different users? For example, see how Facebook are using the same profile page for each user but they replace the name/bio/stats fields with the data for the current user, how is that done - at the server side (by replacing the appropriate fields with the data for the current user), or at the client side (by loading them with a separate script after the page has loaded)?
Also, I am using a Tomcat servlet to deal with the requests if anyone is interested.
Thanks for any assistance and sorry if the question is silly :)

You would have to use PHP. Think of webpages as a mathmatical equation where HTML is 3+4=12 but PHP is 3+X=12. HTML is already defined, you can't change it. Where PHP you can code the entire page but get the bio or username from a database.
But you should be warned that this is no simple task, you would have to create a large mySQL database, possibly more to handle logging in and out and use the PHP to define what you are calling for form the mySQL database.
It is possible, but not in a day.

Related

Suggestion About Creating a Web Database Application

I am new in web developers world. I have created a website (www.formsify.in) on Wordpress all by learning on internet. I know the basics of coding and programming languages, etc. and the interest so I learn quickly. Now my objective is to let users search and download documents (.pdf). The way I dl it now is by uploading the documents in Media and use buttons to navigate to the page which displays documents in a tabular form.
Now, this works if the documents are less in numbers. But I know the number of documents will increase and it will be very difficult for me to deal with uploading them one by one and creating tables all the time. So I thought to create
(1). Database of documents
(2). Uploading interface
(3). User interface
I want suggestions whether I am thinking in the right direction or can there be a better way to accomplish this. And if this is a right way to do
What database shall I use keeping in mind that I the documents to be stored online so the database should be online.
How should I go about creating the uploading interface keeping in mind that I am not a code-geek.
How shall I be going to design the user interface.
I know these are very wide and open questions. Also because stalwarts here will give me a non-commercial, non-biased view. I just need directions. I was able to create a decent website (as per my standards) when I didn't know much the only thing drove me to do that was that I was hellbent. I will be thankful for any suggestions.
Thanks,
.farhan
So, basically, you should have 2 tables:
User
Upload
User hold an ID and whatever information you want to have on the user and the upload table holds a unique ID, a user ID (of the uploader) and a path to the document
This way, you can select the uploads (add filters if needed) and you can construct the tables and views using the database results
The uploading is a simple html form that will send the file to a php script that will upload the file to a folder (rename it as well) and insert the new path in the dB.
The user interface just needs to hold a bit of html, with a form element and an action to a php script to handle the upload.
You can find the upload script on w3schools, just add the mysql insert to the database.

How to allow each user access his / her details of SSRS reports

I have around 200 users data in my database. I have generated reports for each user containing charts and tables etc. I want to allow each user to access his or her data using URI from our mobile app. Since the users are logged in the app I dont want to relogin them on the web page.
At the moment I think i will upload the SSRS reports to the webserver and using URI users can click a link in the app to direct to their webpage and see their data.
I dont have any idea of how to achieve it. Can you please give me suggesstion on how to achieve it in the best possible way. Any links, support etc will be highly appreciate.
I'm having trouble understanding your question. Are all of these users looking at a similar report, just different data? If so, there is a UserID built in field in SSRS, and you could use that as a hidden parameter to pass to your query.

displaying images and collecting rating score of each image

I have lots of images with filename as an identifiers. Each image has to be seen by users online and they can give a score/rating. How can I collect the data?
I have done it through Excel and collected the data manually. But now I am looking for an online based method as I know basic html and have access to a webserver. Please someone point me in the right direction or place for information.
For this you need to run some backend script where you will pass the value of the image clicked and doing some database function you have to store it in your database.
This is a vast subject. For example you can store data in database (MySQL for ex.) and generate html pages using server-side language (Python, Ruby, PHP, ext.). And users interact with the server through the html pages. Your images information will be stored in database and change with script on server-side.
More details can be found here:
http://searchnetworking.techtarget.com/definition/client-server

WordPress: Generating pages from custom db table

I'm hacking WordPress quite a lot for a current project. I'm storing data input by the user into two custom database tables (still inside the wp database though).
Along with the information I need to collect, I'm also saving the wp user id into the database. I've generated a URL I'd like each user to be able to visit, to see the results of their input. The structure of this URL is simple http://domainname/username/searchname
Now obviously, I can output this as a URL and it can be clicked, but WordPress obviously just spits out the 404 template instead.
I kind of need to emulate the same functionality that the post pages have in terms of being able to visit this link and have data spit out based on a template.
I realise that custom post types sound perfect for this kind of thing. But I need users to be able to submit data from the front end, I'm not sure this is possible with Custom Post Types?
I think WP_Rewrite class is what you're looking for:
WP_Rewrite is WordPress' class for managing the rewrite rules that allow you to use Pretty Permalinks feature. It has several methods that generate the rewrite rules from values in the database. It is used internally when updating the rewrite rules, and also to find the URL of a specific post, Page, category archive, etc..
There are several examples in its documentation page. For a more hands-on tutorial check this blog article.
From what I've read so far, using custom database tables should be reserved to situations where the default tools can't handle the task.
The benefit of the default tools is that you don't have to create custom functionality (and all the details that come with it) to search, manipulate and display the data.
You could have a CPT called User Feedback, configured as hierarchical, each parent post corresponds to one user and the child posts would be the user input data.
Or it could be non-hierarchical and a custom taxonomy would make the bridge between posts and users.
After submission on front-end, you simply use wp_insert_post to add the info to the database as the post type (use title and content as holding fields if needed) and its associated meta data (other fields).
If you set the CPT supports argument to false, it won't show anything in the editing screen but the Publish meta box. And all the submitted information stored as meta data can be displayed by custom meta boxes.
After having this setup, if you need to fine tune the URLs, it's time to use WP_Rewrite.
That's how, in general terms1, JetPack manages the feedback from its Contact Form.
1 Checking the code, there's actually some interesting techniques used and worth replicating.
Related posts:
How to integrate custom database table in Wordpress and using Wordpress functions
WordPress 3.0 and Custom Post Types
When to (not) use a Custom Taxonomy

On html how to you increase var by one and save it

I have taken Web Design, but I never learned how to take a variable on a website and each time someone clicks on it to increase by one and save it so the next user will see var+1.
For example how facebook liking works
This is not a simple task done by HTML only.
You'll need a database to store the number of likes. Other technologies like PHP and Ajax should also be used. This post gives you a little explanation on how to implement such a system.
You need a database in the server, and use JavaScript to  POST an Ajax query to server, and on page request you'd need a server side scripting language (e.g. PHP) to query the database for the value of the variable and generate a HTML page with that value. It's not possible to do it with pure HTML.