|
Hi,
I have a field called created_date in MySQL with UTC_TIMESTAMP values in it
I want to know how can I display the records for that field in the local date/time of the user depends on where he?
Thanks
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
I have the following code to check if the user is_administrator then show the two menu items, otherwise of course it won't show... kindly simple! but the problem is.... when I uploaded the pages to my web host, even if the user is not administrator the menu items are shown! the value for is_administrator in MySQL is a bit = 0 but when I do a var_dump I get bool(true) although I get the correct var_dump and behavior on my local pc string(1) "0"
this is the menu items:
<?php if ((bool)$_SESSION["blended_learning_is_administrator"] = true) { ?>
<tr><td><button id="btnManageUsers" type="button" style="width: 100%;">Manage Users</button></td></tr>
<tr><td><button id="btnNewUser" type="button" style="width: 100%;">New User</button></td></tr>
<?php } ?>
and this is the is_administrator:
while ($mysql_row = $mysql_query->fetch())
{
$_SESSION["blended_learning_user_name"] = $mysql_row["user_name"];
$_SESSION["blended_learning_is_administrator"] = $mysql_row["is_administrator"];
exit(header("Location: " . $_SESSION["blended_learning_domain_name"] . "mypage"));
}
Technology News @ www.JassimRahma.com
|
|
|
|
|
I think you need to use the '==' double equals sign to check for equality. One equals sign will assign the value to the variable.
vbmike
|
|
|
|
|
Well, your problem is that you assign the value true to $_SESSION["blabla"] . I.e. it cannot work!
SolutionA:
<?php
if($_SESSION["blended_learning_is_administrator"] == true) {
}
SolutionB:
<?php
if($_SESSION["blended_learning_is_administrator"] === true) {
}
The difference between SolutionA and B is, that B also checks if $_SESSION["bla"] is of the same type as true, i.e. bool/boolean.
|
|
|
|
|
Hi,
I have an Online PHP project which will use both MySQL and Oracle databases.
Which linux distribution you recommend?
Thanks
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
how can i check the email is real or not in php?
real not valid ok?
|
|
|
|
|
The simplest way would be to authenticate the given address via a confirmation mail. But even then you cannot be sure that the given address is a "real" one. There are enough throwaway mail providers out there, to make your head spin.
|
|
|
|
|
use php preg
"|^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$|"
|
|
|
|
|
The author was looking for a way to check if the given email address was real. Not for a pattern to validate the string.
|
|
|
|
|
i am working on a project and on a page i get this error.
Parse error: parse error in C:\wamp\www\RMS\comresult.php on line 143
line 143 is the last line of my code.
Please i need help.
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome :: Result Portal</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
background-color: #FFF;
}
</style>
<script type="text/javascript">
function bk(){
location.assign(document.referrer);
}
var state = true;
function getstate(){
return state;
}
</script>
</head>
<body onload="print()">
= $mysqli-real_escape_string(trim($_GET['lev']));
$sem = $mysqli->real_escape_string(trim($_GET['sem']));
$prog = $mysqli->real_escape_string(trim($_GET['prog']));
$sess = $mysqli->real_escape_string(trim($_GET['sess']));
$sql = "SELECT * FROM course_tb WHERE level LIKE '".$level."' AND semester LIKE '".$sem."'";
if($result = $mysqli->query($sql)){
if($result->num_rows > 0){
$sel = "SELECT DISTINCT regno FROM st_result_data WHERE level LIKE '".$level."' AND semester LIKE '".$sem."' AND programme LIKE '".$prog."'";
if($res = $mysqli->query($sel)){
if($res->num_rows > 0){
//$sel2 = "SELECT * FROM st_result_data WHERE regno LIKE '".$row['regno']."' AND level LIKE '".$level."' AND semester LIKE '".$sem."' AND programme LIKE '".$row['programme']."'";
//if($res2 = $mysqli->query($sel2)){
//if($res2->num_rows > 0){
?>
<table width="700" border="0" cellpadding="0" >
<tr>
<td align="center" style="border-bottom: 1px dashed #CCC;"></td>
</tr>
<tr>
<td height="27" style="border-bottom: 1px dashed #CCC;">
<table width="600" border="0" align="center" cellpadding="0">
<tr>
<td align="center"><h4> SEMESTER RESULT SESSION </h4></td>
</tr>
</table>
<span id="regerr"></span></td>
</tr>
<tr>
<td height="27" style="border-bottom: 1px dashed #CCC;"><table width="650" border="0" align="center" cellpadding="0">
<tr>
<td style="border-bottom: 1px dashed #CCC;">Regno</td>
<td style="border-bottom: 1px dashed #CCC;">Name</td>
<td style="border-bottom: 1px dashed #CCC;">
=$result-fetch_array()){
?>
<table>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
= $res2-fetch_array()){
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td style="border-bottom: 1px dashed #CCC;"><table width="600" border="0" align="center" cellpadding="0">
<tr>
<td width="177">No of courses:</td>
<td width="417"> </td>
</tr>
<tr>
<td>No of fail:</td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><input type="button" name="button" id="button" value="Print" onclick="print()" /></td>
</tr>
</table>
error;
//}
}
}
}
}echo $mysqli->error;
}
?>
</body>
</html>
|
|
|
|
|
|
pls i want to know how to go about how my webpage can respond to sms sent to it from a mobile device
|
|
|
|
|
|
Is it possible to read a word document using COM? How to enable com in php5.4.19
|
|
|
|
|
I'm a relative new beginner to PHP installs. I have permissions set for the users and the directories and the temp directories. The PHP.ini file is set to use the ftproot directory as the temp directory instead of the windows temp as well.
My problem is I keep getting Error Code 6 on the ftp upload (no temp directory). This leads me back to something I did wrong with the permissions or the directories.
Can someone with greater knowledge of PHP setups help guide me to what to check again?
Thanks in advance.
Rottie
Update 2-25-14
In response to the message deleted:
The upload limit is set to 100M in both the POST_MAX_SIZE and the UPLOAD_MAX_FILESIZE. I'm getting the FILE(name) populated, but a blank FILE(tmp_name) with a FILE(error) code of 6. Did I miss a size setting?
I'll keep reading and trying things.
If anyone has any ideas, please let me know.
Thanks.
modified 25-Feb-14 5:56am.
|
|
|
|
|
i need script that record audio and video of the user and give me the uploaded file link
any client side like flash or jquery is good even php script
|
|
|
|
|
Hi friends :
when I change alias and directoy in httpd.conf file in wampserver 2.4 as below and restart all services its Icon become yellow !
what should I do?
thanks.
Alias /myText/ "C:/myText/"
Alias /myText "C:/myText"
<Directory "C:/myText/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
|
|
|
|
|
Hi,
I'm creating a calendar linked with google. It’s only to view a club agenda.
The calendar itself works but the google part has not completely.
$link='https://www.google.com/calendar/feeds/amsacgent%40gmail.com/private-mijncode/basic?hl=nl';
$calendar = simplexml_load_file($link);
The hl=nl part is for my language.
Without additional parameters I have the recurrent items only once, the first time.
This is what I have tried
singleevents=true: I have some future items but they are in the far future 2027 but none for the current year.
start-min='.$j.'-01-01T00:00:00-00:00&start-max='.($j+1).'-01-01T00:00:00-00:00': no recurrent items
$j this year. I can also add the month is necessarily
I found this link for the parameters.
Will someone help me
thx
Jan
Here you kan see a demo
|
|
|
|
|
Is there really nobody who can help?
|
|
|
|
|
Hi,
thanks for that info, but how do I contact Atechnocrat.
Maybe you can tell me what was your solution; same problem ==> same solution I think
Jan
|
|
|
|
|
He's a spammer - ignore him, it'll be gone soon...as will his account.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
<?php $f=ftp://username:password@ftp.example.com/filepath";
$f = fopen($f, 'r');
while($row = fgets($f)) {
echo $row;
}
|
|
|
|
|
how to insert excel data into phpmyadmin database using a query
|
|
|
|
|
Member 10551305 wrote: phpmyadmin database Never heard that kind of DB...
You talk about MySQL I assume. In phpmyadmin you can import only csv files - so you have to export your excel first t ocsv and than import using phpmyadmin into MySQL...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|