|
Hi,
I have the following in my meta.php include file:
<meta name="DC.title" content="MyWebSiteName" />
it's the same for all except few file where I will have:
<meta name="DC.title" content="MemberName" />
is it possible to keep the:
<meta name="DC.title" content="XoomPage" />
in the meta.php include file but override it with:
<meta name="DC.title" content="XoomPage" />
in other specific pages?
How?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
I have a PHP project. I want to know what's the best way to save the date for a post in MySQL so it can be shown in a local time of the user.
For example if the local time in 00:00 in UAE and it's 09:99 in USA and a user in based in UAE created a post it will show created in 00:00 but if a user based in USA viewed the same post it will show created in 09:00
I am not sure how to explain this more but hope it's clear..
Thanks
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Always (and I do mean always) store dates and times as UTC values. Only when you need to display them should you apply the local time zone offset of the user's system. How you do this depends on your application and language, and making the effort to do a little research for yourself would quickly lead you to http://www.w3schools.com/php/func_date_localtime.asp[^].
Veni, vidi, abiit domum
|
|
|
|
|
thanks Richard. One more question please..
I am currently using timestamp field in MySQL as created_date and assigning a default value CURRENT_TIMESTAMP.
Is it possible to use UTC_TIMESTAMP() for the timestamp's default value?
Thanks
Technology News @ www.JassimRahma.com
|
|
|
|
|
Sorry, I don't know, but I'm sure Google will find you some suggestions.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
I am trying to get an INOUT parameter from MySQl using PHP and PDO but getting:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1414 OUT or INOUT argument 2 for routine xoompage.sp_send_password_reset is not a variable or NEW pseudo-variable in BEFORE trigger' in C:\xampp\htdocs\xoompage\password_reset.php:17 Stack trace: #0 C:\xampp\htdocs\xoompage\password_reset.php(17): PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs\xoompage\password_reset.php on line 17
here is MySQL sp:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_send_password_reset`(IN param_member_guid varchar(255), INOUT param_password_reset_guid varchar(255))
BEGIN
DECLARE param_password_reset_guid varchar(255);
SET param_password_reset_guid = UUID();
UPDATE members SET password_reset_guid = param_password_reset_guid, password_reset_date = DATE(NOW()) WHERE member_guid = param_member_guid;
END
and this is the PHP:
$mysql_query = $mysql_connection->prepare("CALL sp_send_password_reset(:param_member_guid, :param_password_reset_guid)");
$mysql_query->bindParam(':param_member_guid', $_SESSION["member_guid"], PDO::PARAM_STR);
$mysql_query->bindParam(':param_password_reset_guid', $password_reset_guid, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
$mysql_query->execute();
Technology News @ www.JassimRahma.com
|
|
|
|
|
I am new to MVC4. I am trying to issue ajax call on the button click to receive partial view with the loaded dropdown list. It looks like Ajax call never reaches controller's method GetMyList(). What is wrong with my code ? Thank you
//in mypage.cshtml
@model IEnumerable<MyProject.Models.MyModel>
@{
ViewBag.Title = "MyPage";
Layout = "~/Views/Shared/_MyLayout.cshtml";
}
<div>
....
<div>
<button id="btnGetList">Find</button>
</div>
<div id="divWithPartialView">
@Html.Partial("_MyPartialView", Model) // displayed on initial page load
</div>
...
</div>
@section MySection{
<script type="text/javascript">
$('#btnGetList').on('click', function (event) {
alert("go get list"); // shows up
var myName = "Jo";
$.ajax({
type: "POST",
url: "Main/GetMyList",
data: myName,
success: function (data) {
alert("list is here"); //does Not show up
$("#divWithPartialView").html(data);
}
});
alert("after ajax"); //shows up
})
</script>
}
// Controller
namespace MyProject.Controllers
{
public class MainController: Controller
{
............
[HttpGet]
public ActionResult MyPage()
{
List<MyModel> myList = new List<MyModel>();
return View(myList);
}
public ActionResult GetMyList(string myName)
{
MyModel mm = new MyModel();
List<MyModel> myList = mm.GetNames(myName); // using search criteria entered on the previous Application page
return PartialView("_MyPartialView", myList);
}
}
}
//Partial View: _MyPartialView.cshtml
@model IEnumerable<MyProject.Models.MyModel>
<label>Select your name:</label>
<select id="lstNames">
<option value="0">- select name -</option>
@foreach (var name in Model)
{
<option value="@name.id">@name.myName</option>
}
</select>
//Model
public class MyModel
{
public int id { get; private set; }
public string myName { get; set; }
public List<MyModel> GetNames(string myName)
{
List<MyModel> myList = new List<MyModel>();
//code to find names that start with "Jo"
return myList;
}
}
|
|
|
|
|
|
Hi,
I want to ask how can I set the following in PHP with the current date to expire the page immediatelly?
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
I am using the following code to read the session variable and set it as value for input textbox:
value="<?php if ($_SESSION["activation_email"] != NULL) echo $_SESSION["activation_email"]; ?>"
it was set in another code like this:
$_SESSION["activation_email"] = $member_email;
but I am getting the following error inside the textbox:
<br />Notice: Undefined index: activation_email in C:\xampp\htdocs\xoompage\activation.php on line 21<br />
just a note that the above error is NOT shown every time... it's just sometimes but I am not sure why?
Technology News @ www.JassimRahma.com
|
|
|
|
|
The error message said that it could not find a session variable with index as 'activation_email', i.e $_SESSION['activation_email'], suspect typo in those pages that show error.
|
|
|
|
|
Hi,
I am getting problem in rebind radgrid on radwindow close because i have to rebind 3 grid on parent page. It is rebinding just last grid which i have mentioned in code.
Following code i have used in my code
///------ In radwindow javascript code -------
function clientClose(arg) {
getRadWindow().close(arg);
var oWin = getRadWindow();
var parentWindow = oWin.BrowserWindow;
// top.location.href = top.location.href;
parentWindow.refreshGrid();
}
/// ---------In parent page javascirpt code -----
function refreshGrid() {
var masterTable1 = $find("<%=rgDefinition.ClientID%>").get_masterTableView();
var masterTable2 = $find("<%=rgDevelopment.ClientID%>").get_masterTableView();
var masterTable3 = $find("<%=rgTesting.ClientID%>").get_masterTableView();
masterTable1.rebind();
masterTable2.rebind();
masterTable3.rebind();
}
Problem is that ---- this code rebinding my last grid means masterTable3.rebind(); because it is in the last of code.
|
|
|
|
|
|
Hello Everyone,
I want to create a website like https://www.pdftoword.com/ or http://www.clipconverter.cc/ using PHP.
For this purpose, what should i do?
for ex:
1> Do i need to create a software and install that on server to convert a file? Then after uploading that file to server and then by using that software for conversion and giving it back to user using link?
If 1 is correct,Then do i need to buy my own server for this purpose or hosting companies give this option to install software ?
If you can, Please give a useful link regarding this topic.
I want to know the procedure for creating these kind of services.
Thank you
Money
|
|
|
|
|
Moneyzz Sharma wrote: Do i need to create a software and install that on server to convert a file? Yes, if you want to provide the service on the internet then you must use a web server. You could buy your own, but it is usually far easier to buy space from a hosting company. To learn PHP go to http://www.w3schools.com/php/[^].
Veni, vidi, abiit domum
|
|
|
|
|
Thing is not PHP. I want ask about the software that i need for conversion. Will the hosting provide me a option to install the software at the server?
I was not able to find a single tutorial on this on web
|
|
|
|
|
Moneyzz Sharma wrote: Thing is not PHP
Your original question stated:
Quote: I want to create a website like https://www.pdftoword.com/ or http://www.clipconverter.cc/ using PHP.
Sp maybe you should explain your problem in clearer detail.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
I have a 3 step survey, from where in on each step we are collecting some values.
Each step is created as a panel, and set visible to false, enabling them in the code as required.
On Step 3, there are about 5 questions the user needs to complete, upon which an account is created. So, on the button click of this final step, for some reason all the values in this panel are lost when i try to get the values,
CheckBoxList chkbxChk = (CheckBoxList)pnlQuestions.FindControl("cbl_" + qa.questionid);
It appears as though on button click does not remember the values from panel?
any ideas?
Thanks!
|
|
|
|
|
Hi,
in PHP, how can I check if the QueryString $_GER
1. Exists in the url.
2. Exists with value
3. Exists without value
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
This article may help: http://www.codeproject.com/Tips/677867/Code-Experiment-on-_GET
|
|
|
|
|
if the url has "http://www.example.com/index.php?solution=solved"
You can check:
if(isset($_GET['solution']))
echo 'its set And the value of "solution" is: ' . $_GET['solution'];
else
echo 'NOT set! ;
|
|
|
|
|
Hi,
I need to create a graph (a linear graph) in a project of mine.
My company only uses IE8.
I checked over the net and saw that SVG is not supported in IE8 however I'm seeing SVG when I'm surfing in IE8 (when I look in the source ) so I don't understand the contraindication.
Is SVG supported or not and if not, is there a way for me to create a linear graph? I saw an example using CSS but it's too complicated and I wanted to know if there's something simpler.
Thanks
|
|
|
|
|
Regardless of IE version, creating SVG using IT is not an option. I can't imagine what you mean by "IE" in terms of creating anything. "Save As" possibly? But anyway, per SVG, check out:
http://inkscape.org/download/[^]
Tons of fun. Coming your way. SVG away!
|
|
|
|
|
Thank you for the resposne but I didn't get an answer to my question.
I can see the SVG works on IE in different versions.
My question is again regarding IE8.
Using an open source editor is not an option in my situation.
If you look at sites that do use SVG with IE8 compatibality mode it does display them. I want to know how it is done.
I found a JS library that I'm going to check:
http://raphaeljs.com/[^]
I'll update...
Thanks
|
|
|
|