I'm using a route query to pass a product ID through to my product page, allowing me to pull all of the related info in getInitialProps.
This works well until the page is refreshed, when the page is refreshed the query id is lost and the product info can no longer be pulled.
Is there a way to persist the query after refresh?
Thanks
Related
i built a small page to track a workflow with multiple steps. The page contains a form with submit button to start the flow. Each step sends back a status to the page. The page html is rerendered with res.render() then and sent to the server with res.send(html).
My problem now is, that when i use res.send(), the next status update gives a failure, because the response process is finished before.
Using res.write() instead crashes the page for whatever reason. I looks like the page is appended a second time (from a buffer??), instead of overwriting it.
Any ideas how to solve that??
Moe
I'm new to the world of databases and I've just started making my first DB powered site with php and MySQL.
I've got it working with data from one table but now I need to get a url to the users school, which is in a second table. Based on which school the user has saved in the first table. Everytime I try this method: http://www.w3schools.com/php/php_mysql_select.asp inside the registered.php the whole page goes blank. The connection to the database is made from a connect.php file which I included in both index.php and registered.php
Explanation, the user logs into the page at index.php, that page sets a cookie with the users school which it gets from the users table. The user gets redirected to registered.php where I want to get the school's url (and some more things) for the users school. It's very hard to explain, I hope you get it..
Thanks in advance!
I'd say that you have a problem in your PHP and not the database... you have some syntax error in your code and that's why you see a blank page. If you're doing this on your own machine, for development and debugging purposes you can configure PHP so that it prints errors out directly to the screen when you open the page in your browser instead of to the log.
You should also probably rethink your design as you should probably not store user details into a cookie (why not in $_SESSION, for example?), but I don't think that's a subject for this board...
After I changed the URL key in Category management in Magento from "shop" to "webshop"and later changed it back to "shop", the url of the category page now shows up like /shop-3.html Is there a way to go back to the original /shop.html?
FOUND THE SOLUTION: http://www.youtube.com/watch?feature=player_embedded&v=8xttr_ILd6A
Sometimes when you make changes to your products, or enable a certain extension, Magento might start to rewrite all your URLs to include a suffix "-1" or some other number. Within the URL Rewrites, Magento differentiates between System URLs and Custom URLs. If the System URLs are broken like this, you should not fix this by adding new Custom URLs.
Instead, open up phpMyAdmin, create a backup of your Magento database, and flush the Magento table core_url_rewrite (so that it becomes totally empty). Immediately afterwards, refresh the Catalog Url Rewrites under Index Management. This will regenerate all System URLs.
you can edit url write,i think there will be entry like /shop-3.html just change it is you want
http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index
and also refer
http://www.magentocommerce.com/knowledge-base/entry/what-url-rewrites-are-and-why-they-are-important
hope this will sure help you.
Simple answer
just delete url related to shop (custom and system generated), than run re-indexing it will work
And I don't want to use GET params.
Here are the details:
the user has a bunch of photos, and each photo must be shown by itself and have a unuique URL of the form
www.mysite.com/theuser/photoNumber-N
I create a unique URL for a user each time they add a new photo to their gallery
the web page that displays the user's photo is the same code for every user and every photo -- only the photo itself is different.
the user gives a URL to Person-A but then Person-A has one URL to that one photo and cannot see the user's other photos (because each photo has a unique URL and Person-A was given only one URL for one photo)
I want the following URLS to (somehow) end up loading only one web page with only the photo contents being different:
www.mysite/user-Terry/terryPhoto1
www.mysite/user-Terry/terryPhoto2
www.mysite/user-Jackie/JackiesWeddingPhoto
www.mysite/user-Jackie/JackiesDogPhoto
What I'm trying to avoid is this: having many copies of the same web page on my server, with the only difference being the .jpeg filename.
If I have 200 user and each has 10 photos -- and I fulfill my requirement that each photo is on a page by itself with a distinct URL -- right now I've got 2000 web pages, each displaying a unique photo, taking space on my web server and every page is identical and redundant disk-space-wasting HTML code, the only difference being the .JPEG file name of the photo to display.
Is there something I can do to avoid wasting diskspace and still meet my requirement that each photo has a unique URL?
Again I cannot use GET with parameters.
If you are on an Apache server, you can use Apache's mod_rewrite to accomplish just that. While the script you are writing will ultimately still be fetching GET variables (www.mysite.com/photos.php?id=photo-id), mod_rewrite will convert all the URL's served in the format you choose (www.mysite.com/user-name/photo-id).
Some ways you can implement it can be found here and here, while the actual documentation on the Apache module itself can be found here.
Go to IIS Manager. Go to the site hosted in IIS. Add additional binding for each url.
This will redirect all request the same location.
Is anything there in CodeIgniter to call a controller repeatedly? My problem is I am using a query to set the view count by using this query:
$this->db->set('user_views', 'user_views+1', FALSE);
$this->db->where('slug', $discussion_slug);
$this->db->update('forum_topics')
My site is at http://shinedesk.com/projects/MySeniorLivingGuide/development/forums. Please check the count of any one of the discussions listed in that page. Then click the discussion link to view that page. The problem is after viewing this discussion and checking the view count in the forums page, the view count gets increased by two.
You have addThis in your page, is it possible that the addThis server is trying to fetch your page, causing the additional request?
Try taking addThis out of the page and see if it still happens.