I have an excel page with columns such as:
Col Col2 Col3
abc 1 3
def 4 5
hgi 9 5
and so on.
And I have various images in a folder with file names corresponding to 'Col' i.e. abc.jpg, def.jpg, etc.
I want to create a webpage with asks for a string from a user, searches it in Col1, then displays corresponding Col2, Col3, and the image corresponding to that Col1.
NOW, I'm not asking for what to do, but I just want to know HOW will I do this? What all tools/scripts/languages/software do I need to know to implement a system like this? I'll get to learning that straight away.
I have very little experience in web development hence a very noob-ish question.
Thanks a lot guys!
If you want to have the user enter the information on the Webpage itself, I would recommend JavaScript. JavaScript is a good enough language to do the stuff you want to do. For accessing Excel, you could always export the Excel file as a CSV (Comma Separated Values) or another format and read into your JavaScript. You can read a file in your JavaScript code using this link, for example.
Related
For the sake of simplicity, say I want to build a shopping list using Flask using a table in a format that looks like this:
Name
Cost
Amount
Sell-By
Apples
1
5
2022-07-18
Bananas
0.7
7
2022-07-20
I want the shopping list page to initially look like this, with a user able to add any number of items before submission
Name
Cost
Amount
Sell-By
(User input)
(User input)
(User input)
(User input)
When submitted each line should be able to be initiated as a SQLAlchemy object and saved into a database.
I've tried using FieldList and FormField from WTForms but can't quite get the hang of it (and don't really feel it's appropriate in this situation anyway). I don't usually struggle with forms, but having multiple instances of the same form AND trying to put that in a dynamically generated table is really tripping me up, so any pointers are welcome.
The content/size of a shopping list should be adjustable during writing.
Therefore i suggest you take a look at JavaScript and add a simple Button that generates a new row´each time you click it. Each row then contains the needed String or Number fields.
If you send the form you can simply move the entries to your Database
I have a text file with about 6700 tags that I would like to add to my Word Press site. Of course, it is not efficient to do this manually. Is it possible to automate the insertion of these tags?
I tried a few plugins like Smart Tag Insert, but these are ineffective and have low review scores. Additionally, I see that tags in my MyPHPAdmin panel are stored in the table wp_terms. I wanted to write an SQL script that does what I need. However, the table also stores a series of other values (like menu names). There is no way to identify rows in this table as tags and not something else (like the name of a menu). So, I am also confused about that too.
Thank you for your time and help!
You should loop through all the tags in the file and then use the wp_insert_term function to insert the tags into the database.
Documentation : https://developer.wordpress.org/reference/functions/wp_insert_term/
So the first argument is the tag term and the second one is post_tag.
Exemple:
wp_insert_term(
'tag_name', // the term
'post_tag', // the taxonomy
);
I am fetching results from a database table which contains the text of multiple pages.
These pages have links in their content.
I am trying to get all the links from the pages in a table, but I am also getting the unwanted text.
For example, this could be the content of a certain part of a page:
line 1: This is the link for lalalaal </a href="page5.html"> click</a>
line 2 if you want to go to page lalalala2 click
Now I only want the area starting from the <a href and ending at </a> in the result record. if there are more than 1 anchor tags in the text, then each anchor tag should be treated as a record.
the returned result should be like
ID value
1 ' click '
2 ' click '
I have tried the following queries :
Select * from [Database.tablename] where value between <a href and </a>;
Select * from [Database.tablename] locate '(<a href, Value)>0' and locate (</a>, value)>0;
but none of the 2 queries are giving me the wanted result...
This sort of text extraction is probably best addressed using regular expressions.
MySQL has some support (see here), but it could only be useful to identify which rows do have an <a></a> pair. Even identifying that there is at least one link inside a record doesn't help you extracting the (possibly many) links and treating them as different records themselves.
To successfully extract those links, at least according to my knowledge, you need a tool better suited to work with regular expressions. Most languages (Perl, PHP, Python, Java, etc.) support them, some natively, some using available libraries. You can select only records containing links (using REGEXP), and extract every link via code.
Another way of handling this would be performing the query on MySQL, exporting the results to a text file, and working on its contents with shell scripting (for instance, using sed under UNIX/Linux).
If you need it to be implemented using only MySQL, then my best guess is trying with a stored procedure (to be able to work on the results record-by-record.) I still cannot think of an implementation of such SP that guarantees detecting and successfully extracting every possible link inside a record as one record per link.
So.. I am a little confused on this problem myself so I am turning to the one place I know I am certain to find help!
I have a shopping cart where in order to purchase something a user must first fill out a form. At the end I am displaying the information they entered in the form along with the product they are purchasing, how much they are paying and any sort of modifiers the product might have (like size, color, shipping etc etc). I have a third party company that then needs to retrieve that information in a CSV file.
Any ideas on how this can be achieved. I am new at this sort of thing so I apologize if I may have missed this somewhere else on the forum.
Thanks!
Jamie
This is actually not too hard! A CSV files is just a comma separated values file.
Whatever you are using as a backend (PHP, c#, c) you can write to a file like so:
CustomerID, Name, Item1
1, John, Table
and that would appear in excel as CustomerID Name and Item1 as the header row and 1, John, Table as the first record. Make sure that when you create the file you call it MyFile.CSV so it is associated with Excel by windows!
Look here for how to properly format your CSV file!
http://creativyst.com/Doc/Articles/CSV/CSV01.htm
EDIT:
I see now you say HTML table so in the case you have no server code access I direct you here for more info.
Export to csv in jQuery
I need to design database with frontend as HTML.
This is my first attempt to do this.
What I need is,
- User can input a word from HTML page, click submit
I will query the word to get a URL from database and user sees that webpage(pointed by URL).
Just enter word, submit and get the webpage displayed.
People suggested using JSP/Access. I am new to everything.
Can you please point out what exactly I need to do?
Thanks a ton.
Following is the way you need to approach
Step1:
Create an HTML page which can take an input from the users
Step 2:
After getting the data from the user, create a connection to the database and pass the searched string as an input paramater.
Step 3:
You will get a result set from a database
Step 4:
Iterate through the result set and display in the html page, if you require the url to be given for those url, so when user clicks So that he will be directed to those websites.
Sample Query:
Select * from table1 where url_Word like '%Search_String'
This will be the procedure that you need to follow to complete your work.
You do not need a database you need a text file. If this is a school project you need more information.