Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2012, 11:32 PM   PM User | #1
esolve
New Coder

 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
esolve is an unknown quantity at this point
interaction among javascript, shell and php

I create a html page with some javascript inside, and a php script(getdata.php) I put them on a local apache server

I have written a shell script to:

start tcpdump and then open the local html page with firefox. The javascript will download a bit javascript api source from Internet and keep on running until it detect an event. When the javascript detects the event, it uses a hidden form to post the data to that php script
Code:
 <form id="hidden_form" method="POST" action="getdata.php" ></form>
the php script will then process the data and write some files.

there is a key string in the html page, and I want to change it for many times with different strings. These different strings are kept in a string file as lines.

So after the php script write the files, I need: the tcpdump process and firefox process will be killed, the key string in the html page will be modified and the above process is repeated again.

So there will be a loop until all the lines from the string file are read and used. I'm at a loss on how to do this

my concerns are:

1 the big problem is, if there is something wrong with the javascript(e.g, it can't download that bit src javascript due to temporal network problem , it won't continue to run), or there is something wrong with the php script, then the loop will be broken

2 my idea is: a shell script repeats the initiation of each loop: modify the html page, starts tcpdump and firefox, and then it is blocked until A) the php script finishes writing files and signal the shell script to unblock and continue to the next loop B) the shell script detect that neither the php script nor javascript isn't running, so there should be something wrong with them. but I'm at a loss on how to implement A) and B)
esolve is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript, php, shell

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:34 PM.


Advertisement
Log in to turn off these ads.