Ok two questions-
First is it possible to replicate javascripts automatic submit with a php function, i want to do this due to the fact we i run a cron job it wont run javascript.
Second If the above is not possible i need to transfer information from the intial page to another another .php and acts similar to the php form in that when u hit submit it will post the information to the other .php page and then opens that page.
The reason i trying to achieve this is i want a server to run the script with out me having to activate it (i.e. cron jobs).
6 3289 Atli 5,058
Recognized Expert Expert
Hi.
So you are trying to make a cron-job that triggers a local PHP script, which is meant to accept form data?
Why not just create a second page, identical to the original, with the data hard-coded into variables? You could even create default values for the original code, in case the data wasn't passed from the form.
Like: -
($myField = @$_POST['myField']) or $myField = "Default value";
-
Thats sounds like a good idea so how do i post the form automatically to send the data to the second page or just post the varibles i need.
Thanks
Atli 5,058
Recognized Expert Expert
The point of HTML forms is to get data from remote clients to your server. If your scripts are meant to be executed with static data, by the server, there is no need to bother with that, you can simply hard-code the data into the code.
Like, rather than doing: -
# form.html
-
<form action="action.php" method="post">
-
<input type="text" name="field" value="myValue" />
-
</form>
-
-
# action.php
-
mysql_query("INSERT INTO whatever VALUES('{$_POST['field']}')");
-
And executing the "form.html" by a cron-job, you could simply do: -
# action.php
-
mysql_query("INSERT INTO whatever VALUES('myValue')");
-
And execute the "action.php "
Or better yet, you could do: -
# action.php
-
($value = @$_POST['myValue']) or $value = "Default";
-
mysql_query("INSERT INTO whatever VALUES('$value')");
-
And execute either the "action.php " by a cron-job or the "form.html" via a browser.
Just wondering how does the line
[PHP]# action.php[/PHP]
actually work??
I tried this but it didn't seem to do anything, is it ment to execute another .php page???
Thanks for the help
Atli 5,058
Recognized Expert Expert
No that's just a comment.
Was my way of saying that the following code should be in a file called "action.php " :)
It's the same as doing: -
// action.php
-
or even
-
/* action.php */
-
Doesn't do anything.
I think i worked out how to call another file, using Curl.
Thanks heaps for the input
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Alex Hunsley |
last post by:
I'm using urllib to post data to a web form by issuing a command similar to this:
filename, headers =
urllib.urlretrieve("http://www.thewebsitenamehere.com/servlet/com.blah.bloo.XmlFeed",
"content.txt", None, urllib.urlencode({"aParameter": "theValue"}))
Now, the problem is that the above fails, since I am not sending a session
cookie....
|
by: Terry |
last post by:
I'm trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.
I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?
Terry
<%
' ... some asp processing
|
by: Piotr Kurpiel |
last post by:
Hi,
I am creating a site where I need to refer to another external file
(aspx).
I create the form and works fine. But as soon as I try to submit the
form automatically (with form.submit()) I get an error from the
external site. I do not have the code of that site but suppose that my
automatic submission does not pass all of the variables....
|
by: Stanley |
last post by:
Hi,
I'd like to write a HTML page which can help me directly log in my
Yahoo!mail or Gmail account without typing user name and password.
Basically, I want to set up a link, click it and pop up the Yahoo/Gmail
page.
What technology is most appropriate for this kind of work?
My current solution is not so satisfying: I download...
|
by: havenoclue |
last post by:
I have a database application that is submitted to an Access database. What
I want is when the form is submitted to automatically send an email to
multiple persons with the info from the form. This could be as an
attachement or plain text. I wouldn't care if it was like the mailto. I'm
clueless on how to do this.
Any help would be greatly...
| |
by: grpmangr |
last post by:
hi
Is ther anyway i can automatically fill out forms and submit them thru
java?
supposing i hav a normal txt file that contains all data that needs to
be filed out into the form, is there anyway i can fill out a form and
submit it automatically by providing only the URL of the form and the
txt file?
thanks
Najla
|
by: Oleg Konovalov |
last post by:
Hi,
I have a Java/JavaScript GUI application where I perform a lot of long DB
operations
, which takes 5-60 secs to perform.
Sometimes user double-clicks the button or just gets impatient and clicks
again,
which created duplicate forcm submission and hence duplicate records.
So I am trying to disable the button as soon as it is clicked,...
|
by: Homer |
last post by:
Hi,
I just got a requirement from my HR department to automate their form
submission process and integrate it into the Intranet project that I
had just completed Phase 1 of. Because of the short time frame that
I've been given, a week to be exact, I do not have the luxury to
explore it on my own so here are the requirements:
1. Automate...
|
by: dmorand |
last post by:
I'm having a strange issue with a form I'm developing. I'm saving some values to hidden fields when a user clicks a button. I setup a function which gets ran on submission of the form, but I also placed this function on my submission button when clicked.
<input name="button5" type="button" class="Buttons" id="button5" value="On File"...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |