Search found 32 matches

by raphael75
Fri May 26, 2017 5:05 am
Forum: PHP General
Topic: trying to call Sybase stored procedure with parameters from PHP
Replies: 0
Views: 793

trying to call Sybase stored procedure with parameters from PHP

I'm trying to run a stored procedure on a Sybase 11.0.1.2596 database in Micros RES 3700 in a PHP file using PDO and dblib as the driver. I can call a procedure with no parameters with no problems using something like: call custom.show_clocked_in_employees This works perfectly. However, if the proce...
by raphael75
Tue Jul 28, 2015 4:26 am
Forum: Server installation and configuration
Topic: Trying to ./configure php, getting ldap library error
Replies: 0
Views: 1148

Trying to ./configure php, getting ldap library error

I'm trying to ./configure PHP 5.6.11 on Debian 8.1. It gets to this line and stops: checking for LDAP Cyrus SASL support... no checking size of long int... 8 configure: error: Cannot find ldap libraries in /usr/include. I can't figure out what ldap it's looking for. I don't know if this is helpful (...
by raphael75
Mon Mar 23, 2015 8:05 am
Forum: PHP Installation
Topic: PHP standalone from CLI
Replies: 2
Views: 1289

PHP standalone from CLI

Is it possible to run PHP command line scripts without having to install apache or another webserver (on Windows)? We have a server that I need to run scripts on, but I can't put a webserver on it, and I would much rather use PHP than vbs. Thanks!
by raphael75
Tue Feb 17, 2015 11:33 am
Forum: PHP coding => General
Topic: How to pass login/registration details to next page (continue session)
Replies: 1
Views: 802

Re: How to pass login/registration details to next page (continue session)

Create a file with this:

Code: Select all

<?php

phpinfo();

?>
and scroll to the section called "session". Do you see this?

Session Support enabled

If not, you will need to recompile/reinstall with session enabled.
by raphael75
Mon Feb 16, 2015 11:02 am
Forum: PHP General
Topic: How to transfer/copy the template webpages to sub domain automatically?
Replies: 1
Views: 565

Re: How to transfer/copy the template webpages to sub domain automatically?

Just a guess, but have you verified the permissions on the new folder? Does the account copying the files have write access to it?
by raphael75
Wed Feb 11, 2015 12:46 pm
Forum: PHP General
Topic: PHP / HTML Quiz --- counting correct answers
Replies: 10
Views: 1927

Re: PHP / HTML Quiz --- counting correct answers

What version of PHP do you have?
by raphael75
Wed Feb 11, 2015 12:21 pm
Forum: PHP General
Topic: html form
Replies: 2
Views: 899

Re: html form

hello everyone I wish to create a html form with a section of php inside the form. What I want to do is create a drop down box with values 1-10. When the user selects a value (say "4") then 4 x <input type=file> boxes appear, likewise 8 = 8 x <input type=file> boxes. Then name each <input type=file...
by raphael75
Wed Feb 11, 2015 12:02 pm
Forum: PHP General
Topic: PHP / HTML Quiz --- counting correct answers
Replies: 10
Views: 1927

Re: PHP / HTML Quiz --- counting correct answers

If you have session_start() you should automatically have access to the $_SESSION superglobal.

http://php.net/manual/en/reserved.variables.session.php
by raphael75
Wed Feb 11, 2015 10:38 am
Forum: PHP General
Topic: PHP / HTML Quiz --- counting correct answers
Replies: 10
Views: 1927

Re: PHP / HTML Quiz --- counting correct answers

Ok. Here's what I did so far : <?php session_start(); $_SESSION['quiz_results'] = 0; if (isset($_POST['submit1'])) { $selected_radio = $_POST['response']; if ($selected_radio == '12') { $_SESSION['quiz_results'] += 1; print ("CORRECT! \n<br />\n<br />You will be automatically re-directed to the nex...
by raphael75
Wed Feb 11, 2015 6:55 am
Forum: PHP General
Topic: query string and export its value
Replies: 0
Views: 591

Re: query string and export its value

What webserver software are you using (Apache, IIS)? What OS (Windows/Linux/etc.)? Have you checked the permissions on the folder you are trying to write to?
by raphael75
Wed Feb 11, 2015 6:51 am
Forum: PHP General
Topic: Having trouble with code
Replies: 0
Views: 648

Re: Having trouble with code

The best way to work with databases is with PDO. Check it out here:

http://php.net/manual/en/pdo.construct.php
by raphael75
Wed Feb 11, 2015 6:49 am
Forum: PHP General
Topic: PHP / HTML Quiz --- counting correct answers
Replies: 10
Views: 1927

Re: PHP / HTML Quiz --- counting correct answers

There are many ways to go about this. One way is in PHP to set a session variable that records the number of correct answers. You could also store the number in a database, or in a temp file on the server, or pass it from page to page using javascript and PHP, or just look at the filename of the las...
by raphael75
Mon May 05, 2014 12:15 pm
Forum: PHP coding => General
Topic: can't copy files
Replies: 0
Views: 523

can't copy files

I'm using a PHP script from the command line to copy files from a mapped drive on a remote computer to a folder on the local computer where PHP is running. I get an "Access is denied (code: 5)" error. When PHP runs from the command line, is it using the same user account it runs with when it runs in...
by raphael75
Thu May 01, 2014 10:26 am
Forum: PHP coding => General
Topic: negative zero
Replies: 1
Views: 751

Re: negative zero

Figured it out - floating point math isn't straightforward. Had to use number_format to round to 2 decimal places.
by raphael75
Thu May 01, 2014 10:14 am
Forum: PHP coding => General
Topic: negative zero
Replies: 1
Views: 751

negative zero

So I have 2 arrays of numbers, and this:

$variance = array_sum($db_tot) - array_sum($cr_tot);

If the sum of each array is the same, why does PHP return -1.8189894035459E-12? Why wouldn't it be 0 (positive 0 or just 0)?

Thanks!
by raphael75
Wed Apr 02, 2014 5:22 am
Forum: PHP coding => General
Topic: PHP from scheduled task can't see folders, CLI works
Replies: 2
Views: 832

Re: PHP from scheduled task can't see folders, CLI works

After a lot of testing I eventually figured it out. It turns out when a scheduled task runs another program, all mapped drives become "unavailable" to the program. You have to "re-map" the drives when the program runs in the context of a scheduled task. I had the PHP script do: $cmd = 'net use > net...
by raphael75
Tue Apr 01, 2014 5:48 am
Forum: PHP coding => General
Topic: Basic PHP form stuff
Replies: 3
Views: 857

Re: Basic PHP form stuff

Hi all newbie starting off here and HELP! I have a form that I want someone to type text into, this will later be saved to an SQL DB. I also have a date field, that I want to come up as dd/mm/yyyy, pre filled out with todays date, that cannot be edited. The text area works, but the date is a mess, ...
by raphael75
Mon Mar 31, 2014 10:59 am
Forum: PHP coding => General
Topic: PHP Get count
Replies: 0
Views: 741

Re: PHP Get count

something like:

Code: Select all

select
  count(id) as 'total', 
  monthname(date) as 'month'
from
  tablename
group by
  month
order by
  total desc
by raphael75
Mon Mar 31, 2014 10:48 am
Forum: PHP coding => General
Topic: How to make php wait for an confirm box to finish
Replies: 1
Views: 1210

Re: How to make php wait for an confirm box to finish

One approach would be to have 2 files like this: confirm.html contains the javascript asking if the user wants to reset. <script> function check_reset() { if(confirm('are you sure you want to reset?')) { window.location = 'reset.php' } else { window.location = 'index.php' } } </script> Then reset.ph...
by raphael75
Mon Mar 31, 2014 10:37 am
Forum: PHP coding => General
Topic: string split ?
Replies: 1
Views: 691

Re: string split ?

I think you are looking for the explode() function:

http://us1.php.net/manual/en/function.explode.php
by raphael75
Mon Mar 31, 2014 10:36 am
Forum: PHP coding => General
Topic: PHP from scheduled task can't see folders, CLI works
Replies: 2
Views: 832

PHP from scheduled task can't see folders, CLI works

Here is our setup: Server A - Windows 2008 R2 PHP script on server A that copies files Drive O: on computer B - Windows computer contains source files Drive V: on computer C - Debian Linux computer target folder We have the PHP script on server A that copies files from the mapped drive O: (on comput...
by raphael75
Mon Feb 24, 2014 8:45 am
Forum: PHP coding => General
Topic: command line -r not working on windows
Replies: 1
Views: 776

Re: command line -r not working on windows

I got the answer on another forum. Turns out I had to swap the quotation marks:

php -r "echo 'Hello world';"
by raphael75
Mon Feb 24, 2014 5:36 am
Forum: PHP coding => General
Topic: command line -r not working on windows
Replies: 1
Views: 776

command line -r not working on windows

We have a server with windows 2008 R2 with PHP5 installed. I can run php files from the command line using php -f file.php with no problem. However, when I try to run PHP code inline nothing happens: php -r 'echo "hello world";' Literally no output. Do I need to configure something in php.ini to get...
by raphael75
Tue Feb 11, 2014 7:18 am
Forum: PHP coding => General
Topic: implode() not working
Replies: 1
Views: 750

Re: implode() not working

Turned out there was a stray \r at the end of each element. After removing it the implode works.
by raphael75
Tue Feb 11, 2014 7:07 am
Forum: PHP coding => General
Topic: implode() not working
Replies: 1
Views: 750

implode() not working

I have an array like this: $myarray Array ( [0] => user1@example.com [1] => user2@example.com [2] => user3@example.com ) When I do: implode(',', $myarray); I get: ,user3@example.com The 1st 2 elements are missing. I have another array that looks exactly like the one above but it has 15 elements, and...