I am using a mail function to send html to an email address, but the From name and email address aren't showing up. This is my code:
$name = $_POST['name'];
$mailTo = '[email protected]';
$subject = 'Message from ' . $_POST['name'];
$message =
'<html>
<head>
<title>HTML email</title>
</head>
<body>
<p><...
I have several laptops in the field that need to daily get information from our server. Each laptop has a server2go installation (basically Apache, PHP, MySQL running as an executable) that launches a local webpage. The webpage calls a URL on our server using the following code:
$handle = fopen( $downloadURL , "rb");
$contents = strea...
This question has been asked before in a more general way. I want to display error messages on a particular page on my production server and i do not have access to the php.ini file. What is the best way to enable all errors and warnings on a particular php page on your production server?
I have tried ERROR_REPORTING(E_ALL);
...
I am trying to match quoted strings within a piece of text and allowing for escaped quotes within it as well. I tried this regular expression in an online tester, and it works perfectly. However, when I try it in preg_match_all, it fails at the first escaped string.
Here is the code:
$parStr = 'title="My Little Website"
year="2007"...
Okay - I'm beaten.
I have a (PHP-CLI) server written using PHP's socket_* functions. I can connect just fine to it using Putty and it works as expected.
However my PHP-CLI client does not work properly. It seems like the client is trying to grab the socket from the server (yes the server/client are on the same system).
They do se...
I'm using heredocs for a php/mysql insert statement on godaddy. When the function is called the page refreshes correctly, however, the data is not being inserted into the database and no errors are appearing. I've tested locally using MAMP and when the file is uploaded to the server it does not work. Has anyone had this issue before o...
I need to activate a "div" based on the user agent string. For example, (and this is my actual use for this,) A user with Firefox comes to my site. I want to tell them something along the lines of "Welcome Firefox User! Thank you for supporting Open Source Software, etc;".
That message is inside a Div. I would like to just show it for f...
Hi there,
I’m writing a command line PHP console script to watch for new URLs and launch (large) downloads for a client’s project I am working on. The client is currently manually downloading them with a slightly specific wget command and ideally would like to stay with that.
I was wondering what the best way to call wget from PHP woul...
Hello sir/madam,
Sir I'm new for php, Sir now I'm working on website ,In which there is one problem is occure in email form,
sir i want to attach more than one file as attachments(for this task i got required code ),I have one browse button,but i'm not getting what code i have to write there for invoking required fi...
Hey all,
I have this SimpleXMLElement object with a XML setup similar to the following...
$xml <<< EOX
<books>
<book>
<name>ABCD</name>
</book>
</books>
EOX;
$sx = new SimpleXMLElement( $xml );
Now I have a class named Book that contains info. about each book. The same class can also spit out the book info. in XML...
how can i make a page just like facebook status updates where user can see their friends activity?
If i have two tables one for users and other for friends the the user can see others activity those are in his friends list. How can i do that?
...
Hi everybody.
I can not manage to have both i18n and tinyMCE widgets on internationalised fields.
If i put both, i will have internationalised fields for all my objects' fields, but no tinyMCE for them. I will have as much tinyMCE fields as i declared, but thew will not correspond to any language, they will be at the beginning or at the...
My partner on a PHP project objects my practice of always sanitizing integer values in dynamic SQL. We do use parameterized queries when possible. But for UPDATE and DELETE conditions Zend_Db_Adapter requires a non-parameterized SQL string. That's why I, even without thinking, always write something like:
$db->delete('table_foo', 'id = ...
Hi My fellow geeks
I am trying to write a php script that take a text file break down its contents and and insert it into a MySql database, the code is as follows:
$file = "my_file.txt";
$db = "db_name";
$link = mysql_connect("localhost","root");
if(!$link) die("Connection Failed");
mysql_select_db($db) or die("Could not open ...
This is the PHP code:
$html=<<<eod
<div>Your current account balance is <span style="color:red">$$balance</span></div><br/>
<form id="digitalchange" action="digitalchange.php?" action="post">
<input type="hidden" name="tid" value=$announcementid />
<table rules=all FRAME=BOX><tr><td>Balance:<span class="price">$balance</span></td><td>Cu...
I have a form that has a drop down list of song titles. I want to be able to click on one of the song titles and the lyrics be loaded on the same page. The lyrics are contained within .txt files in a folder called "Lyrics".
Example:
Drop down list contains:
Song1
Song2
Song3
etc.
When the user clicks on the song, the contents of th...
Someone can explain me the difference from Memcache and Memcached in PHP environment?
What are the advantages of one over the other?
Can you also suggest that the criteria used to choose between one or the other?
...
Hi,
Does anyone have an idea how to make a countdown ticker that shows the hours and mins left until a perticular time of day and on a weekend (Sat and Sun) the time left until 16:30 on Monday. It would need to reset @ 16:30 everyday except the weekend days.
This has got me stumpped and really could do with some pointers.
Thanks,
B.
...
Hello!
Currently I'm making data parser via Telnet connection using PHP.
I've encountered problem:
I need to put pointer in a stream to the certain place(not to the end of data), but using of fseek() function is impossible with streams.
Tell me, please, how can I solve this problem?
...
I have a site with a rotatory banner, and there is a JavaScript that implements the rotation. I have instructed Apache to return Expires header for all images for a time in the future (maybe 12 hrs) something it is doing every time.
The problem is Firefox (and the others I assume) is asking Apache for the validity of the image every time...