|
Dear Cjoki,
I think you haven't understand the question. Well I am replying it again to make you clear that, I want to execute a url in php file which is executing in a cron job. The url after executing will be sending a sms to the specified number in the url.
I hope you now understand the question and can give me a positive approach of solving it.
Thanks
Varun Sareen
|
|
|
|
|
From my reading of SMS on wikipedia it looks like that the SMS gateways need a user login for the connection. This may be why you are getting the message you are.
I wonder if you have tested your connect to the gateway outside of the php script? can you connect to the gateway using another application and send a message?
Here is the SMS info for your review. http://en.wikipedia.org/wiki/SMS[^] Maybe it will shed some light on your issue.
|
|
|
|
|
Dear Czoki,
It's really great and so nice of you that you are showing so much of involvement into my problem but i guess you still not able to get me, I wonder where i am going wrong. Well let me try again....
My question is that how a URL can be executed in a cron job. The URL is actually calling the gateway server ( a third party client) with all the credentials required (I have checked it manually, I am able to send the sms from this gateway server by executing the php file (containing the URL) manually).
But the problem is arising when I am executing the php script file from cron job, the url code is not getting executed and hence the sms is not being sent.
I hope now you can understand where the problem is coming and eagerly waiting for a gud and positive reply.
Thanks
|
|
|
|
|
OK Varum,
You are having an issue with cron running the php successfully?
You can manually run the php script with success?
What does your commandline look like that runs the php script?
|
|
|
|
|
Hello Cjoki,
There you go dear, I am happy that i made you understand my problem.
Well, Yes I am having an issue in php script code but not in running the php script through cron job but in executing a URL in the php code while executing the php script file through cron job (although I am able to execute the URL while executing the php file by typing the location of php file in the address bar).
In order to execute a URL in php script; I have to execute it in a iframe control but the particular iframe control code is not running when i execute the php file through cron job. The iframe code is as follows:
<iframe src="$strURL" height="0 width="0" "></iframe>
(where "strURL" is the location at which my php file is present)
Regards,
Varun Sareen
|
|
|
|
|
iframe s aren't PHP code, they are HTML elements that are interpreted by web browsers. You can't run a mixed HTML/PHP page using the stand-alone PHP interpreter. You must figure out what the HTML code emitted by the PHP script actually does when interpreted by a browser, then duplicate that action by a different script (possibly in another programming language).
|
|
|
|
|
markkuk is right here. Please understand that php runs on the server and your iFrame runs in the clients browser. I am not even sure how cron works into this as I thought you were making a shell program, not one that runs in a browser.
Beside that you also have issues with permissions that require attention and cross site scripting issues to boot.
I suspect your code logic is way off mark Varun ...sorry.
modified on Friday, October 1, 2010 10:27 AM
|
|
|
|
|
Dear Cjoki,
I just want to know the solution from you, friends and i very well understand that i can't run a html control code in cron job.
I was just asking that the thing wasn't working what's the other way out.
I wish i could have mentioned that: "I know why
<iframe></iframe> is not working in cron job otherwise i may be receiving some solution rather than such harsh comments from you friends. .
It's sad...
Well....
Thanks
Varun Sareen
|
|
|
|
|
Hi php folks...
I decided to try to make an PHP script that a webform could call, to send an email, so I doesn't need the ugly mailto:xxx@yyy.domain in the form action.
So I have 2 pages. 1 frontend (html) and 1 backend (php).
The frontend contain an webform that on submit using the backend php as action, so its like:
index.html
sendemail.php
action="sendemail.php" (in the index.html form).
Everything works fine, and I recieving the emails as supposed... I have configured the php.ini to use my own smtp server (which I use at work too, so I know the SMTP server works).
the issue now is, that I want to send my emails as utf-8 format, cuz the need of some special characters inside the email?!?
I'm using the mail($to, $subject, $body, $header); as function right now... And when I type in some utf-8 formatted characters like ø, its viewed as ?? in the recieved email
How can I send my email()'s as utf-8?
I have try following:
- Set header of the email to utf-8:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8' . "\r\n";
$headers .= 'From: ' . $_POST['email'] . "\r\n";
I'm using Eclipse PHP as php editor for development.
$dato = date("d-m-y");
$to = "your@domain.dk";
$subject = "Web $dato";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8' . "\r\n";
$headers .= 'From: ' . $_POST['email'] . "\r\n";
if($_POST['street'] != "")
$street = $_POST['street'];
if($_POST['no'] != "")
$no = $_POST['no'];
if($_POST['floor'] != "")
$floor = $_POST['floor'];
if($_POST['name'] != "")
$name = $_POST['name'];
$newline = "\r\n";
$body = "Date: $dato" . $newline .
$street . " " . $no . ", " . $floor . "." . $nnewline .
$navn;
mail($to, $subject, $body, $headers);
Whitebox test:
Input:
$street = "ø";
$no = "53st";
$floor = "2nd";
$name = "æøå";
$dato = "20-09-2010";
Output SHOULD be:
Date: 20-09-2010
ø 53st, 2nd.
æøå
Actual output:
Date: 20-09-2010
?? 53st, 2nd.
??????
|
|
|
|
|
Hi
There is a list of articles and i have added a tooltip for a summary. So when user hover mouse over the name of the articles - tooltip appears with the summary of the article.
But now i would like to add that bit of html summary to database so that i can retrieve it from php to be displayed in tooltip.
For instance:
<ul>
<li class="listing">first</li>
<li>second </li>
<li> third</li>
<li class="last">fourth</li>
</ul>
I have to insert something like above under ul and li tags. How to insert this(html text) to mysql ?
Thank You..
|
|
|
|
|
You can insert HTML into MySql just like you would regular text, using an 'insert into' Sql statement. You might want to read PHP & MySQL tutorial to help you get started.
|
|
|
|
|
oh yeah inserting was fine but retrieving the data is a pain.
I am trying to retrieve it using simple select statement - but it doesn't display the html on the page.
Thanks
|
|
|
|
|
|
Did you check it got stored OK in the DB? say using MyPHPAdmin?
BTW: you must deal with special characters, those that would upset your SQL statement; and you need to be careful about any single/double quotes you use, there is a pair for your class attribute, if all that sits in a string literal, you're in trouble.
|
|
|
|
|
PHP is a pain atm..
How does the Sessions work in php.
There is a form in page a - which calls page b on submit.
in page b - i am converting all the $_POST to $_SESSION
and then page processes further and goes to page c where the data is added to database.
Now lot of field is blank in database. I can't understand what exactly is going wrong - what is the best way to create session and when should i unset it ??
confusing
|
|
|
|
|
|
do your page start wth start_session()?
|
|
|
|
|
I have recently moved to PHP from .NET for one project.
Now i am quite familiar with the PHP syntax but the code is bit messy as am not writing it object oriented way and it's all in one page (html, mysql queries, javascript)
Now i would like to know Object Oriented way of programming in PHP so that i can make things bit neater and better and reusable.
Can we have 3 tier architecture in PHP (i guess not but still worth asking)
I was using Dream weaver for PHP which is the shittest compiler i have ever worked with. I am about to install Netbeans - what do you guys suggest - Should i look at Zend Framework for OOProgramming. Is it any good ??
Any suggestions ??
Thank You
Andyyy
|
|
|
|
|
MVC in PHP is quite usual. See http://codeigniter.com/[^] as an example of such a framework.
Dreamweaver is good for PHP, however, you could also Microsoft's Expression Web. For open source stuff, you could use the large IDE from http://www.aptana.com/[^]
Regarding PHP Object Orientation, this book is good "Beginning PHP and MySQL 5: From Novice to Professional by W. Jason Gilmore, ISBN 978-1-59059-552-7 Apress". Although this particular book is now getting a little bit old, it is still relevant.
[added]
If you are still using MS Visual Studio, there exists a (not that cheap) php plug-in http://www.jcxsoftware.com/vs.php[^] as well as a freeware MySQL dot.net connector.
modified on Monday, September 13, 2010 10:16 AM
modified 1-Aug-19 21:02pm.
|
|
|
|
|
I generally do not use OOP in PHP as I do not feel it is needed. But to make your code easier to manage you can use some of the things I do to my large projects.
Make use of includes to seperate your code into logical sections. I generally will have a main page that will post to itself for a given wensite section. The post logic is parsed at the top of the php page, and as needed will load various includes depending on the values passed. Each include can contain a form, more logic, javascript, etc...
fo eaxample I set up a typical page like this...
<?php
start_session();
include('master_includes.php');
$pg_name = 'A PAge';
pg_header($pg_name);
pg_footer('$pg_name');
?>
master_includes.php usually has a list of all the different scripts I use for the site.
A common list might be:
- db_connect.php
- header.php
- footer.php
- functions.php
- variables.php
- menu.php
I hope this helps you.
All the Best!
|
|
|
|
|
Hello all,
I am new to concept of hosting web server on external system not your PC/Laptop. on some kind of external hardware system like camera or any other hardwares which are connected to internet.
I want to host server from those system and let other connect to that server using username/password and then they should be able to change functionality of that hardware.
Thank you,
Cheers from Canada
|
|
|
|
|
is this for an intranet (used within a home or small company)? or for world-wide access?
for both, you need to estimate and provide sufficient capacity, and take care of back-up.
for the latter, you would need good up-times, and a fixed IP address. A commercial web hosting solution is recommended.
mohit`12 wrote: on some kind of external hardware system like camera or any other hardwares which are connected to internet.
is your camera running some operating system (Windows? Unix? Linux?) that supports communication protocols, file systems, scipt handling (PHP), etc?
is your camera networked?
|
|
|
|
|
thx for your reply,
Device will be connected on high-speed internet and it has to be world-wide access.
yes i don't actually care about back-up at the moment, i think device runs on some operating system so it will have ip address.
and camera was just an example. the system i am talking about is like really big system let's say when pizza delivery guy comes at your place and you pay them by debit/credit so that guy has that device which is connected world-wide and it verifies data of that card. so something similar to that. and yes system is networked and yes it will support protocols not sure about PHP.
I just posted this here because this was somewhat related because i still don't know which script i am using to host a web server.
I just need to start with basic hosting so it could be any scripting language.
Cheers from Canada,
|
|
|
|
|
That's done regularly. A classic example would be a broadband router.
What's the problem and how does it relate to PHP?
|
|
|
|
|
I wasn't sure if i will use PHP or not, i just posted here because this is somewhat related and i am new to web server hosting .
Cheers from Canada.
|
|
|
|