how to access profile after login?
im having trouble accessing profile page after login and I also have
another problem I have login data such as email and password in a
different database and table name profile information is in another
database and table name how can they be connected to retrieve profile
information how can these problems be resolved?
here is my login php
<?php
include('com.php');
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// username and password sent from form
$email=$_POST['email'];
$password=$_POST['password'];
// To protect MySQL injection (more detail about MySQL injection)
$email = stripslashes($email);
$password = stripslashes($password);
$email = mysql_real_escape_string($email);
$password = mysql_real_escape_string($password);
$sql="SELECT * FROM $tbl_name WHERE email='$email' and
password='$password'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $email and $password, table row must be 1 row
if($count==1){
// Register $email, $password and redirect to file "report.php"
session_register("email");
session_register("password");
header("location:profile.php");
}
else {
echo "Wrong Username or Password";
}
?>
Monday, 2 September 2013
PYRO_ENV variable in htaccess is not triggering development / production environment
PYRO_ENV variable in htaccess is not triggering development / production
environment
I have setup PyroCMS as described here:
http://docs.pyrocms.com/2.2/manual/setup/environments
I have used the RewriteCondition in Htaccess to automatically determine
and set the PYRO_ENV variable:
RewriteCond %{HTTP_HOST} ^dev.xyz.com$
RewriteRule (.*) $1 [E=PYRO_ENV:development]
RewriteCond %{HTTP_HOST} ^test.xyz.com$
RewriteRule (.*) $1 [E=PYRO_ENV:staging]
RewriteCond %{HTTP_HOST} ^xyz.com$
RewriteRule (.*) $1 [E=PYRO_ENV:production]
I'm not using Nginx.
How it should work? Depending on whether you open xyz.com (production) or
test.xyz.com (staging) it should accordingly set the global:environment
variable and choose the right database connection in database.php.
Issues: - When opening xyz.com (production site), it shows for some
variables "production" and for others "development":
_REQUEST["www_pyrocms_development"]
2MH5lsDV3Cb3YK+6IcCrFaIH6Aeu98rIwKcgAaTcFnQsB5Vwn9ySGb3R3QfNTqvMoJsrfjDXv/PLdfYrVjr/IOREQhQIvsa1E+mozs5gYH6lC1+/mORDm2pN//InQBHTJGQsr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xqCXswrY0GD%2FbDfVvz16Ru07J8Y1z9v4Ye2hF8z7TiwomPIQgyiP%2BRSaOAebVRpF103KQvgjJjL5oSaywHiqX7noLEqQRsMjjaZFKMOgIpbtJoilytKby1TrdezhK4cFu%2FKq1vTExhTXHQkIODp%2FofbtNnSZB4pNh5RXdv4hIBM%3D;
www_csrf_cookie_name=ced9bc01dc6439bdb4716964fe037173;
www_identity=info%40xyz.com;
www_remember_code=76aec0ab8b6b09091c1659bcf72d962b5337e226;
web6_SID=89280348f350ecae51a672da350d8b7c;
__utma=163786799.1178091424.1375554048.1375566051.1375568373.5;
__utmb=163786799.3.10.1375568373; __utmc=163786799;
__utmz=163786799.1375554048.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
PyroCMS doesn't take the right database connection though I setup
different databases for production and staging in database.php.
Also the global:environment tag doesn't work. When I use the following tag
in the CMS, it doesn't show the text on the frontend: {{ if
global:environment == 'production' }} // Production-only content {{ endif
}}
I assume that the htaccess setting above doesn't trigger the right
environment to my server. Does anyone has an idea?
Thank you,
Philip
environment
I have setup PyroCMS as described here:
http://docs.pyrocms.com/2.2/manual/setup/environments
I have used the RewriteCondition in Htaccess to automatically determine
and set the PYRO_ENV variable:
RewriteCond %{HTTP_HOST} ^dev.xyz.com$
RewriteRule (.*) $1 [E=PYRO_ENV:development]
RewriteCond %{HTTP_HOST} ^test.xyz.com$
RewriteRule (.*) $1 [E=PYRO_ENV:staging]
RewriteCond %{HTTP_HOST} ^xyz.com$
RewriteRule (.*) $1 [E=PYRO_ENV:production]
I'm not using Nginx.
How it should work? Depending on whether you open xyz.com (production) or
test.xyz.com (staging) it should accordingly set the global:environment
variable and choose the right database connection in database.php.
Issues: - When opening xyz.com (production site), it shows for some
variables "production" and for others "development":
_REQUEST["www_pyrocms_development"]
2MH5lsDV3Cb3YK+6IcCrFaIH6Aeu98rIwKcgAaTcFnQsB5Vwn9ySGb3R3QfNTqvMoJsrfjDXv/PLdfYrVjr/IOREQhQIvsa1E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mKwHoJKCdYRCytWZ8z6y1HT3TQDMUOij3xqCXswrY0GD%2FbDfVvz16Ru07J8Y1z9v4Ye2hF8z7TiwomPIQgyiP%2BRSaOAebVRpF103KQvgjJjL5oSaywHiqX7noLEqQRsMjjaZFKMOgIpbtJoilytKby1TrdezhK4cFu%2FKq1vTExhTXHQkIODp%2FofbtNnSZB4pNh5RXdv4hIBM%3D;
www_csrf_cookie_name=ced9bc01dc6439bdb4716964fe037173;
www_identity=info%40xyz.com;
www_remember_code=76aec0ab8b6b09091c1659bcf72d962b5337e226;
web6_SID=89280348f350ecae51a672da350d8b7c;
__utma=163786799.1178091424.1375554048.1375566051.1375568373.5;
__utmb=163786799.3.10.1375568373; __utmc=163786799;
__utmz=163786799.1375554048.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
PyroCMS doesn't take the right database connection though I setup
different databases for production and staging in database.php.
Also the global:environment tag doesn't work. When I use the following tag
in the CMS, it doesn't show the text on the frontend: {{ if
global:environment == 'production' }} // Production-only content {{ endif
}}
I assume that the htaccess setting above doesn't trigger the right
environment to my server. Does anyone has an idea?
Thank you,
Philip
ActiveReport Truncate A Text
ActiveReport Truncate A Text
I make a Report in ActiveReport3.0 which has a Subreport. In my subreport,
in the Detail part actually, I have a textbox , that I bind my value to
the textbox.datafield. my value is a text in persian and it is also
long(about 8000 words).( I read the Value from Sql).I set the alignment of
the textbox to "rtl" because my text is in persian. then when I run my
app, the activereport truncate my text in persian (truncate it from left
and right of the textbox not at the bottom).what is the problem?
I make a Report in ActiveReport3.0 which has a Subreport. In my subreport,
in the Detail part actually, I have a textbox , that I bind my value to
the textbox.datafield. my value is a text in persian and it is also
long(about 8000 words).( I read the Value from Sql).I set the alignment of
the textbox to "rtl" because my text is in persian. then when I run my
app, the activereport truncate my text in persian (truncate it from left
and right of the textbox not at the bottom).what is the problem?
Suitable Design pattern for building a 3D model
Suitable Design pattern for building a 3D model
I have implemented a 3D model application using DirectX api and C# .NET.
Initially started with an intention to make the 3D model working and by
now, all the code logic and UI stuff everything is in one *.cs file i.e.,
in main form.
Could you please anyone suggest me which design pattern is suitable for
segregating my code in a proper way?
As MVVM (Model-View-ViewModel) pattern is suitable for WPF application, Im
under the impression that the same design pattern can be suitable for 3D
rendering application.
Please suggest me if any other design pattern is well suitable for my 3D
modeling application. Thanks in advance.
Regards, Kumar
I have implemented a 3D model application using DirectX api and C# .NET.
Initially started with an intention to make the 3D model working and by
now, all the code logic and UI stuff everything is in one *.cs file i.e.,
in main form.
Could you please anyone suggest me which design pattern is suitable for
segregating my code in a proper way?
As MVVM (Model-View-ViewModel) pattern is suitable for WPF application, Im
under the impression that the same design pattern can be suitable for 3D
rendering application.
Please suggest me if any other design pattern is well suitable for my 3D
modeling application. Thanks in advance.
Regards, Kumar
Sunday, 1 September 2013
how to calculate the distance between two points and find the fare accordingly
how to calculate the distance between two points and find the fare
accordingly
jcJobNo.setText(Contsants.Jobno);
jcStartTime.setText(Contsants.jobStartTime);
jcEndTime.setText(Contsants.jobEndTime);
// total distance finding here
float totalKm = Contsants.jobEndKm-Contsants.jobStartKm;
jcTotalKms.setText(Float.toString(totalKm));
//jcTotalKms.setText(Float.toString((float) (totalKm/16.0)));
//finding total fare here
float totalfare=totalKm *16;
jcTotalFare.setText(Float.toString(totalfare));
here is a simple code for calculating the distance between two points and
calculate the fare according to the distance. But i din't get exact fare
value and the output is in negative. I don't know how to resolve this
error. If any one knows please help me.
accordingly
jcJobNo.setText(Contsants.Jobno);
jcStartTime.setText(Contsants.jobStartTime);
jcEndTime.setText(Contsants.jobEndTime);
// total distance finding here
float totalKm = Contsants.jobEndKm-Contsants.jobStartKm;
jcTotalKms.setText(Float.toString(totalKm));
//jcTotalKms.setText(Float.toString((float) (totalKm/16.0)));
//finding total fare here
float totalfare=totalKm *16;
jcTotalFare.setText(Float.toString(totalfare));
here is a simple code for calculating the distance between two points and
calculate the fare according to the distance. But i din't get exact fare
value and the output is in negative. I don't know how to resolve this
error. If any one knows please help me.
Jquery applying class and removing class
Jquery applying class and removing class
The code which changes the active class to the currently clicked
pagination class. Removing it works but adding the new class doesn't work.
http://jsfiddle.net/spadez/qKyNL/35/
$('a').click(function(event){
event.preventDefault();
var number = $(this).attr('href');
$.ajax({
url: "/ajax_json_echo/",
type: "GET",
dataType: "json",
timeout: 5000,
beforeSend: function () {
$('#content').fadeTo(500, 0.5);
},
success: function (data, textStatus) {
// TO DO: Load in new content
$('html, body').animate({
scrollTop: '0px'
}, 300);
// TO DO: Change URL
$('#pagination li.active').removeClass("active");
$(this).parent().addClass("active");
},
error: function (x, t, m) {
if (t === "timeout") {
alert("Request timeout");
} else {
alert('Request error');
}
},
complete: function () {
$('#content').fadeTo(500, 1);
}
});
});
Can anyone please tell me where I am going wrong?
The code which changes the active class to the currently clicked
pagination class. Removing it works but adding the new class doesn't work.
http://jsfiddle.net/spadez/qKyNL/35/
$('a').click(function(event){
event.preventDefault();
var number = $(this).attr('href');
$.ajax({
url: "/ajax_json_echo/",
type: "GET",
dataType: "json",
timeout: 5000,
beforeSend: function () {
$('#content').fadeTo(500, 0.5);
},
success: function (data, textStatus) {
// TO DO: Load in new content
$('html, body').animate({
scrollTop: '0px'
}, 300);
// TO DO: Change URL
$('#pagination li.active').removeClass("active");
$(this).parent().addClass("active");
},
error: function (x, t, m) {
if (t === "timeout") {
alert("Request timeout");
} else {
alert('Request error');
}
},
complete: function () {
$('#content').fadeTo(500, 1);
}
});
});
Can anyone please tell me where I am going wrong?
run command from folder via cron
run command from folder via cron
I wrote this task for cron:
0 * * * * cd ~/projects/stat-eprorok-rails4/current && rvm use 2.0.0 do
bundle exec rake vk_posts:update_likes RAILS_ENV=production
I do not understand why the task is not performed every hour, because this
script works:
cd ~/projects/stat-eprorok-rails4/current && rvm use 2.0.0 do bundle exec
rake vk_posts:update_likes RAILS_ENV=production
I wrote this task for cron:
0 * * * * cd ~/projects/stat-eprorok-rails4/current && rvm use 2.0.0 do
bundle exec rake vk_posts:update_likes RAILS_ENV=production
I do not understand why the task is not performed every hour, because this
script works:
cd ~/projects/stat-eprorok-rails4/current && rvm use 2.0.0 do bundle exec
rake vk_posts:update_likes RAILS_ENV=production
Subscribe to:
Posts (Atom)