|
copy_player_image($url,$destinationurl);
copy_player_image($imgurl,$destinationurl){
$image = file_get_contents($imgurl);
$imgpath = 'images/xyz.jpg";
$fullpath = $_SERVER['DOCUMENT_ROOT'].$destinationurl;
if(!file_exists($fullpath)){
unlink($fullpath);
file_put_contents($fullpath, $imageurl);
}
return $imgpath;
}
|
|
|
|
|
I'm stuck with this problem, any help will be appreciated.
I have a web service, it requires authentication to call functions but I couldn't authenticate.
The function XML is like this:
<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>
<s11:Header>
<ns1:AuthHeader xmlns:ns1='MOD'>
<ns1:Channel>?XXX?</ns1:Channel>
<ns1:Username>?XXX?</ns1:Username>
<ns1:Password>?XXX?</ns1:Password>
</ns1:AuthHeader>
</s11:Header>
<s11:Body>
<ns1:GetBankList xmlns:ns1='MOD' />
</s11:Body>
</s11:Envelope>
my connection codes are:
$baglanti = new :confused:SoapClient("https://galaksi.turknippon.com/appservice/mod.asmx?wsdl");
$parm = array();
$parm[] = new SoapVar('channelcode', XSD_STRING, null, null, 'Channel' );
$parm[] = new SoapVar('myusername', XSD_STRING, null, null, 'Username' );
$parm[] = new SoapVar('mypassword', XSD_STRING, null, null, 'Password' );
$Adres = "https://galaksi.turknippon.com/appservice/";
$Baslik = new SoapHeader($Adres, "AuthHeader",new SoapVar($parm, SOAP_ENC_OBJECT));
$baglanti->__setSoapHeaders(array($Baslik));
$sonuc = $baglanti->AuthHeader(new SoapVar($parm, SOAP_ENC_OBJECT));
print_r ($sonuc);
Here is a stack trace:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at AppServiceLibrary.AuthHeader.Validate(AuthHeader& credential) in xxxx\Galaxy\Galaxy\AppServiceLibrary\AuthHeader.cs:line 132 at xxxx.AppService.MODService.GetBankList() in xxxx\AppService\mod.asmx.cs:line 1148 --- End of inner exception stack trace --- –
|
|
|
|
|
Please do not post the same question in multiple forums.
|
|
|
|
|
Hello
I write a Statistics and I have a problem. I attached the files.
the zip file included 4 file.
1. t.php: included only a link
2. index.php: with scrpit refer t.php to emt.php.
3. emt.php : insert refered page in test.txt.
so when you open t.php an clink on link the t.php inserted to test.txt and have no problem.
but I want when other page link to t.php so the refer page inserted to test.txt.
you can download file from below link:
https://encodable.com/uploaddemo/files/am.zip[^]
|
|
|
|
|
Please include your code in your question. I'm not inclined to download anything in order to answer a question and that's probably also true for anyone else here.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
index.php:
var test=document.referrer;
document.write("<script type='text/javascript' src='<a href="http://localhost/am/emt.php?input=">http://localhost/am/emt.php?input=</a>" + test + "'></sc" + "ript>");
t.php:
<a href="index.php">set</a>
emt.php:
$last=$_GET['input'];
$bazdid=$last."\r\n";
$file=fopen("test.txt",a);
$rit=fwrite($file,$bazdid."\r\n");
fclose($file);
modified 30-Apr-15 18:12pm.
|
|
|
|
|
Please verify that the code as it's shown in your previous message matches your actual code (and that it's not mangled somehow by mistake when inserting it into the message). Because the JavaScript in index.php doesn't run for me, there's a syntax error.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Dear Sir,
yes you are right. I correct the code. please check again.
and don't forget create a blank text file "test.txt" near to above 3 file.
this work such as database!!
|
|
|
|
|
Hi,
I have a local network at the company and I want to have PHP applications on the server but is there any way to encrypt the files so no one will be able to read the source code even if they go physically on the server?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
You could use Zend Guard - but it is a bit expensive if all you want to do is stop people who have access to the server poking around in the source code.
|
|
|
|
|
If the DBA creates a new user and gives that user the RESOURCE role only, can the new user successfully connect to the database?
|
|
|
|
|
Hi,
I have this page:
http://www.mybluefile.com/[^]
it's too slow when I sign in.. there is no problem with the line because I am able to ping with good latency as you can see in this ping result:
http://www.jassimrahma.com/temp/ping_result.png[^]
below is my stored procedure for the sign in and I have indexes applied.
where is the problem and how can investigate such case?
CREATE DEFINER=`root`@`%` PROCEDURE `sp_web_login_employee`(IN param_login_name varchar(255), IN param_login_password_salt varchar(255), IN param_login_password_hash varchar(255), IN param_ip_address varchar(255))
BEGIN
DECLARE param_employee_id INT;
DECLARE email_address VARCHAR(255);
IF EXISTS (SELECT employee_guid FROM employees WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE) THEN
BEGIN
DECLARE param_employee_guid VARCHAR(255);
SET param_employee_id = (SELECT employee_id FROM employees WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE);
SET param_employee_guid = (SELECT employee_guid FROM employees WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE);
UPDATE employees SET last_login_date = UTC_TIMESTAMP(), last_login_ip = param_ip_address WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE;
SET email_address = (SELECT contact_details FROM employee_contacts INNER JOIN contact_category ON contact_category.contact_category_id = employee_contacts.contact_category WHERE contact_category.contact_category_type = "EMAIL" AND employee_contacts.employee_id = param_employee_id AND employee_contacts.use_for_communication = TRUE);
SELECT email_address, employees_table.employee_id, employees_table.employee_number, employees_table.employee_guid, employees_table.first_name, employees_table.second_name,
employees_table.third_name, employees_table.fourth_name, employees_table.last_name, employees_table.official_name, employees_table.photo,
managers_table.employee_id AS manager_id, managers_table.official_name AS manager_name, employee_job.contract_id, employee_contracts.contract_start,
employee_contracts.contract_expiry, job_titles.job_title_name, departments.department_name, companies.company_name, locations.location_name, country.country_name
FROM employees employees_table
JOIN employee_contracts ON employees_table.employee_id = employee_contracts.employee_id
JOIN employee_job ON employees_table.employee_id = employee_job.employee_id
JOIN job_titles ON employee_job.job_title = job_titles.job_title_id
JOIN companies ON employee_job.company_id = companies.company_id
JOIN departments ON employee_job.department = departments.department_id
JOIN locations ON employee_job.company_location = locations.location_id
JOIN country ON locations.country_code = country.country_code_alpha2
LEFT JOIN employees managers_table ON employee_job.reporting_to = managers_table.employee_id
WHERE employees_table.login_name = param_login_name AND employees_table.login_password_salt = param_login_password_salt AND employees_table.login_password_hash = param_login_password_hash AND employees_table.is_active = TRUE AND employees_table.current_employee = TRUE AND employee_job.is_current = TRUE;
END;
END IF;
END
Technology News @ www.JassimRahma.com
|
|
|
|
|
Can anyone tell me what I am doing wrong? I am getting an error message on line 9 (Locid)...
Create table Course_Section
(
Csecid NUMBER(8) CONSTRAINT PK_COURSE_SECTION PRIMARY KEY,
Cid NUMBER(6) NOT NULL CONSTRAINT FK_COURSE_SECTION REFERENCES COURSE(Cid),
Termid NUMBER(5) NOT NULL CONSTRAINT FK_COURSE_SECTION REFERENCES TERM(Termid),
Secnum NUMBER(5) NOT NULL,
Fid NUMBER(4) CONSTRAINT FK_COURSE_SECTION REFERENCES FACULTY(Fid),
Day VARCHAR(10)
Locid NUMBER(5) CONSTRAINT FK_COURSE_SECTION REFERENCES FACULTY(Locid),
Maxenrl NUMBER(4) NOT NULL,
Currenrl NUMBER(4) NOT NULL,
);
|
|
|
|
|
|
You have missed the , above the Locid try this hope this will help you.
|
|
|
|
|
Hi,
I have a PHP project with login session and I would like to ask how can I expire the session automatically after x Time when the application is idle just like GoDaddy and many other websites?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
You can run a little ajax call to a server side function every minute or so to check that the session is still active, and logout or redirect the user if not.
|
|
|
|
|
I have a dropdown list populated with files pulled from a directory using the PHP listed below and am trying to figure out how I can delete them using a delete button in the form when they're selected.
<input type="hidden" name="Action" value="EDIT" /><input type="hidden" name="Selection" id="Selection" value="-1"><div>Below is the list of your saved codes. To edit your codes, select it from the list.</div>
<select size="1" name="CodeList" id="CodeList">
<?php
$directory = $directory = 'users/' . $_SESSION['username'];
$filesContents = Array();
$files = scandir( $directory ) ;
foreach( $files as $file )
{
if ( ! is_dir( $file ) )
{
$filesContents[$file] = file_get_contents($directory , $file);
echo "<option>" . $file . "</option>";
}
}
?>
</select>
delete php script.
<?php
session_start();
$directory = $directory = $_SERVER['DOCUMENT_ROOT'] . '/users/' . $_SESSION['username'];
$file_to_delete = $_POST['CodeList'];
if ( unlink ($directory.'/'.$file_to_delete) ) {
echo $file_to_delete . " deleted.";
} else {
echo "Error.";
}
?>
when I try and save I get the Warning: unlink(/myhome/root/public_html/users/Addiction/) [function.unlink]: No such file or directory in /home/revo/public_html/evo/avdeleteprocess.php on line 5 Error.
So its found the right folder, just not finding the file from the dropdown list selection.
Also edited to add I ran a var_dump($_POST) right after my delete script to see what it was pulling as the value of POST and it came back with: Error.array(1) { ["Action"]=> string(6) "Delete" }
|
|
|
|
|
Not sure if this is relevant but in the first case you have
$directory = $directory = 'users/' . $_SESSION['username'];
and in the second you have
$directory = $directory = $_SERVER['DOCUMENT_ROOT'] . '/users/' . $_SESSION['username'];
Should they not be the same?
|
|
|
|
|
I was just attempting to see if the issue was finding the location and the second one was copied from earlier code. They're both the same now but doesn't have any bearing it seems on finding the file I'm looking for from the dropdown ist.
|
|
|
|
|
Well you can easily display both paths and the relevant filenames to see if they are correct.
|
|
|
|
|
Dear php gurus,
This is my second post on this php forum. Not much luck with my first post.
First, please bear with me as this code is rather long.
I have this dropdown dynamically populated from SQL Server database. The code below is derived from VIEW -> SOURCE
<select name="SType">
<option value=""></option>
<option value="Bid" name="Bid">Bid[2]</option>
<option value="Lib CM" name="Library CM">Lib CM[23]</option>
<option value="Quote" name="Quote">Quote[20]</option>
<option value="RFP" name="RFP">RFP[2]</option>
<option value="Removed" name="Removed">Removed[29]</option>
<option value="Archived" name="Archived">Archived[4501]</option>
<option value="Awarded" name="Awarded">Awarded[40]</option>
<option value="Open" name="Open">Open[47]</option>
<option value="Closed" name="Closed">Closed[11]</option>
<option value="Under Review" name="Under Review">Under Review[126]</option>
<option value="Cancelled" name="Cancelled">Cancelled[64]</option>
</select>
When a user selects any value, say Bid, we would like to display all records associated with Bid. In this case, it will be two records.
The long code below (sorry again), works perfectly in terms of displaying records.
However, when I tried to integrate the code that displays records based on dropdown value, I expected to see just those records.
Instead, it displays all records.
Can you please see what I am doing wrong?
First the code that should display records based on dropdown selection, followed by the long code I am trying to integrate it with.
Your help and understanding very much appreciated.
if(isset($_REQUEST['Solicitations'])){
if($_GET['Solicitations'] == "Bid"){
$result = "SELECT * FROM bids where BidStatus = 1 and BidType = 'Bid' ORDER BY title";
$query = sqlsrv_query( $conn, $sql , $params, $options );
}
}
= array(
= preg_replace(= str_replace(= array(
= array('field' => 'b.BidTitle', 'searchType' => 'like'),
'BidType' => array('field' => 'b.BidType', 'searchType' => 'equal'),
'BidStatus' => array('field' => 'b.BidStatus', 'searchType' => 'equal'),
'department' => array('field' => 'b.Department', 'searchType' => 'equal'),
'bidId' => array('field' => 'b.BidID', 'searchType' => 'equal'),
'bidDate' => array('field' => 'b.BidDate', 'searchType' => 'equal'),
'dueDate' => array('field' => 'b.DueDate', 'searchType' => 'equal')
);
$where = array();
foreach($fields as $fieldPost => $field) {
if(isset($_POST[$fieldPost]) && strlen($_POST[$fieldPost]) > 0) {
if($field['searchType'] == 'like') {
$where[] = "".$field['field']." LIKE '%" . ms_escape_string($_POST[$fieldPost]) . "%'";
} else {
$where[] = "".$field['field']." = '" . ms_escape_string($_POST[$fieldPost]) . "'";
}
}
}
$sql = "Select b.ID,convert(char(10),b.BidDate,101) BidDate,convert(char(10),
b.DueDate,101)DueDate,b.BidTitle,b.DueTime,b.BidID,BidIDFile,
d.Department,b.BidType,CASE WHEN b.AwardDate ='01/01/1900' Then NULL ELSe convert(char(10),b.AwardDate,101)END AS AwardDate,
convert(char(10),b.LastUpdate,101) LastUpdate,s.Status
FROM bids b inner join dept d on b.Department=d.DeptID inner join Status s on b.BidStatus=s.StatusId " . ( count($where) > 0 ? " WHERE " . implode(' AND ', $where) : "" );
//echo $sql;
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$query = sqlsrv_query( $conn, $sql , $params, $options );
$num_rows = sqlsrv_num_rows($query);
$per_page = 20; // Per Page
$page = 1;
if(isset($_GET["Page"]))
{
$page = $_GET["Page"];
}
$prev_page = $page-1;
$next_page = $page+1;
$row_start = (($per_page*$page)-$per_page);
if($num_rows<=$per_page)
{
$num_pages =1;
}
else if(($num_rows % $per_page)==0)
{
$num_pages =($num_rows/$per_page) ;
}
else
{
$num_pages =($num_rows/$per_page)+1;
$num_pages = (int)$num_pages;
}
$row_end = $per_page * $page;
if($row_end > $num_rows)
{
$row_end = $num_rows;
}
$sql = " SELECT c.* FROM (
SELECT ROW_NUMBER() OVER(ORDER BY ID) AS RowID,ID,convert(char(10),b.BidDate,101) BidDate,convert(char(10),
b.DueDate,101)DueDate,b.BidTitle,b.DueTime,b.BidID,BidIDFile,
d.Department,b.BidType,CASE WHEN b.AwardDate ='01/01/1900' Then NULL ELSe convert(char(10),b.AwardDate,101)END AS AwardDate,
convert(char(10),b.LastUpdate,101) LastUpdate,s.Status
FROM bids b inner join dept d on b.Department=d.DeptID inner join Status s on b.BidStatus=s.StatusId " . ( count($where) > 0 ) ? " WHERE " . implode(' AND ', $where) : " )
) AS c
WHERE c.RowID > $row_start AND c.RowID <= $row_end
$query = sqlsrv_query( $conn, $sql);
";
?>
<table>
<thead>
<tr style="white-space:nowrap">
<th></th>
<th>Issue Date</th>
<th>Due Date</th>
<th>Project Title</th>
<th>ID</th>
<th>Department</th>
<th>Type</th>
<th>Award Date</th>
<th>Last Update</th>
<th>Status</th>
</tr>
</thead>
= sqlsrv_fetch_array($query,
<tbody>
="background:',(($c=!$c)? '#eee' : '#ddd' ),';font-size:12px;"'; ?>
<td><div align="center"><a href="bidDetails.php?Id=<?php echo $result["ID"];?>"><img src="images/details.gif" alt="" title="Details" /></a></div></td>
<td><div align="center"></div></td>
<td><br />@</td>
<td><a href="uploads/<?php echo $result["BidIDFile"]; ?>" Target="DETAILS" onClick="window.open('','DETAILS','width=850,height=700,scrollbars=yes'); return true;" type="application/octet-stream"></a></td>
<td style="white-space:nowrap"><div align="center"></div></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<br>
Total Record : Page :
='$_SERVER[SCRIPT_NAME]?Page=$prev_page&txtKeyword=$strprojectTitle&BidType=$strbidType'<< Back</a> ";
}
for($i=1; $i<=$num_pages; $i++){
if($i != $page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$strprojectTitle&BidType=$strbidType'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($page!=$num_pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$next_page&txtKeyword=$strprojectTitle&BidType=$strbidType'>Next>></a> ";
}
sqlsrv_close($conn);
?>
|
|
|
|
|
From the select tag, from my own observation, it appears that you have called the wrong tag "name" from the dropdown.
Instead of
if($_GET['Solicitations'] == "Bid")
Since the "select name ="SType" ", why not use
if($_GET['Stype'] == "Bid") . I think that is where the mistakes comes from. Because it is whatever value you select from the dropdown that becomes the value of the Select tag.
|
|
|
|
|
|
I set up a bootable USB stick drive (call it Stick #1) and loaded it up with ubuntu 14.04 LTS, and then booted up with it (using the "try" option), but I can't seem to get another FAT32 formatted (call it Stick #2) recognized. All I want to do is to copy some of the files off of Stick #2 onto the system hard drive (which shows up as "main"). Thanks
|
|
|
|
|