Store web address in MySQL and display as link in HTML - mysql

I am a PHP newbie, but I'm making progress. I have made a small mysql database and PHP form that I am using to populate a web page that shows the upcoming gigs for a musician. It shows the date, venue, etc. and works fine.
What I'm trying to add is this: I want to be able to store the web address of the venue in the database and then use that address as the href for and anchor tag that says VENUE INFO. I've called the column maplink and set it up like all my other variables. When I insert the web address in my form it gets recorded to my database as text "maplink" (no quotes) instead of the web address that I entered.
Also the HTML I'm trying to use is
<p>VENUE INFO</p>
which I'm sure is terribly wrong.
I'm using PHP 5.3.8 and MySQL 5.5.16. Any help on how to go about this?

During insert into the database, you may have forgotten to append $ symbol to maplink to make it a variable.

Related

Storing value of one HTML page and storing in database and using it again in another HTML page

I want to know that as I am using a number of HTML pages with different JavaScript codes and in one HTML page it shows total sales (the value will be entered by user) column which is multiplied by price (value will be entered by user) which will show the answer in next column. I want to use that answer in my next HTML page automatically or just by clicking one button by user.
How can I do that? Do I have to link .js file in script tag in another HTM page or I have to store the answer in database if I have to store. And if I have store answer in database how can I use it in another HTML page?
If you want to store data into a database. you need to use PHP and SQL. I recommend PDO and mysql.
Here is a w3c page on how to setup a connection:
connection to MYSQL with PHP

MySQL Search / Replace - Switching root domain on Wordpress Multisite

I have a Wordpress Multisite installation, and the root domain is set to root-domain.com. I would like to switch it with one of the sites of the network (site-in-network.com), and make it a root domain.
This way site-in-network.com would become the root domain, and root-domain.com would become one of the sites in the network (100+ sites).
I've done search and replace on a database before, and it worked, but I was dropping a domain all together, so I just replaced domain-a.com with domain-b.com. This time it is different, I want to keep both of them, and just switch the positions in the database.
I guess I would need to run a MySQL query. As far as I know, the root domain was set to something like "www.root-domain.com", and all other sites in the network were like "site-in-network.com" (without the .www part)
The database is about 0.5GB, so it would be good to get it right the first time.
Thank you in advance for any info.
It can be done with a search and replace, but mind you that wordpress is also storing site information in a serialized form in the tables. That means that a default search and replace will break a lot of stuff, so be careful with that.
There is however a script that takes this into account: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Download it and put it in your root folder. (And afterwards, delete it!!)
Using this script you could change root-domain.com to root-domain.tmp.com and then site-in-network.com to root-domain.com. After that you could rename root-domain.tmp.com to site-in-network.com. Basicly what Plamen Nikolov suggested to do in the first place.
Here is a little bit of a craftily solution:
You can still workaround the situation with the find and replace technique using fake domain name:
Replace site-in-network.com with some-fake-unique-name.com
Replace root-domain.com with site-in-network.com
Finally some-fake-unique-name.com with root-domain.com.
There is also solution without changing the database, by definining HOME and SITE URL like here: Changing the Site URL

how to remove result set from html page

I have a MySQL database, and few perl scripts using which i am generating the webpages.
On Html page links are available,
For example-
Customer_link => (calls customers.pl) query executed - select * from customers.
Now there is one more link say Customer_in_mumbai => it should remove all the customers whose city is not mumbai.
How to achieve that?
do i need to execute the query once again with where clause or any other way is also possible so that i can simply remove the customers whose city is not mumbai?
Also if i need to execute the query again, do i need to write one more perl file, if not how can i use the same file?
You can use Javascript to manipulate on the client side of things after it's been loaded/displayed. There's nothing you can do on the server side to change a page once it's been downloaded without Javascript.
The rest of your questions indicate a lack of familiary with how dynamic web pages are generated. You can have a single page that does all that, using standard HTTP query variables to modify how the script operates. e.g.
http://example.com/yourscript.pl?remove=mumbai
then have Perl retrieve that remove value and use it to modify how the database query runs. But showing you that is beyond the scope of this site - we're not here to teach you, just help fix problems.
From your question, it seems you only want to remove it from the page temporarily for the user. You can achieve that simply by remove rows with mumbai as a value with Javascript. That should save you server side processing. Use a Library like JQuery to achieve it easily.

Populating a HTML form with saved values for testing

Does anyone know of a browser plugin or application that will save form values then populate the same form when required?
Let me explain what I mean. I'm currently working on the registration page of a web application. As you can imagine it's quite long and I have to keep filling it out. I can fill it out reasonably quickly using values already entered by tabbing through the fields and hitting the down arrow. But, it's not fast enough! Ideally I'd like to enter the form values, then somehow save all the values under a name. E.g. "Valid registration". When I come back to the page I'd like to select my saved "Valid registration" form values and have the whole form populated automatically.
I've tried things like Web Developer but they are no good, they don't populate a form with valid data.
EDIT
I've also looked at autofill forms which is better, but still requires a lot of set up for a long form containing non standard fields.
hi this is Rahul Mandaliya.
some time ago i had faced that problem , and i got the answer , i used RoboFill software for store some data like user name , password and other .
i think you have to download this software.
i have put link for Download is : http://www.roboform.com/dist/RoboForm-Setup.exe
if did not get this software from above link , you have to manually go to www.roboform.com and Download this software.
A colleague pointed out that you can use Selenium IDE for this purpose. It's not really what it's intended for but it works like a charm.
Simply record yourself entering some details on the form, save it as something meaningful (e.g. "RegistrationValid" or "RegistrationInvalidPostcode") then you can run it whenever you like to auto populate the form. The only negative point is that the plugin is Firefox only.
You can download the plugin here: http://seleniumhq.org/download/

Plone and Mysql Searching

I have Mysql and Zope talking to each other nicely.
I can insert values in, and even view one record from the databse and have it show up in the form fields(not that cool really).
I have just been following tutorials, but now I need to search the Database and display the results.
I have been fiddling with this for a while but I haven't gotten far.
I know that using a Zope Page template we can call the Zsql method and show the results with TAL, but I need to some how using a script and a redirect form the search form pass the search data.
Can anyone help we get started?
Can anyone show me a way to do it with formgen and a custom script adapter?
Go into your ZMI, and add a "Z Search Interface" object in the same folder as your ZSQL method. Your ZSQL methods should show as "searchable objects". Select the ZSQL method you want, fill in the rest of the fields, and it will generate form and display page templates. Then modify the templates to taste.