Search found 86 matches

by ejsexton82
Fri Jun 15, 2012 5:02 am
Forum: PHP General
Topic: Advanced search
Replies: 0
Views: 571

Re: Advanced search

Yes, it is possible to have an Advanced Search which allows users to fill in one or more fields. Solutions usually involve a series of conditionals which build an SQL statement based on the information submitted by the user. Assuming you are using MySQL, such a solution might look like this: $where ...
by ejsexton82
Fri Jun 15, 2012 2:35 am
Forum: PHP coding => Mail
Topic: problem php mailer
Replies: 0
Views: 888

Re: problem php mailer

The PHPMailer Error Message would be useful. Try changing your code to this, resubmitting, and noting the error that is displayed:

Code: Select all

if(!$mail->Send()){   
    echo "Errore Mail: " . $mail->ErrorInfo; 
} else {   
    echo "Mail inviata con successo";
}
by ejsexton82
Thu Jun 14, 2012 8:06 pm
Forum: PHP Scripts
Topic: PROBLEM WITH CROP IMAGE
Replies: 0
Views: 827

Re: PROBLEM WITH CROP IMAGE

The imagecreatefromjpeg() requires the file name of a local JPEG file as its parameter: $image = imagecreatefromjpeg('../local/file.jpg'); The easiest solution might be to copy the code from get_crop.php and use the imagecreatefromstring() function: // get_crop.php code goes here $image = imagecreat...
by ejsexton82
Thu Jun 14, 2012 7:45 pm
Forum: PHP Installation
Topic: help getting started on PHP
Replies: 0
Views: 1079

Re: help getting started on PHP

Either PHP is not installed, or it is not recognizing and processing the file. AppServeNetworks.com is for sale, and not a real website at this time. I would recommend installing / reinstalling PHP. If you are installing PHP for the first time, I would recommend either WampServer (Windows) or a Lamp...
by ejsexton82
Thu Jun 14, 2012 6:40 am
Forum: PHP coding => General
Topic: Help with $_POST
Replies: 2
Views: 638

Re: Help with $_POST

Yeah, that sounds doable.
by ejsexton82
Thu Jun 14, 2012 6:39 am
Forum: PHP coding => General
Topic: Desperate need of help with a sequential generator
Replies: 1
Views: 439

Re: Desperate need of help with a sequential generator

Do you only want to display one "Featured Attorney" at a time? Or do you want to display all of the "Featured Attorneys", and let the user cycle through them?
by ejsexton82
Thu Jun 14, 2012 6:28 am
Forum: PHP coding => General
Topic: Best Technique to check if the user completes his profile
Replies: 1
Views: 397

Re: Best Technique to check if the user completes his profil

That is pretty vague. How is the profile stored? What information is needed to complete a profile? I would imagine the simplest solution would be simply to validate the data when the user submits their profile to ensure that all of the required information is present and correct. This is most reliab...
by ejsexton82
Thu Jun 14, 2012 6:21 am
Forum: PHP coding => General
Topic: error with $post
Replies: 0
Views: 346

Re: error with $post

It looks like your conditions are setup incorrectly. Try something like this:

Code: Select all

if(isset($_POST['searchid'])) {
	$query="select * from books where book_id like '%".$searchid."%'";
}
elseif(isset($_POST['searchname'])) {
	$query="select * from books where book_id like '%".$searchname."%'";
}
by ejsexton82
Thu Jun 14, 2012 6:18 am
Forum: PHP coding => General
Topic: Book Errors
Replies: 2
Views: 539

Re: Book Errors

Either you do not have PHP installed, or the file is not being recognized and processed by PHP.

Ensure that PHP is installed on your server. Ensure that your file has a ".php" extension, and is suitably located so that PHP will recognize and process the file when it is accessed.
by ejsexton82
Thu Jun 14, 2012 6:11 am
Forum: PHP coding => General
Topic: Urgently need a little help with an input dialog...
Replies: 10
Views: 944

Re: Urgently need a little help with an input dialog...

No problem. Try adding this to the <input> tags: id="invoice_template" So that it looks like this: <?php if (uri_assoc('is_quote') or isset($invoice) and $invoice->invoice_is_quote) { ?> <input type="hidden" name="invoice_template" id="invoice_template" value="<?php echo $default_quote_template; ?>"...
by ejsexton82
Wed Jun 13, 2012 11:55 pm
Forum: mySQL & php coding
Topic: uploading files to folder and writing name to mySQL
Replies: 2
Views: 947

Re: uploading files to folder and writing name to mySQL

To be able to upload multiple files, you must add the "multiple" HTML attribute to the <input> tag. The "name" HTML attribute should also be an array: <input type="file" name="file[]" multiple="multiple"/> You can then iterate over the $_FILES['file'] variable to upload all of the files: foreach($_F...
by ejsexton82
Wed Jun 13, 2012 9:43 pm
Forum: PHP General
Topic: What is the difference between characters 23 and x23 in PHP?
Replies: 1
Views: 612

Re: What is the difference between characters 23 and x23 in

"23" is a decimal number. "0x23" is a hexidecimal representation of the decimal number "35". echo "23: " . 23 . "<br/>"; echo "0x23: " . 0x23 . "<br/>"; These number also have corresponding UTF-8 characters. The "23" character is described as the End Transmission Block (ETB) character, which is "inv...
by ejsexton82
Wed Jun 13, 2012 9:20 pm
Forum: PHP coding => General
Topic: Urgently need a little help with an input dialog...
Replies: 10
Views: 944

Re: Urgently need a little help with an input dialog...

I looked at the code again. Try removing the following line: <input type="hidden" name="invoice_template" value="<?php echo empty($template) ? 'default_quote' : $template; ?>"/> And replacing it with these lines: <?php if (uri_assoc('is_quote') or isset($invoice) and $invoice->invoice_is_quote) { ?>...
by ejsexton82
Wed Jun 13, 2012 1:10 am
Forum: PHP coding => General
Topic: Identify User's Location based on IP
Replies: 2
Views: 497

Re: Identify User's Location based on IP

These guys say they provide a free IP Location API for PHP:
They have examples, and provide both the city and the country of the IP address.

I hope that helps. Good luck!
by ejsexton82
Wed Jun 13, 2012 12:11 am
Forum: PHP coding => General
Topic: Detect Users IP
Replies: 1
Views: 464

Re: Detect Users IP

Check this out: Roshan Bhattarai's Blog. Getting real IP address in PHP . Posted 2007-12-27. The user's IP address can typically be retrieved using the $_SERVER['REMOTE_ADDR'] variable. Roshan claims that the user's IP address behind a proxy can sometimes be retrieved using either $_SERVER['HTTP_CLI...
by ejsexton82
Wed Jun 13, 2012 12:02 am
Forum: PHP coding => General
Topic: Urgently need a little help with an input dialog...
Replies: 10
Views: 944

Re: Urgently need a little help with an input dialog...

Looking at the code, I think this might work, but I'm not sure: <input type="hidden" name="invoice_template" value="<?php echo empty($template) ? 'default_quote' : $template; ?>"/> If $template is set, then "invoice_template" will be set to $template. Otherwise, "invoice_template" will be set to "de...
by ejsexton82
Tue Jun 12, 2012 9:46 pm
Forum: mySQL & php coding
Topic: mysqli binding problem
Replies: 7
Views: 1508

Re: mysqli binding problem

Okay, this is from the PHP Manual: [Parameter Markers (?) ] are legal only in certain places in SQL statements. For example, they are allowed in the VALUES() list of an INSERT statement (to specify column values for a row), or in a comparison with a column in a WHERE clause to specify a comparison v...
by ejsexton82
Tue Jun 12, 2012 3:56 am
Forum: PHP coding => General
Topic: some help making this work ?
Replies: 3
Views: 549

Re: some help making this work ?

That sounds more like a personal problem than a PHP problem.
by ejsexton82
Tue Jun 12, 2012 3:30 am
Forum: PHP General
Topic: Client close Event
Replies: 0
Views: 457

Re: Client close Event

Determining when a user connects to a website for the first time should be pretty easy with the proper use of Sessions. http://tr2.php.net/manual/en/book.session.php The tricky part would be determining when the client leaves the website. The best you could do would be to monitor the user's activity...
by ejsexton82
Tue Jun 12, 2012 3:16 am
Forum: PHP General
Topic: integrating php with c#
Replies: 3
Views: 794

Re: integrating php with c#

Are PHP and C# on the same machine? If so, it sounds like you may want the exec() or proc_open() functions: http://tr2.php.net/manual/en/function.exec.php http://tr2.php.net/manual/en/function.proc-open.php Note: These functions are sometimes disabled, and must be enabled by altering the PHP Configu...
by ejsexton82
Tue Jun 12, 2012 3:02 am
Forum: PHP General
Topic: check the condition before creating the table
Replies: 2
Views: 475

Re: check the condition before creating the table

Add "IF NOT EXISTS" to your MySQL statement:

Code: Select all

CREATE TABLE IF NOT EXISTS human2(FirstName varchar(15),LastName varchar(15),Age int)
by ejsexton82
Tue Jun 12, 2012 2:57 am
Forum: PHP General
Topic: Advice
Replies: 2
Views: 571

Re: Advice

First, there are some free prepackaged solutions out there which do what you are describing. You can Google "php file manager" if you do not want to reinvent the wheel. Second, having a database may not be necessary. There are reasons why a database would be necessary, but unless you can come up wit...
by ejsexton82
Tue Jun 12, 2012 2:09 am
Forum: PHP General
Topic: explode comma content
Replies: 0
Views: 582

Re: explode comma content

Well, if all you want to do is change the "spaces" to "newlines", then this is the easiest solution: echo nl2br($data); If you want to parse the data, then something like this should work: $array = array(); $rows = explode("\n",$data); foreach($rows as $index => $row) { $cols = explode(',',$row); $a...
by ejsexton82
Tue Jun 12, 2012 2:00 am
Forum: PHP coding => General
Topic: some help making this work ?
Replies: 3
Views: 549

Re: some help making this work ?

Seems pretty straight forward to me. You can even download all the files and drop them into your website. What are you having problems with exactly?
by ejsexton82
Tue Jun 12, 2012 1:57 am
Forum: PHP coding => General
Topic: input field and drop down select option
Replies: 2
Views: 473

Re: input field and drop down select option

I posted an example in your other post: