php

How to implement such a function in PHP?

It should test if a specific port is open on localhost,if not,reboot. It's run in windows. ...

mysql_real_escape_string alternative for SQL Server

Am wondering what is the equivalent in PHP for SQL Server escaping of strings? ...

PHP Send email with PDF attachment without creating the file?

Hi, I generate PDF's using FPDF and I need to email it to a customer. Since I can generate the PDF's from the DB, I don't want to save all the PDF's locally as it will clutter up my server. I want to be able to send an email with a PDF attached. Do I need to create a temporary file, then delete it every time or is there another way to...

How to parse an HTML with PHP/ASP.NET?

Hi, The question is not really about parsing the HTML, but rather parsing the HTML and adding elements to the DOM according to the HTML tags. For example - I want to be able to take an HTML page, add attribute to the HTML tags - such as "class='replace'", put some PHP/ASPNET code in the page (make an ASPX page with ASPNET or put some inc...

php problem with contact form script verification?

I'm trying to edit a php contact form script, but I can't find where to delete a terms and conditions verification part. I've deleted the checkbox in the html and the form no longer works. Is there any way to edit this code to remove it? <?php $adminemail = '[email protected]'; // type your actual email address in place of you@yourdomain....

Referncing file locations in a php require

Hello, another easy question for someone! on my server i have a location like htdocs/aFolderName/ which contains a file index.php, which references a required file from htdocs/aFolderName/php/ by using the code <?php require('php/db.php'); ?> I also have a folder htdocs/aFolderName/other/ which contains another php file whic...

How does redirect after post works?

some guys suggest me rather then editing the question put it as new question that's why i am doing so... <?php session_start(); if(isset($_POST['username']) && ($_POST['password'])) { $con=mysql_connect("localhost","root",""); if(!$con) { die('Could Not Connect:'.mysql_e...

how to unwrap an array in php

i have this array here: Array ( [0] => Array ( [presentation] => Präsentationen ) [1] => Array ( [news] => Aktuelle Meldungen [devplan] => Förderprogramme [salesdoc] => Vertriebsunterlagen ) [2] => Array ( [user/settings] => Mein Account ) [3] => Array ...

how does html comments work with php code?

Hi, I just wonder how does html comment tag work with php code. If I have the following code, does php parse it anyway? <!-- <?php echo "hi"; ?> --> a simple question, but I guess it is important to know. ...

how do i sort the following array/stdclass object in php?!

how do is sort this object by 'pos' in php? Array ( [0] => stdClass Object ( [str] => Mondays [pos] => 170 ) [1] => stdClass Object ( [str] => Tuesdays [pos] => 299 ) [2] => stdClass Object ( [str] => Wednesdays [pos] => 355 ) [3] => stdClass Object ( [str] => Thursdays [pos] => 469 ) [4] => stdClass Object ( [str] => Fridays [pos] =>...

Can you send a file from a webpage via e-mail

Hi everyone, Ironically, for an IT contractor, I find myself building a website for a recruitment consultancy. They would like a form which allows users to send them a CV but, from a security point of view would like the CV's sent to an e-mail address rather than stored on a web server. Does anyone know if such a thing is possible wit...

Php/MySQL help - random daily pick?

Hello, I'm trying to get a pick from my DB that would last for a day (daily pick). I use the following code: $query = 'SELECT * FROM table ORDER BY rand() LIMIT 1 But as you can see it only gives me a random pick from the table, and every time I refresh the page it gets me a new random pick. How can I make the pick to last for a whole...

Calling a function from another function

Hi guys I have a problem in calling a function from a function. These are the two functions: function getevents() { $date = $this->input->post('attendanceDateadd'); $Event = $this->input->post('Event'); $Timing = $this->input->post('Timing'); $CompanyName = $this->input->post('CompanyName'); $EventDescription ...

Is cookie PHPSESSID the only key to for a $_SESSION in PHP?

If it's true,and I know the value of PHPSESSID,can I fake that user? ...

PHP extracting body and attachments from piped email

I understand there are php IMAP functions to extract certain elements from an email stored in a mailbox. What I am trying to discover is whether this can translate to emails piped to a script. The scripts that I have looked at for extracting the body and attachments are fairly inflexible and bulky. I sent my pipe script a variety of dif...

How to upload a file with PHP like <form enctype="multipart/form-data">?

Is it possible to do it with PHP? Best with a simple demo! ...

Login System design to allow each user to be logged in on one machine at a time

How should I design a login system so that each username can only be logged on in one place at a time? I want to keep users from giving their username to someone else to login so they can avoid paying for each user. If a user is already logged in and tries to log in on another machine should I block the 2nd login (which could be a prob...

Could somebody explain SOLR requestHandlers and responseWriters in detail?

Firstly, many parts of the solr wiki is not very useful for somebody who just learned how to index and search fields. It seems it is written for experts! It uses terms that is RELATIVE to solr, so it's very difficult to understand it without reading it several times over. NOTE: I have a classifieds website where the most recent ads alwa...

Avoid PHP execution time limit

I need to create a script in PHP language which performs permutation of numbers. But PHP has an execution time limit set to 60 seconds. How can I run the script so that if you need to run more than 60 sesunde, not been interrupted by the server. I know I can change the maximum execution time limit in php, but I want to hear another versi...

Same named function with multiple arguments in PHP

I started off OOP with Java, and now I'm getting pretty heavy into PHP. Is it possible to create multiples of a function with different arguments like in Java? Or will the interpreted / untyped nature of the language prevent this and cause conflicts? ...