Session value lost after redirecting but it works on another hosting - web-hosting

Helo,
I'm having a problem with session variables. The session values lost after the page redirect to another.
I simplely used two pages for testing.
In the first page (test.php)-
<?php
session_start();
$_SESSION['test'] = 'SS';
header('location: test2.php');
?>
In the second page (test2.php)-
<?php
session_start();
echo $_SESSION['SS'];
?>
But there's no value on test2.php. Currently I'm testing on startlogic hosting and when I used the same pages
on different hosting, it worked. Is that really hosting problem? PHP version or web server (aparche) issue?
Thank you,
Den

On the test2.php you should have echo $_SESSION['test'] not $_SESSION['SS']. 'SS' was the value that you saved to the session variable and 'test' was the index.

Related

Joomla taks works with Friendly url OFF but do not with Friendly url ON

I have trouble with joomla 3.3.3 site. When my Firendly url is off this url with task works fine
<?php echo JText::_('EZWATCHLISTS_DELETE')?>
but when i turn ON Friendly url task is ignored.
NOTICE: When I look in file inspector I see link like this:
and when copy paste that link then task works fine.
Please help.
With Joomla, you should use the JRoue class which will take care of all your URLs for you, whether you have SEF enabled or disabled. So change you code to the following:
<a href="<?php echo JRoute::_('index.php?option=com_ezwatchlists&task=delete&rowid=' . $row->id); ?>">
<?php echo JText::_('EZWATCHLISTS_DELETE'); ?>
</a>
For more information, have a read of the following:
https://docs.joomla.org/Supporting_SEF_URLs_in_your_component
Hope this helps

Magento 1.91 CE - Customers Cant login

Hi all our website is Caged.eu and we have customised a Template from pre 1.9. Magento allows customer to register but when they try to sign in using that login details login page doesnt respond, this also happens when they ask to resend password it send reset details but still doesnt work.
Oddly the click facebook link to sign up login does work which is another extension we are ready to release but after getting it this well done would hate to have to change template.
Im sure its something stupid but would really appreciate your help guys
In Magento 1.9 the forms are unable to store the data as formkey missing. Try to add the key then you can be able to sign in. Add <?php echo $this->getBlockHtml('formkey'); ?> this at line no 41 below <form> tag in app/design/frontend/[your theme package]/[your theme]/template/persistent/customer/form/login.phtml
And check whether you can update product quantity in cart, there also formkey is missing.
Copy base/default/template/customer and base/default/template/persistent to your theme/template
After you had added the line <?php echo $this->getBlockHtml('formkey'); ?>
Perhaps you need to to flush magneto cache from magento admin (System->Cache management), then you can try the frontend customer login again.
As already replied in magento.stackexchange you should edit
/app/design/frontend/default/template-name/template/persistent/customer/form/login.phtml
and inside the "login form" form, after the
<ul class="form-list">
you should insert
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
and this will solve your problem, as it did with mine.
Hope this helps
so be it - manemoi
Theodore

Creating A Module Block For Magento's Welcome Message

I found this very nice tutorial here: http://www.phparrow.com/magento/magento-create-a-simple-module/ on creating a simple Magento Module. I was hoping I could figure out how to put Magento's default welcome message into a module. See, it appears Magento's default welcome message is part of the header because when you look at the layout with template paths turned on the welcome message doesn't have a template of it's own.
The reason I want to add the welcome message to a module is because my page cache caches the header and along with it the welcome message. The welcome message has "Welcome..." then "Welcome...(Customer Name)" then "Welcome...(not Customer Name?)" etc.
The page cache will cache what ever it happens to cache! I mean it might cache a customers name on one page and some other state on another page.
The code in the header.phtml is:
<p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?></p>
I need to somehow add this to a "module block" so I can tell my page cache not to cache this block. Understand?
The tutorial above explains how to create a module very well but it creates a "new page" and I need to some make a module for this welcome message.
Thank you

Invalid Email message is not showing in login page in magento

I'm currently working on making a login form in home page.
but after each invalid attempt the messages are not showing in proper place
i.e
The "invalid email and password " message showing in account dashboard and forgotpassword page.
This means that you have forgot to call group messages block in your template
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
I added the following line in my template and it works:
<?php $message1=Mage::app()->getLayout()->getMessagesBlock()
->setMessages(Mage::getSingleton('customer/session')
->getMessages(true))->getGroupedHtml() ; ?>
thanks for the help.
This means that you have forgot to call messages block in your template. add this code , its work for me
<?php echo $this->getMessagesBlock()->toHtml() ?>

no input file specified error in codignator

Hi I am using CodeIgniter 1.7.3 framework in my project. I have given URL for a link like this
base_url/index.php/admin/featuredlink/flid/11
, and when I click on this link I am getting an error like this
no input file specified.
But when I change that link to base_url/index.php?admin/featuredlink/flid/11 it works fine.
In my local system this link [base_url/index.php/admin/featuredlink/flid/11 ] works fine.
Why is this link [base_url/index.php/admin/featuredlink/flid/11] not working?
How do I get this link to work? If any one knows, please reply.
Make sure first that you are changing your $config['base_url'] from your local development address to your remote development address. This is located in application/config/config.php.
Also make sure you're using the right URL Helper function for your needs. Here's what I mean:
The site_url() function/method will always include index.php in your URIs. Here's an example using the site name http://example.com as your website's domain.
<?php echo site_url('home') ?> will turn into http://example.com/index.php/home
While base_url() function/method will always exclude index.php unless you include it. Here's an example using the site name http://example.com as your website's domain.
<?php echo base_url('home') ?> will turn into http://example.com/home
and
<?php echo base_url('index.php/home') ?> will turn into http://example.com/index.php/home
Keep in mind that using these functions/methods are only effective AFTER you have properly modified your .htaccess file. Follow the link below to remove index.php from your URIs by modifying your .htaccess file.
http://codeigniter.com/user_guide/general/urls.html
Keep in mind too that this can vary from host to host in the way that it needs to be formatted, so follow up on that with your hosting service. Most usually have guides that show you how to configure this properly.
Here is the link that shows you a more in-depth difference between the site_url() and base_url() functions.
http://codeigniter.com/user_guide/helpers/url_helper.html
I hope this helps!

Resources