
jrw4
Members-
Posts
20 -
Joined
-
Last visited
Never
Everything posted by jrw4
-
Prevent PHP mail( ) from appending hostname to from address
jrw4 replied to jrw4's topic in PHP Coding Help
Holy random attack batman. Can you send data from a machine sans IP? I dunno, I know little about networks but I would assume you can. What does PHP have to do with the SMTP wrapper? I have no idea, again I do not study networks. @archonis I am trying to be able to send SMS texts to a phone as you already know so I want the "from" to be a phone number so if the user replies they will be replying to a phone. I have no idea of another way to send SMS to a phone with PHP (or any other web language) except for the technique I am currently using which is sending emails. I want the SMS to appear as an SMS and not an email which is why I don't want the @host to be appended. -
Prevent PHP mail( ) from appending hostname to from address
jrw4 replied to jrw4's topic in PHP Coding Help
But that is what I said already... if I try $header = "From: 9996663333"; Then PHP appends the host name to the from field (see thread topic). So the phone will then see that the SMS is from 9996663333@host. I do not want this, I am asking how to stop PHP from appending the hostname on the from field of an email. -
Prevent PHP mail( ) from appending hostname to from address
jrw4 replied to jrw4's topic in PHP Coding Help
If I try setting the headers to "$headers = "From: [email protected]\r\n";" then the user will see "9996663333here.com" on their cell phone when they receive the text message. All I want them to see is "9996663333" on their cell phone. -
Prevent PHP mail( ) from appending hostname to from address
jrw4 replied to jrw4's topic in PHP Coding Help
Whether or not I expect an email to be received from a non-existant host is beside the question. I am asking if it is possible to prevent PHP from adding its hostname to the "from address" when sending a message with the mail() function. -
Prevent PHP mail( ) from appending hostname to from address
jrw4 replied to jrw4's topic in PHP Coding Help
No, I don't want any hostname. I want the user to be able to see on the sms that it is just from "7785555555". -
Hey guys, I want to be able to send texts to phones via email (since each phone has their own address), and for specifying the from, I want to specify my own number, is there a way to do this? For example: $from = '7785555555'; if(mail($to, $subject, $message, "From: $from")) echo "Mail sent"; If I do this, the From in the email will be [email protected]. Is there any way I can send it so that it doesn't auto append the host name? Thanks!
-
Nah it's fine, there's a form helper in most frameworks anyways. http://docs.kohanaphp.com/helpers/form That's the documentation on the Kohana framework form helper. It's exactly what I was looking for.
-
An instant form button? Don't be ridiculous. I am thinking more on the lines of an API or some other tool where I could do something as simple as : $form = new Form(); $form->add("username", "text"); $form->output(); Something like this which would just generate a textfield called "username" that I am able to style with CSS.
-
I am not sure if this goes here or not but I couldn't find a more appropriate board. I find myself in PHP using a lot of forms to get input from the user which are quite annoying to write every time. Is there anything out there to generate forms for me much easier whether it be in PHP, jQuery or any other language? What would you recommend if there is such a tool? Thanks
-
I just want to point out that I am using this SQL currently: SELECT aid, COUNT(*) as papers FROM co_author WHERE aid <> 467 AND pid IN (SELECT pid FROM co_author WHERE aid = 467) GROUP BY aid
-
So I have three tables: paper (pid, pname, pyear, p_conference) author (aid, aname, a_institution) co_author (aid, pid, co_author_number) So papers stores the papers written and author stores all the authors. Co_author links together all of the multiple people who could write the same paper. So in that table you could have: 353 71 1 312 71 2 Which means that aid 357 is the first author of paper 71. And Aid 312 is the second author of paper 71. Now I am trying to write some queries to select from these three tables and I cannot think of the best way to do this. My first query is: Given the author id of an author, find all of his co-authors and they papers they wrote together. What do you think the most optimal way to write this query is?
-
I am using a feed (http://earthquake.usgs.gov/eqcenter/catalogs/eqs7day-M5.xml) with the google maps API to try and make a map with markers of all earthquakes in the last 7 days. I am trying to get simplexml_load_file to recognize the geo namespace but there's no documentation on it.
-
What is up with this. Look at: http://www.php.net/manual/en/function.simplexml-load-file.php There is no documentation with the ns parameter of that function and I am currently trying to deal with namespaces in an XML feed.
-
Well I was trying along the lines of: $input = preg_replace("/<content\K[^\>]+/", "", $input); Which just takes <content[ANYTHING]> and turns it into <content> which is alright but then I have to do a second line of code to remove that too: $input = str_replace("<content>", "", $input); I meant to ask how to do that in one line?
-
Thanks for asking that as I had the same question on \K. Now if I wanted to match something like: My pattern would be: $pattern = "/<content\K[\w]*>/";
-
If I have a string that looks like: or I am trying to get the value that is between xmlns: and the equal sign. <content type="xhtml" xmlns:[THIS IS WHAT IM LOOKING FOR]="http://www.w3.org/1999/xhtml"> So I have tried the following code: $string = '<content type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">'; preg_match("xmlns:[\w]+\=", $string, $matches); var_dump($matches); This returns null So I am not sure how to find that. What am I doing wrong and what should I do to find that part of the string?
-
Alright thanks. So it looks like I will have to hand parse the content field then.
-
If I try just echoing $child->content; nothing gets outputted for those tags.
-
What am I trying to do? I am trying to display each content value for each entry in an atom feed. echoing $xml->entry->content is fine and dandy if the attribute type of the content is "text" or "html". If it is xhtml then I am running into a problem. If I have an item like this in the feed: and I echo $xml->entry->content or $xml->entry->content->asXML() it will not appear properly. Currently I am getting something like: I am trying to figure out how to get it to appear as: There must be an built in way in SimpleXML to do this instead of having me to do it by hand. This is what I am asking to do. Is how to get an output that looks like the later instead of what I currently have which is the former.
-
Ok, to my question. I am making a simple atom feed parser. So far here is my code: <?php // read in an xml file $myFile = "an_atom_feed.xml"; $feed = simplexml_load_file($myFile); $xml = $feed->children('http://www.w3.org/2005/Atom'); echo "<h1>".$xml->title . "</h1>\n"; foreach ($xml->entry as $entries) { $child = $entries->children('http://www.w3.org/2005/Atom'); // post title echo "<h3>".$child->title . "</h3>\n"; // post author if (!empty($child->author->name)) echo "<p>Posted by " . $child->author->name . "</p>\n"; // post content if (!empty($child->summary)) echo htmlspecialchars($child->summary) . "<br />\n"; echo $child->content->asXML(); } ?> So far it seems to work fairly well. Obviously I am not dealing with every item in <entry> just the content and title. Now my question comes with, say my feed has the following items in it: I haven't been able to find a tutorial on how to deal with content types like those so I am not sure how to. If you know of tutorials that show me how to deal with stuff like this, that would be very appreciated. If you also know how to deal with it, teaching me would make me très appreciative. Thanks a lot