-
Posts
21 -
Joined
-
Last visited
Never
Posts posted by dharmeshpat
-
-
i do know that but it would be great help i you can tell us the best and most suitable way to achieve the result
Rather than pointing the fingers on others
-
<?php
$path = $_SERVER['SCRIPT_NAME'];
$script = explode("/", $path);
$filename = explode(".", $script[sizeof($script) - 1]);
?>
<li class="link">
<a class="link levela" title="The drive formally known as "P"">
<span>Company Documents</span></a>
<ul>
<li class="link">
<a class="<?php if ($filename[0] == "comm_forms") { echo "current"; }else{ echo "link"; } ?> levelb" href="http://hhnet/company_documents/comm_forms.php" title="Forms... for Commission">
<span>Commission Forms</span></a></li>
<li class="link">
<a class="<?php if ($filename[0] == "complaint_documentation") { echo "current"; }else{ echo "link"; } ?> levelb" href="http://hhnet/company_documents/complaint_documentation.php" title="Documents documenting complaints.">
<span>Complaint Documentation</span></a></li>
-
put this code above ur php include file name menu.php
<?php
$path = $_SERVER['SCRIPT_NAME'];
$script = explode("/", $path);
$filename = explode(".", $script[sizeof($script) - 1]);
?>
-
if($_SESSION['name']){
echo "<option value='".$_SESSION['name']."'>".$_SESSION['name']."</option>";
}
-
wat u can do is
u should put one flag column in database which will tell u whether the logged in user is admin or a normal client
Once u know which user has logged u u can redirect that user to the respective url
And yes it would be better to have different folder for different user type
say for admin it would be admin folder
and for user it would be user folder
-
according to me i think ur using same name for the variable or object for the queries please try to use different name for variable or query and than try it will get resolved
-
$query = "SELECT * ";
$query .= "FROM table ";
$query .= "WHERE malls_id=" . $mall_id;
$query .=" AND DATE_FORMAT(date ,'%Y-%m' ) =" . $selected_date;
the above query has to be modified as below
$query = "SELECT * ";
$query .= "FROM table ";
$query .= "WHERE malls_id=" . $mall_id;
$query .=" AND YEAR(date) = '".$year."' AND MONTH(date) = '".$month."'";
-
one thing u can do just to hide that warning use
@session_start();
-
Hi dude still i m not completely cleared but
If you are getting value in an array format than u don't u store it in a variable and than use that variable to get that data example
$valueHolder = $json->call('getBits',Array());
print_r($valueHolder['success']);
-
hi herghost are u getting json result from ajax call from php page can u explain me bit about this i think i can help u out for the same
-
Can you try the code the way i have written don't change it place it has it is and try it out
function findexts ($filename) {
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1; $exts = $exts[$n];
return $exts; }
$ext = findexts ($_FILES['foto']['name']) ;
$ran2 = $foto.".";
$target = "../images/";
$target = $target . $ran2.$ext;
while (file_exists($target)) {
$ran2 = 'copyof'.$ran2;
$target = $target . $ran2.$ext;
}
if(move_uploaded_file($_FILES['foto']['tmp_name'], $target)) {
$newFilename = $ran2 . "." . $ext;
mysql_query( "INSERT INTO `softmarket`.`internet_securitate` (`internet_securitateID`, `nume_produs`, `descriere`, `versiune`,`poza`, `pret`, `disponibilitate_produs`)
VALUES ('', '$_POST[titlu]', '$_POST[descriere]', '$_POST[versiune]', '$newFilename', '$_POST[pret]', '$_POST[disponibilitate]');");
echo "The file has been uploaded as ".$newFilename; }
else { echo "Sorry, there was a problem uploading your file."; }
header('Location: succes.php');
-
Try this below regex won't allow the numerice value
/^[a-zA-Z\s]+/
-
i got one can u just send me detail description abt ur problem
-
try this out
preg_match('/^[a-zA-Z\s]+/', 'this may or may not be valid with 1')
-
Can you try to clarify more about ur problem means are you telling that u have order form which user fills in and once it is fill u will create and array of all the data that user and filled in and will pass that array to the class function and insert it into the database than i say,
It is bad practice to create a array after the data is submitted since the u will get the data in post as an array format and again creating new array not good practice
-
If i m not mistaken i think the problem is that the name that u r storing in database is different and and file name is different because u r executing insert statement before the move_upload statement
Execute insert statement after the upload statement and instead of using $foto us $ran2
-
printer_open function which php use to support i don't have clear idea whether it is support in latest php version since i m using php 5.3.8
and also the php_printer extension is not present in my php version but i manually downloaded php_printer.dll from internet placed it in my php extension folder and i tried to enabled it but still no use
-
First can u tell us that wat is $foto variable holding i want to know what does it holds
And i you don't mind can i suggest u that why don't u change the name of the file on every upload means give new name to the file whenever user uploads a file use date function like this
$filename = date('dmYHis');
once u got he file name append the extension and store it in the folder, using this u will get a unique name for every upload that u do
-
Sorry for that but i m really frustrated as i m trying to print the document what i really want is that
First suppose their is a form with three input fileds
1. firstname
2. lastname
3. phone
as soon as user fills this details and press submit button the fill details should get insert into the database but at same time this fill details should get print
on a paper in format as below
Name of visitor : XYZ
Tell : 234567899
-
I have used php_printer.dll but it is of no used
Newbie Help
in PHP Coding Help
Posted
dude don't do the hard delete do soft delete example
put one more column in database say "status"
when user is created the status column for that user will be default active
and as soon as u try to delete the record don't delete the record just change the status to deactivated
and now when ever u try to display the list of user just display the list with active status