Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





PHP-SQL Connection Failure.


I had PHP installed on as CGI on a Window 2000 Server and connected to
an MSSQL 2000 on another server. Both server were upgraded to Windows
Server 2003 and problems developed that I could no longer run PHP any
more.

What I did next was to uninstall PHP and re-installed it as ISAPI, and
make necessary configurations in Windows Server 2003. PHP seems to
work fine now on my applications are having problem connection to
MSSQL. One thing to note here is that I am using the old php.ini as it
has been adapted to the application.

The problem has to do with connection failure as shown below:

Warning: mssql_pconnect(): Unable to connect to server: ServerName in
c:InetpubwwwrootApplicationDiradodbdriversad odb-mssql.inc.php on
line 327

Warning: error_log(c:/Application_temp/errors.log): failed to open
stream: Permission denied in
c:InetpubwwwrootApplicationDiradodbadodb-errorhandler.inc.php on
line 68

Fatal error: mssql error: [: Connection error to server
'ServerName,SQLUserName,PWD,Database' with user ''] in
PCONNECT(ServerName,SQLUserName,PWD,Database, '****', '****', ) in
c:InetpubwwwrootApplicationDiradodbadodb-errorhandler.inc.php on
line 75

Is there any changes I need to make in php.ini regarding ISAPI
installation.
I am working with PHP4




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Http Connection Failure
I'm making a php page that syndicates blog links using rss feeds and magpie to parse them. All is well, but there is one feed (my own!) that doesn't work. I always get a "HTTP Error: connection failed (1)" error.

I tried pulling the exact same file from another website and it worked, so the problem is just that one of my sites won't talk to the other one. It's not an anti-social site though, the feed has been syndicated on other sites in the past and works just fine in services like bloglines. Does anyone have any idea why I'm getting this error?

View Replies !   View Related
Imap/pop3 Connection Failure
After searching thru old posts, php.net and other places, I cannot find the problem in this. I am trying use the web-based mail client from the devshed's article-http://www.devshed.com/Server_Side/...ail1/page1.html .
The problem is the connection is not working. My server does not allow IMAP streams so the POP3 version used in this tutorial is a step in the right direction.

Here's the problem line: (or the line that I am having problems w/ anyway)

View Replies !   View Related
Connection Failure (Can't Connect To MySQL Server Through Socket) (111)
I am receiving the message WARNING MySQL Connection failed: Can't connect to MySQL server through socket '/var/lib/mysql/mysql.sock' (111).

I have been following the script 'Setting Up Database Driven Websites' by Ying Zhang posted on this website and all was well up to the point of executing the index.php3. That is, MySQL is working and the <? echo "Hello World"; ?> script to verify that PHP is functional worked.

I did a global search on 'mysql.sock' and found only 1 which is in /tmp/mysql.sock. Based upon the date/timestamp it was either created or touched by the 'Hello World' script mentioned above. Software: Mandrake 6.0 (RedHat 6.0), MySQL 3.23.2, PHP 3.0.8, Apache 1.3.6.

I only installed MySQL, as PHP3 was already in Apache. After checking all the conf and ini files of which I am aware, I am at a loss as to a remedy.

View Replies !   View Related
Create A New Database Connection And Using This Connection For The Current Browser
The database is MySQL I would like to ask if it is possible to create a new database connection (new connection ID: XX). This connection (ID:XX) will be used for the different pages within the same browser.

If the user open another new browser, it will create another database connection (ID:YY).

mysql_pconnect does not work because it will use the same connection for all browser. I want to have a specific connection for each browser.

View Replies !   View Related
XML Includes In PHP Causes Failure.
First off, I'm posting this question for a friend that doesn't have
access to the news groups.

Problem:
Using PHP as the base and has several PHP < includes > for various
functions, all this by its self works just fine.

Failure occurs on adding the XML include.

Here's the wierd: If all the PHP includes are removed/commented out,
the XML includes work fine. As soon as you replace/uncomment the PHP
includes everything fails.

View Replies !   View Related
Odbc_exec Failure
I want to execte some query using odbc_exec, but i receive the
following error both using odbc_exec or odbc_prepare. Connection is
successful but the other functions will fail. PHP Version 4.3.11 with
Microsoft-IIS/5.0.


Warning: odbc_exec(): SQL error: [TCX][MyODBC]Using static cursors
instead of requested type, SQL state 01S02 in SQLSetStmtOption in
c:inetpubwwwrootsubetrafikconnect.php on line 8

Warning: odbc_prepare(): SQL error: [TCX][MyODBC]Using static cursors
instead of requested type, SQL state 01S02 in SQLSetStmtOption in
......

Any help will be appreciated...

View Replies !   View Related
Session_destroy Failure
What would cause me to get this message: "Session object destruction failed..."

Here's the code I'm using:

session_name("Client_Area");
session_start();
session_destroy();

View Replies !   View Related
File_get_contents Failure
This may be a very easy question, and I may need to supply more
information, but basically trying to read a file at a URL with
file_get_contents() returns the error message:

[function.file-get-contents]: failed to open stream: HTTP request
failed! HTTP/1.0 403 Forbidden

View Replies !   View Related
Reopening Url On Failure
I was trying to code a script whereby I use fscokopen to load a webpage
into a string, then parse the code.

However, because of occasional timeouts and failures, I was trying to
add a method to attempt to try and reload the URL, say five times,
before it gives up and moves on.

I was playing around with 'do-while' strings, but can't seem to think
my way round this one.

View Replies !   View Related
Php Session Failure
In a php session I have set up a user can input several hundred values
on a form.

I then show the user what he or she has entered on a preview page
which he or she can then click ok or cancel.

On clicking cancel the user should be backed using this code

<td>
<div align="center">
<input type="Submit" value = "Continue">
&nbsp;
<input type="button" value="Cancel" onClick="history.back()">
</div>
</td>

I have used this before at it worked. However it now returns the user
to the previous page (form entry), but now all the values are empty.
Annoying if the user just made one simple mistake in the several
hundred entries they wanted to correct.

Any ideas what I am doing wrong?

Any other tricks to acheive this?

View Replies !   View Related
UNION ALL Failure
I'm trying to use UNION ALL to match three SELECT queries. Each query has 8 column names but for some reason it fails when I use a particular group of column names. Namely the 7th column names in the queries below (ad_credit_amount in the first two SELECT queries and transaction_amount in the third SELECT query). In mysql these both of these columns are set as VARCHAR(200) and utf-8 unicode. They contain numbers that include decimal places. This is really confusing me because the other columns are working fine with similar data.

$sql = "select * from

(
(

(
SELECT ad_timestamp,ad_number,ad_location,ad_category_number,ad_title,
ad_fee_amount, ad_credit_amount, ad_account_ballance
FROM ads_live WHERE
(.......

View Replies !   View Related
Strtotime Failure
I don't know how I should input date + time into a strtotime function (i'm a total noob) so I tested this:

<?
$d=01;
$M=01;
$y=1970;
$h=01;
$m=01;
$s=01;
echo "$d $M $y $h:$m:$s";
echo strtotime("$d $M $y $h:$m:$s");
?>

I get as echo strtotime '-1', wich means the strtotime has a failure. Can anybody explain me why? Or can anybody tell me how I can make a strtotime function that puts a timestamp in the database depending on the date and time inserted in a textbox? (one textbox or one textbox to insert the day, another to insert the year,...) I should be able to change a format like (for example) this : 01-02-1990 00:00:00 (midnight) into a timestamp. so dd-mm-yyyy hh:mm:ss (or something else just to make it work)I'm clueless.

View Replies !   View Related
Htaccess Failure
this looks weird. i'm trying for apache to parse php code in .html file; my .htaccess looks as follows:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Only these 2 lines of code. I have placed this .htaccess in the Sites folder (OS X). elow is the test.html which is also in the Sites folder.

<?php
echo "text";
?>

The error is my browser isn't displaying anything. Do you guys know where have I done wrong? I have chomed the .htaccess to 644. Do I need to tweak the httpd.config?

View Replies !   View Related
Database Failure
Is there a way to tell PHP, "Spend 5 seconds trying to reach the database, if you can't reach it, then load the file from the cached flat file.". I suspect the answer is no. I'm tempted to rewrite all my code in Java, just so I can have threads. And private methods. And private class properties. And real encapsulation. And interfaces. And abstract classes. And the ability to do anything.

View Replies !   View Related
Failure To Include
There are several php files my php code includes on a website using the include(function). all work except for one and this to me is the weirdest problem i've had so far in my php ciding experience. i tried renaming the file name of the include, tried rewriting the code in the files that does the inclusion. whatever i try it just does not work. if i include any other existing file IT WORKS. this one does not. here is the complete error:

Warning: include(admin__global.php) [function.include]: failed to open stream: Invalid argument in [....]/admin_user_login.php on line 9

Warning: include() [function.include]: Failed opening 'admin__global.php' for inclusion (include_path='.:') in [....]/admin_user_login.php on line 9.

View Replies !   View Related
Compiling/Installing PHP 5 Failure
I am trying to install PHP 5.0.4 on my Solaris 8 server.
I have already installed mysql 4.1.11 and Apache 2.0.54. Both appear to

work fine..

I'm running the ./configure with the following options:
../configure --with-apxs2=/opt/csw/apache2/bin/apxs --with-
mysql=/usr/local/mysql --with-zlib-dir=/opt/csw/lib

The script terminates with the the following error (from the
config.log)

-----------------
ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(client.o):
wrong
ELF class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_error /var/tmp/ccmSQSM2.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 56843 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_error();
-----------------

View Replies !   View Related
Require_once('DB.php') Failure
I'm using a relatively simple php script to query a mySQL database and
return values formatted to a variable string for interpretation by an
embedded swf. There is one php file that handles the connection to the
db (db_login.php) and one that handles the query (db_getProjects.php).
If I call up the db_getProjects.php file it simply spits back a
"&varibale=value..." blah blah string. The problem is that it works
only half the time...it'll be fine for a while then simply stop working
at all for a while...then start working again. When it isn't working
it is failing to even get past the require_once('DB.php') statement -
anything after that is never reached.

What could I be doing that is causing the require_once('DB.php') to
fail after working flawlessly for stretches?

note: I am making sure to close the connection at the end of each DB
call, so I don't think its due to open DB connections piling up, though
that seems to be the only logical answer.

View Replies !   View Related
Image Upload Failure
I have a script that I've been messing with and I am having trouble setting a path for images, I'm getting an upload failed response

on the webserver the path is www/OEM/admin/thumbs the php page is located in the "admin" folder Ive tried both paths, I think I'm messing something up. Code:

View Replies !   View Related
Header() Functino Failure
Why is the following error always displayed on my browswer when i use HEADER() function ?

Warning: Cannot modify header information - headers already sent by (output started at C:wampwwwApplicationsGuest_Bookadmin.php:10) in C:wampwwwApplicationsasic.php on line 6

View Replies !   View Related
Exif Module Failure
I am absolutly exausted to figure this one out. I require the exif module to work under 5.0.1 but apache (2.0.48) just dies with a 1067 failure, I can't find any usable log info apart from the 1067. Anyone had the same problem?

View Replies !   View Related
PHP Install On APACHE A Failure
I've been trying all day to configure PHP with Apache and it's been a nightmare I've tried every suggestion that is out there, including PHP's official manuals, and it's been nothing, but a failure. Code:

View Replies !   View Related
Mysql Connect Failure
I have 2 scripts that both start with:

<?php
// Database Connection
include 'connect.php'

One of them is fine, but the other gives the error:

Warning: mysql_connect(): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (111)

Since the same file is being included both times, I can't see why it should fail in one case. Any ideas anyone?

View Replies !   View Related
Failure Of Smtp On Port 25
i have setup smtp on 2003 web edition, IIS. Port 25 is blocked and will not respond to any telnet open commands, so i have opened port 26 which now works fine... IS this any less secure than port 25?

View Replies !   View Related
Mail() Failure To Connect To Mailserver
I have wrote a simple mail script which was working fine - when I moved it to a different server I get the error: -

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:homeproject32sendmessage.php on line 219 code:

View Replies !   View Related
PHP Does Not Display Error Messages About The Failure
I have PHP 4.3.7 running on my client's Windows 2003 server. The same
computer also runs SQL Server and I am trying to connect from PHP to a
database. This fails, so I would like to track down the cause for this
failure.

However, PHP does not display error messages about the failure. I have tried
these:

php.ini:
display_errors = On

test.php:
error_reporting(E_ALL);

phpinfo() says error_reporting is set to 2047 (E_ALL).

Yet I still do not get any errors.

Even when I write arglebargle code, PHP still produces a blank HTML-page
instead of syntax error message.

Are there any other settings in addition to the two forementioned which may
affect error reporting?

View Replies !   View Related
Echo Long Strings Failure
I have a situation where I am echoing a long string to a client (winsock receive). This string is an extraction from a database. I use a while loop to do this (code below) . Problem is the echo immediately following the last iteration of the while doesn't get seen by the client (sometimes). Code:

View Replies !   View Related
Recent Failure Generating PDF Via FPDF
In latter stages of development on a SugarCRM based Home Inspections app (deployed independently on numerous Tablet_XP/WAMP stacks) recent updates have left the system on one of the Tablets failing to Generate our 'contract.pdf' This is a feature that has otherwise been functional for 6 months plus.

The curious thing is that a carbon copy of the app functions beautifully on an 'identical' sister Tablet.

Caveats / Known Subject System Discrepancies:

For two Toshiba tablets purchased, shipped and 'programmed' simultaneously. I am absolutely BLOWN AWAY by the quirky differences between the two.

Subjects Run:

'Carbon Copies' of the Same wamp stack, Customized Sugar CRM app, Table Structure AND Data. (by import)

Tablet A: Generates PDFs.
Tablet B: Does Not.

Tablet A: Arrived from Toshiba loaded with ADOBE Reader 7.0 - (NO recollection of having updated this)

Tablet B: Arrived from Toshiba loaded with Acrobat Reader 5x

In the course of recent and sizable updates to the CRM app, we also upgraded Tablet B: to ADOBE Reader 8 in order to gain Send/Mailto functionality not featured in Acrobat Reader 5x. As yet, I have little reason to suspect that this is the source of the problem, however after copying and pasting the entire wamp/www folder from Tablet A, to Tablet B and finding that PDF generation
continues to fail... My suspicions grow.

Still should ADOBE prove NOT to be the problem... What then? Drop and rebuild the server? DataBase? Data?

As for the Data, it is largely the same (user tables/system settings notwithstanding) synchronized
via SQLyog, however there may well be subtle differences in table structure (indexes... ?), but I don't believe the PDF scripts to be all THAT critically dependant on data from the database.

Seems like -- worst case scenario -- a contract.pdf might get created with empty data fields
(first_name, last_name, billing_address...) but the rest is just html_write from SavePDF.php.

Otherwise, perhaps something to do with Apache?

Ahh... The plot thickens -- as we learn that the Apache server on Tablet A: (the one that works)
throws errors every time it is shut down from wamp admin utility, and the mysql server is comparatively DOG SLOW, WHILE the wamp stack on Tablet B: NEVER throws an error, and is comparatively LIGHTNING FAST

View Replies !   View Related
Failure When Uploading Large Files
<form enctype="multipart/form-data" action="./ProcessUpload.php" method="POST">
        Upload this file: <input name="userfile" type="file" />
        <input type="submit" value="Upload File" />
        </form>

That's the code I have for uploading files, it works fine for uploading small files but I'm unable to upload large ones.

I'm trying to upload a 22MB PDF file but even after removing the MAX_FILE_SIZE limit(Which was high enough before) the file information still doesn't make it to the processupload page. I get the error that the variable 'userfile', from $_FILES['userfile']['name'] doesn't exist.

View Replies !   View Related
Handling File-read Failure
I'm kinda new with php, but I'm dying to know how to do the following. But can't seem to get the syntax right. Here's the pseudo code:

Page Refresh = 30 secs
--Read file-a.txt
--file-a.txt not available?
----read file-b.txt
----file-b not available?
------do nothing... (page will refresh in 30 secs and repeat the process)

The problem:
=======================

I have a lot of visitors accessing my site and a lot of times the page becomes inaccessible if it refreshes at just the right (wrong) time while it's being read/written to. Instead of the page locking up or giving a server error, I want to be able to try to read a secondary file as a backup.

View Replies !   View Related
Login Failure On Secure Website
I have a website that has a secure area to view data and any login does not work anymore.

I had another problem in that I was not able to upload and then view data that is displayed in this area and attempted to clear out all the data thinking  had reached some sort of limit and after clearing out this data the secure login no longer works. My question is where would the username/password be stored for the logins (emailaddr/password form)?

I believe I have managed to get rid of the whole directory structure that the .htpasswd file lived in as I found a link to a location that no longer exists but do remember that the uploads lived in this area too.....DOHHHHH I know but i am a novice and a little bit o knowledge is dangerous. I am still able to SSH in and access email etc so all is not lost but would aprreciate some help in making it semi operational again.

View Replies !   View Related
Fpassthru And Fopen Failure In Internet Explorer
has anyone experienced using fpassthru and fopen?

I'm experiencing massive problems in internet explorer, i've created a smaller basic script shown below to try and solve the problem but as yet nothing.

im using php sessions to manage logins so the use of htaccess is not available so the files are stored outside the public_html folder

every combination of headers i have use has worked flawlessly in firefox but not in ie6.

PHP Code:

View Replies !   View Related
Apache 1.3.27, PHP 4, SuSE 8.2 PRO - Form-Post Failure
I've recently done an upgrade installation to SuSE PRO 8.2 from
same/8.0.

The problem now is that I don't seem to be receiving data from forms
to PHP-processing pages using either POST or GET for the form method.

When I use GET, I see that the URL has been correctly formed with the
variable name embedded in the URL along with the properly formed
value:

http://www.whatever.com/test.php?ma...Process+Request

Then, in a sample php script:
<?
print "main: $main<BR/>
";
if ($main == "") {
print "main is blank<BR/>
";
}
?>

All I get in the output HTML on the test php script is the "main: "
portion of the print command - the variable is reported as a null and
tests positive for a null.

The php function test() shows mod_php4 is loaded. I have
performed/duplicated these results with the firewall on and the
firewall off. Not that I think the firewall is an issue since the GET
method shows, via the URL, that the variable information is passed
across forms. But I did read somewhere that a firewall can impact the
POST method so I turned it off to try it - no change in the results.

Even tho the info is being passed (GET), it's not accessible by
var-name access in the PHP script. All the php scripts on my server
are so affected and were working prior to the upgrade.

Any ideas? I also suspect this is why my squirrelmail installation
stopped working.

View Replies !   View Related
MySQL Connect Failure - Command Line
I have the following code

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

@ $db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

The first echo is executed but the second is not. I have ran the very same
parameters from the command line using:

mysql -h localhost -u Fred -p

Then

use house

and I connect to the house database.

I tried this in both IE 7 and Firefox with the same results.

View Replies !   View Related
Telling The Difference Between Zero Rows Returned And Failure
Suppose I make a call to MySql and zero rows come back. How do I tell
the difference between zero rows and failure?

View Replies !   View Related
FilterEvasion, Character Encoding And Preg_match Failure
I'm concerned about filter evasion. Take this regexp to match a : (colon)

$subject='test colon here : (normal)'
if (preg_match('/(:)+/',$subject)){print '<br/>found a colon in "'.subject.'"'}
else {print '<br/>did not find a colon in "'.subject.'"'}

All well and good but there is more than one way to write a colon. Code:

View Replies !   View Related
Mail Function - Failure Mails Receives Provider
what can i do in the following mail function, which hast 400
subscribers
who are read from a database and to which the mails are send in a
loop, when there are some adresses who are not reachable.
My provider receives all the failure mails.
is it possible to send the mail daemons ( failures ) to a special
adress,
so that the provider doesnt reseive so many emailfailures ?
he hates me for that. is that a server problem ?



View Replies !   View Related
Re-displaying Sensitive Form Data On Validation Failure?
i have a form that prompts a user for a credit card information. i have some pretty extensive validation in the form handling code that can produce a variety of error problems. The form is hosted securely via HTTPS.

in the event that the submssion fails, I'd like to display the form again with as much information as possible to reduce the user's need to re-set every form element (like card type, expiration date, etc.). Code:

View Replies !   View Related
Warning: File(): Php_network_getaddresses: Getaddrinfo Failed: Temporary Failure
I have made a simple script that will go to a web site scrape the lottto results off and then create a web page with them on.

I have permision from the owners of the site so i know they havn't blocked my ip address.

But every time i run the script i get this error

Warning: file(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/jueaprnv/public_html/numbers/index.php on line 8

Warning: file(http://www.winonnumbers.com/T2_3.php?YEAR=2006): failed to open stream: Connection timed out in

this is the script


<?
$year = $_GET["year"];
if(!$year)
{
$year = date("Y");
}

$lines = file("http://www.winonnumbers.com/T2_3.php?YEAR=".$year);
$filename = "results-".$year.".htm";
//$filename = "results.htm";

if (file_exists($filename))
{
$outputfile = fopen ($filename, "w");
}
else
{
$outputfile = fopen ($filename, "a");
chmod($filename, 0777);
}

$drawdate = '<td width="225" class="purpleTextBold">'
$draw = '<td width="70" class="purpleTextBold">'
$number = '<td width="32" align="center" class="purpleTextBold">'
$bonus = '<td width="60" align="center" class="purpleTextBold">'

$topline = 0;

$outputstring = "";
foreach ($lines as $line_num => $line)
{
if(strstr($line,"<html>"))
{
$outputstring .="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">";
$outputstring .="<html>";
$outputstring .="<head>";
$outputstring .="<title>Irish Lottery Results</title>";
$outputstring .="<style media="all" type="text/css">
td { font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif; }
.hd {background-color:#000055; color:#ffffff; padding:4px 0 3px 0; font-weight:bold;}
.cn {background-color:#F0F4FF; color:#000000; padding:4px 2px 3px 6px;}
.dn {background-color:#E0E4EE; color:#000000; padding:4px 2px 3px 6px;}
</style>";
$outputstring .="</head>
<body>";
}
if(strstr($line,$drawdate))
{
$drawnum = 0;
$topline = 1;
$stringpos = strpos($line,$drawdate) + strlen($drawdate);
if($stringpos != strlen($drawdate)) //draw date
{
$printline = substr($line, $stringpos);
$printline = substr($printline, 0 ,strlen($printline) - 7);

$outputstring .= "<table width="380" border="0" cellspacing="0" cellpadding="0">
";
$outputstring .= "<tr class="hd">
";
$outputstring .= "<td width="70" nowrap>Draw Date</td>
";
$outputstring .= "<td width="5">&nbsp;</td>
";
$outputstring .= "<td width="225" colspan="12" nowrap align="center">". $printline ."</td>
";
$outputstring .= "<td width="60" align="center">Bonus</td>
";
$outputstring .= "</tr>
";
}
}
if(strstr($line,$draw))
{
$ball = 0;
$stringpos = strpos($line,$draw) + strlen($draw);
if($stringpos != strlen($draw)) //draw date
{
$printline = substr($line, $stringpos);
$printline = substr($printline, 0 ,strlen($printline) - 7);
$outputstring .= "<tr";
if($drawnum == 0 || $drawnum == 2)
{
$outputstring .= " class="dn"";
}
else
{
$outputstring .= " class="cn"";
}
$outputstring .= ">
<td width="70">" .$printline."</td>";
$outputstring .= "<td width="5">&nbsp;</td>";
}
$drawnum++;
$topline = 0;

}
if(strstr($line,$number))
{

$stringpos = strpos($line,$number) + strlen($number);
if($stringpos != strlen($number)) //draw date
{
$printline = substr($line, $stringpos);
$printline = substr($printline, 0 ,strlen($printline) - 7);
$outputstring .= "<td width="32" align="center">". $printline ."</td><td width="5">&nbsp;</td>";
$ball++;
$topline = 0;
}

}
if(strstr($line,$bonus) && $topline == 0)
{

$stringpos = strpos($line,$bonus) + strlen($bonus);
if($stringpos != strlen($bonus)) //draw date
{
$printline = substr($line, $stringpos);
$printline = substr($printline, 0 ,strlen($printline) - 7);
$outputstring .= "<td width="60" align="center">". $printline."</td>";
$ball ++;
}

}

if($drawnum == 3 && $ball == 7)
{
$outputstring .= "</tr>
</table>
<br>
";
$drawnum = 0;
$ball = 0;
}
if($ball == 7)
{
$outputstring .= "</tr>
";
$ball = 0;
}
if(strstr($line,"</html>"))
{
$outputstring .= "</body>
</html>";
}
}
if($outputstring != "")
{
fputs($outputfile,$outputstring);
}

fclose($outputfile);
?>



Now i would jsut think it my code. But it has worked for about 6 months and then suddenly stopped yesterday. I have sent an email to the host of my site to see iff they have change any settings.

Any ideas what it could be or a different way of doing it.

www.betfredcontent.com/numbers/index.php

View Replies !   View Related
Error Trapping Getaddrinfo - File Not Found V. Temporary Failure In Name Resolution?
I'm trying to trap errors when I try to load a url into an array. I can
trap all errors by using this code:

if ( @file($url) == false ){
got a problem;
}

.... but then I don't know whether the problem is that the url file
doesn't exist, or whether it's just a temporary failure in name
resolution.

1. Is there a way to find out what the problem is?

2. I apologise for this question, and my only defence is that I'm a
newbie! Could someone please explain what the '@' in my code above
does? I've been rtfming and googling until I'm blue in the face, but I
can't figure it out...

View Replies !   View Related
Warning: Ftp_put() [function.ftp-put]: Rename/move Failure: No Such File Or Directory
I've just moved our site to a new server, and after doing so I am having problems getting ftp_put() to work. We use it to upload pictures, but when I try to, it gives me the following error:

Warning: ftp_put() [function.ftp-put]: Rename/move failure: No such file or directory in /home/intimate/public_html/include/functions.php on line 271

It worked with our previous hosting company, so I'm not sure what is different. I've verified that ftp login works, so the connection itself is alright.

Here is the function, making problems:

function upload_file($source_file, $destination_file) {
if ($conn_id = ftplogin()) {
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if (!$upload) {
return "Det lykkedes ikke at uploade $source_file til $destination_file";
}
ftp_close($conn_id);
} else {
return "Det var ikke muligt at forbinde vha. FTP";
}
return false;
}


Line 271 is the following line:

$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

View Replies !   View Related
DB Connection Handling - I Get "too Many Connection" - What's The Solution?
I have a php-webpage that needs the database in the beginning and in
the end of the script. In the middle there is a lot of processing that
takes several seconds - during that time I don't use the database
connection.

What is the best approach? Should I close the connection after I'm
done with it OR should I reuse the connection thru my whole script?

Where can I read more about this? Any pointers?

Today I'm using the same connection thru my script. And sometimes I
get an error from the database "too many connections". What does that
mean? My webserver provider says that I have at least 100 connections
to play with. How come I get this error?

View Replies !   View Related
Weird Warning: Db2_fetch_array() [function.db2-fetch-array]: Fetch Failure
I've written a class Cars that is a holder class for <code>Car</code> and it's designed to fetch Car records from  out DB2 database. And it works fine until I return the $result to the calling function.

I can use my $result to print html table but only inside the getAll method.
When the $result is returned to the calling function the $result source is no more working  properly as expected by me though the resource id stays the same. Code:

View Replies !   View Related
Raw SSL Connection
I need to send (not post, just send) some string to an SSL server. This is nog a SSL enabled webserver, but a pure SSL-server wich doensn't understand HTTP. Therefor I think I need to make a SSL socket connection and fwrite() the string to the socket. The SSL-server performs certificate authorisation, so I need to send my certificate and private key with the string.
As far as I understand, PHP can't to this so I need to perform the ssl handshake myself with some openssl functions, then ssl encrypt the string with another openssl function, send it to the socket... read the response, decrypt it, and process this further?

Does anyone have a clue how to do this?
cURL is not an option since cURL, as far as I know, only talks HTTP over a wide range of protocols.

I've been messing with 'openssl s_client' but after the SSL handshaking completes the connection is closed and I am unable to send a message.

View Replies !   View Related
Php Sql Connection
i get this error when trying to use php to add something into the database, i thought Php wasnt compiled correctly but i am using phpMyAdmin so surely that uses mysql_connect!! and that works fine. I am using a cobalt raq4 if that has anything to do with it!
Error i get!

Fatal error: Call to undefined function: mysql_connect() in /home/sites/site20/web/vb/confadd.php on line 2 Code:

<?php
mysql_connect ('localhost','username','password');
mysql_select_db ('database');
$result=mysql_query("INSERT INTO table (accesscode,referee,username,password) VALUES ('$accesscode','$referee','$newuser','$password')");
echo ("User has been added");?>

View Replies !   View Related
Which Connection Is Best?
I started with php and mysql and i discovered three methods for connecting
to a database:


$conn="DRIVER={MySQL ODBC 3.51 DRIVER};SERVER=10.0.0.181;DATABASE=reserv";
$connect=odbc_connect($conn,'root','pw');

include('/inetpub/wwwroot/resphpaccess/adodb/adodb.inc.php');
$db = &ADONewConnection('mysql');
$db->Connect('localhost', 'root', 'pw', 'reserv');

$link = mysql_connect("localhost", "mysql_user", "mysql_password")
or die("Impossible de se connecter : " . mysql_error());


Which one is the best and why?
What are the pro/contras for each?

View Replies !   View Related
Connection To An Outside Db
Can we connect to a database(mySQL) using php, on another site. IE:  siteOne.co.uk runs some script that can connect to siteTwo.co.uk mysql database, therefore looking as its got is own etc? Any ideas or a straight NO.

I did mention about running a php to xml page that reads the db and converts it to an xml page and then it can get the data from there with absolute path etc ?

View Replies !   View Related
Connection To An Away SQL DB
is it possible to connect to a SQL db which is not on the same servor (if i have the SQL config : log, pass, name of the db .

View Replies !   View Related
Php Connection
My windows program logs into mysql with details.

localhost
root
admin

but my script will not recognice localhost

im using mysql 5 and
php4

View Replies !   View Related
Sql Connection
Windows 2003 web server with php installed and appears to be working with a vairied amount of php speciifc scripts that work fine.

Windows 2003 with SQL 2005 database server. Databases can be accessed thru 100+ machines perfectly with the sql client tools.

Now all im trying to do is connect to the database server and post whatever info is in the table using php. Code:

View Replies !   View Related
DSN Less Connection
show me the code to connect my my access database with a dsn less connection please?

View Replies !   View Related
MLS Connection?
Is there a national MLS database that's available to the public? or any real estate agent?

I'm curious how to search the database. I already know how to set up a database connection, and how to perform queries, but I can't find any information on MLS databases and how to connect to them.

View Replies !   View Related
Database Connection ?
I am very new to PHP...Can i get the starting code for connecting to database....how to open the connection...what is the connectionstring ?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved