Date Function On Local Server To Remote Host
This little combo was giving me Sunday, April 30 on my local server and Thursday, April 1 on my remote host, and I can't for the life of me figure out why. I could swear it used to work. PHP Code:
$today = gmmktime(0,0,0,date('m,d,Y',gmmktime()));
echo gmdate('l, F j', $today);
(The first function gives me a "midnight" time stamp, so all dates put into the db, and compared to it, are consistent). When I rewrote it thus, it worked fine on both hosts:
PHP Code:
$m = date('m',gmmktime());
$d = date('d',gmmktime());
$y = date('Y',gmmktime());
$today = gmmktime(0,0,0,$m,$d,$y);
Any idea what the heck is going on?
View Complete Forum Thread with Replies
Related Forum Messages:
Mail() [function.mail]: SMTP Server Response: 550 Not Local Host Gmail.com
I do a mail() and get: Warning: mail() [function.mail]: SMTP server response: 550 not local host gmail.com, not a gateway in C:xamppxampphtdocs estsitemail.php on line 7 <?php ini_set("SMTP","rlwatkins.com"); ini_set("sendmail_from","hunter@rlwatkins.com"); mail("huntercjcarroll@gmail.com","hello me","spamtastic","From: hunter@rlwatkins.com"); ?> what is wrong with this, how do i set it so that i can send to something other than localhost?
View Replies !
Upload From Local Host To Server Using Ftp Functions
On my website I upload files from local computer to my server using FTP functions in PHP. It all works perfectly when I run the script from my pc, but once it s on the server it can t find the file. ftp_put(): error opening C:Documents and SettingsAlexanderDesktop r1_1.jpg I guess it happens cos it tries to find it on the server not on my PC. The question is, how can I point it to my pc, not server. Or how can I make it copy files from my local computer to the server while running from the server!
View Replies !
Php MySQL Works On Remote Server, Only Partially On Local Server
code to populate form select fields with data from a MySQL database, so a user can use those to sort/filter and view the 3,000 records. No inserts -- just selects; very simple. I originally set this up using URL-based query strings at http://stjuliana.org/school/ar/BUindex.php but since that only allowed sorting and not filtering, hence all 3k records load, I made a form verson at http://stjuliana.org/school/ar/index.php . Everything works just fine, however, there's still a lot of tweaking I want to do, such as splitting the form input and output into two pages (_blank), having a printable version, etc. To that end I just set up the latest builds of Apache, php and MySQL on my local Windows XP box, lest I blow my beer budget for the month on bandwidth overage. <g> I have a very simple page I used to test my localhost setup and everything's fine. I can connect to MySQL, create, insert and select from DBs, so I know my config is fine. All my other .php pages on this site work fine locally as well. The two abovementioned pages, however, are giving me fits when run locally... For the URL-query-string version, it loads up with the default view (=name_ns), which grabs all records and sorts by name and point asc. No matter which of the other sort 'views' I might choose, it still loads up all the records in that default sort. The server's holding on to something and I don't know how to clear it. The remote version correctly sorts based on the query string chosen. The form version is worse. It connects to the DB and populates the select boxes with the field data -- that part's fine. But no matter which submit button is selected, no data is retrieved. I get no error, but no data either. The form's action is set to $_SERVER['PHP_SELF'] and I've tried both GET and POST -- no change. Since the exact same pages work on the remote server I know it has to be something on the local setup. But where do I look if there's no obvious error? This is probably something incredibly basic but I'm bleary-eyed from reading tutorials and forums all over the Internet and can't come up with anything.
View Replies !
Download Files From Remote Server To Local Webserver
I am trying to create a php page whereby people can download files from a remote server to their own server (to update their webdirectory with updated files/images etc). So for example one php page (e.g. update.php) should be able to download files from a remote server to a specific directory on their local webserver. Is this possible?
View Replies !
Local Host
when i am trying to connect a database with this: mysql_connect (localhost, username, password); how do i find my local host?
View Replies !
Local Host Problem
I'm a newbie with php, and I have a simple problem. I have installed apache on WIndows Xp. According to the tutorial I'm following, after installing apache I should be able to type http://localhost into my web browser and see a web page that reads "if you can read this, then apache was installed successfully." Unfortunately, when I type in http://localhost, I get a prompt to enter a username and a password.
View Replies !
Local Host Is Set At Permission 0644
i just checked and the root directory for my whole local host is set at permission 0644. how do i change this? i don't think i have permission to change my permissions, because when i try to put the following code: chmod ("phppractice/processor.php", 0777); i get this error message: Warning: chmod() [function.chmod]: Operation not permitted in /Users/ivey/Sites/permissions.php on line 8
View Replies !
Emailing, 550 Not Local Host , Not A Gateway
Don't know if this is new news, old news or no news. Every time I tried to email with my php/mysql combo I would receive a email back from the system administrator with about 5 of the addresses listed with a message like this: 550 not local host <hostname>, not a gateway Tried all the php fixes, ISP technical support, checked for port 25 blocking and domain host support no dice. These were/are all good host names. Turned out that in typing in and/or importing addresses some (Those being rejected) were typed in capitol letters. As soon as they were converted to all lowercase the problem went away. I posted this because you have saved my a** so many times I can't count them. Why it worked I do not know but it worked.
View Replies !
Local And Master Safe_mode And Security At Host
I have the following question: a hosting provider has turned local safe_mode off and the master safe_mode is on. This prevents an application/php script to work. The provider refuses to turn safe_mode off due to security reasons. They work with some kind of virtual hosting I had a quick look at the system and saw a /etc /bin etcetera, in the /etc there was a php.ini where safe_mode was Off. a few questions: a) is turning (local) safe_mode off a real big security risk as the provider tells us? b) if so why is the master safe_mode turned on? On my own system both local and master safe_mode are turned off, and I did not modify anything when php was installed. another question arises: where are the local and master values set? Is there a good page on safe_mode? Google only points me a hosting provider that allows safe_mode to be on.
View Replies !
Include(ing) From Remote Host
I have been trying to include() a file from an external host. This file contains some arrays such as; module_name, module_version, module_filename. I need to be able to include() this file and use this data on the 'local' server. If I use a readfile(), the information is displayed in my page, so url, dns, etc are all correct. To use an include however, I get nothing. A simple sample (only module name array) follows; <?php global $modules; echo "I am on the remote server"; $modules = array(0 => 'module 1', 1 => 'module 2', 2 => 'module 3' ); ?>
View Replies !
Readir() With Remote Host
I have an issues with image and opendir or readir and i was hoping if you can help me. I have 2 domain names one of it I run image hosting script, and I want to display the latest uploaded image a the second domain I have, and I only know how to do it locally with opendir and readir but when it comes to do it with remote servers i'm completelt n00b.
View Replies !
ODBC >> DBF On A Remote Host
I'm running apache+php+winXP, and can connect easily to a dbf on my local system, but when I try to connect to the same dbf on a mapped NetWare drive I get this error: Warning: odbc_connect(): SQL error: [Microsoft][ODBC dBase Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides., SQL state S1009 in SQLConnect in C:Program FilesApache GroupApache2htdocslahblah.php Both DSNs are configured the same in the ODBC manager, one is mapped to the local file on C:, and the other on my mapped G: drive.
View Replies !
Remote To Local DB Sync
help me with regards to an efficient way in which to synchronize a localhost MySQL DB with a remote MySQL DB? I cannot use any 3rd party software as my host does not allow external access to the remote DB.
View Replies !
Can't Read Remote Web Page From Local Apache/PHP
I'm trying to read the contents of any Web page on another host. I'm finding that... echo file_get_contents( 'http://www.php.net' ); .... works fine if I upload the PHP script to my Web host, and run it there. But if I run it on my PC, which is running Apache 1.3.33 (Win32) and PHP 5.0.5, then it always times out, and gives me the error message... [error] PHP Warning: file_get_contents(http://www.php.net) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. I get the exact same results using... $fh = fopen( 'http://www.php.net', 'r' ) or die( $php_errormsg ); while (! feof($fh)) { $page .= fread($fh,1048576); } fclose($fh); echo $page; Anyone know what could cause this to happen?
View Replies !
Printing To Local Machine For The A Remote Site
I would like to find out if I can get a page to print on a printer physically next to the server when a user of my site clicks the submit button. I'm sure that there's a way, but being new and slightly slow I'm not sure where to even begin looking.
View Replies !
Connect Page (local) To Remote Database:
I'have Easy PHP in localhost and i need connect php page (local) to remote database: $db_host = "62.149.225.23"; $db_user = "gfo"; $db_password = "gfo"; $db_name = "gfonline"; $db = mysql_connect($db_host, $db_user, $db_password); The browser show this message: Warning: mysql_connect(): Can't connect to MySQL server on ེ.149.225.23' (10061) in e:phpgfonline.itprovaremoto.php on line 7
View Replies !
Copying File From Hosted Remote Sever To Local Machine
I am trying to use php to automate the copying of a file from my remotely hosted directory to my computer. I have put together the following but it will only do the copying from one directory to another on the remote server. Reading the postings on these functions they suggest that it can be done but it appears to be the case if your are hosting your site on the same machine you want to copy the files to. Does anyone know if there are functions in php to do the transfer from remote server to my machine or if the code below will acheive this with modification? <?php $ftp_server = "xxxxxxxx"; $ftp_user = "xxxxxxx"; $ftp_pass = "xxxxxx"; $local_file = 'myfile.txt' $server_file = 'myfile.txt' // set up a connection or die $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); // check connection if ((!$conn_id) || (!$login_result)) { die("FTP connection has failed !"); } // try to change the directory to myfilesdirectory if (ftp_chdir($conn_id, "myfilesdirectory")) { echo "Current directory is now: " . ftp_pwd($conn_id) . ""; } else { echo "Couldn't change directory"; } if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file"; } else { echo "There was a problem"; } // close the connection ftp_close($conn_id);
View Replies !
Script That Uploads A File To A Server And Then FTPs It To A Remote Ftp Server.
Basically I've developed a script that uploads a file to a server and then FTPs it to a remote ftp server. It was (as still does) work fine on my local testing server but since moving it across to IIS, when i run the script, now all I get is a blank page for anything but tiny files. I've tried increasing the values in php.ini that are associated with file uploads, yes I still get the blank screen.
View Replies !
Date/Time On Virtual Host
I am working on a site that will be hosted on a server in the US, but it's audience is primarily Australian. So I want to display the date and time items were posted etc in Australian time. What is the best way to accomplish this. I know I can use someting like: gmstrftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98)); to get GMT for the current time on the server. But how do I add the 10 or 11 hours difference to reflect the current time in Australia?
View Replies !
PHP/MySql On A Host Server
I'm very new to PHP/MySql and this is probably a complex question with a very simple answer. I have two hosts, godaddy and hostican and have the identical problem on both. I've successfully set up a database with tables. I've inserted data into the table. But I've done this all through cPanels. When I try to do it through PHP the script seems to work but the results (new tables, inserted data) doesn't show up when I go back to cPanels and look for them. Code:
View Replies !
Getting Ip Or Host Name Of Requesting Server.
I have a web server with a bunch of web services. I have another server calling these web services. I need to get the ip of the 2 server(the server calling the web services) within the actual web service method(the files stored on the first server hosting the web services). i tried $_SERVER['REMOTE_ADDR'] but that give me the ip of the user using the 2nd server, not the ip of the second server.
View Replies !
Web Host Says I Crashed The Server
My site was running fine until a week ago when the server seemed to be down a lot. When I contacted my web host, they said they would transfer my site to a seconday, "more" stable server. That's when my nightmare began. After moving to the new server, they asked me to change my scripts to accomodate the register globals. Last night, my site got suspended. Web host says that one particular page is maxing out their CPU's 3GHz processing. This never happened before (my site has been up 2 years). One possible explanation (I thought of) was that web owners were leaving them and due to shortage of funds, they have had to downgrade their servers package. Is this logical? If not, Why would or could such a thing suddenly happen supposedly caused by a page that has hardly been updated? Virus?
View Replies !
Decent PHP Virtual Server Host
I'm currently using startlogic.com for my PHP/MySQL virtual server. At $20, it's hard to beat the price. Unfortunately, I'm getting more and more dissatisfied with their uptime. I need PHP, MySQL, and the ability to host multiple domains. Are there any other hosts y'all have had good or bad experiences with?
View Replies !
Host Address For Mysql Server
My mysql database resides on the server. I have to connect it by navicat or other conversion tool. But there is some problem of host address. It shows the incorrect host address or port no. It seems that host address is wrong. What may be the host address of mysql server.
View Replies !
Unknown MySQL Server Host
I have some PHP code, running on my machine which connects with a remote MySQL database. Before deploying the code I test is locally. When deployed it then sits on a hosted server and accesses the same database. There is no conditional code and this was all working well until recently. I needed to enhance the appliation and made the changes but now it fails to connect giving error Quote: Code:
View Replies !
Uploading A File To A Web Host Server?
In the email they sent regarding the account information, they asked me to put all the html files in the 'public_html' folder. So I thought it should be same for php too. I put some .php files and also a .html file in the 'public_html' folder and when I tried to view the .php file, nothing comes up. But the htlml comes ok in the browser. I used ftp to put the files in their server. Does .php files have some other way to put in the server?
View Replies !
Unknown MySQL Server Host 'localhost '
I'm rather new to both MySQL and PHP. I've been trying to use PHP to write to a MySQL database. I call mysql_pconnect to get a database connection, but then when I call mysql_db_select, I get the following error : Unknown MySQL Server Host 'localhost ' I can connect to the database via the command line ok. Where can I look to find the source of this problem?
View Replies !
Host Switched Web Server.. Sessions Not Working
our web host switched us to cPanel and now all of our logins on our website are not working at all here is the error message we get. Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /homedirs/sonotek/public_html/sono-tek.com/pdf_download/pdflogin.php:2) in /homedirs/sonotek/public_html/sono-tek.com/pdf_download/pdflogin.php on line 3 I am using session_start(); at the beginning of each script here is a sample: ....
View Replies !
Web Server In Local
I work actually in local and when I put my php (and html) files on the local directory configured as localhost, an error message (which says that no files are on the server) appear. The server is Apache on Windows XP, and I see on the server only the Apache manual (and the message that says "Apache is correctly running!"). I had been just pass to Apache and I don't know what I do.
View Replies !
Always Local Time & Date Format?
Is there a script available that would re-format a time & date always according to the users' setting? Some setting that would be read by the language set in the browser or from the IP?
View Replies !
Export Local DB To Server DB
can anybody refer me to a tool so that i can upload data from my local mysql DB to server DB without phpmyadmin. I have FTP and other access to server. my DB is like 100 MB.
View Replies !
Local IMAP Server
I've installed EasyPHP on my Windows machine, which does the job really fine. Apache, PHP and MySQL easy going. What are the possibilities for installing a local IMAP and POP server for the same test/develop purposes?
View Replies !
Local Apache Web Server
At the moment I am using "easyphp" on my computer to test my php code. However, I would like to get a little more advanced and replicate an apache server on my home computer. Such that I can build a website using .htaccess on my home computer. I can build it at home, then upload it all nice and finished to an apache server. Does anyone know where I can get an apache server for my home computer? A kind of local host for apache? Also, I would like an IMAP email client on my server and to have some PHP code that is able to "read"/parse my incoming emails. Open them up - "read" them by looking for keywords - then delete them etc. Code:
View Replies !
Local IMAP/POP And FTP Server
I've installed EasyPHP on my Windows machine, which does the job really fine. Apache, PHP and MySQL easy going. What are the possibilities for installing a local IMAP and POP server and a FTP server for the same test/develop purposes?
View Replies !
Mail To Local Server
I have a question, May be i am wrong but i have doubt, If some body explain it either i can or not. Can i sent email to my local pc server then i read it. Explanation: For example i have a form where i put email, click on send button ,page executes and send mail. But is it possible to send this mail to local server on my pc,I mean offline internet. Without internet connection. I have apache with php,mysql And Windows server 2003. Then a script or software through which i read that mail. I want this only to check my scripts without uploading it to the internet server.
View Replies !
Local Apache Server
My php script uploads my files fine. I did a chmod 777 to the directory I want uploaded files to go, but when I upload to that directory (with php) none of the files have permissions, but the files are there. What's going on.
View Replies !
Displaying Local Date In Specific Format
i'm trying to decide whether to use PHP or JavaScript to display a date on a website. what i'm wondering is where does PHP take the date from, the server or the client (ie will timezone become a factor). aswell as this, is there a simple way to allow the date to be displayed as: "22nd" "1st" or "14th" instead of "22" "1" or "14"?
View Replies !
Determining Local Date/time, Given GMT And Offset
I'm trying to create a function that returns the local date/time if you feed it a GMT date/time and the local offset. For example i live in MST so i think it's GMT-7. This is the function i've created, but it's returning weird values. didn't work for me last night, but mysteriously worked this morning. maybe something screwy with AM vs PM? I'm passing the date in the format "Y-m-d H:i:s". I'm not so good with date calculations obviously. Code:
View Replies !
Reading Local File Not On Server
I am trying to parse a file which is located on the users local drive and then take this data and put it into the mySQL DB. However, I get errors when I pass in a file path such as C:Documents and SettingsAdministratorDesktopfooSLInfo.txt.
View Replies !
|