Solved

Automatically click the button for you if there is a date

Posted on 2016-10-08
10
13 Views
Last Modified: 2016-10-13
I have a file called file.php which has:

$row2= pg_fetch_array($result2);
$website = 'http://validate/?id='.$newDateString;


  <tbody>

    <tr>

     <td><?php echo'<a href="'.$website.'">'. $row['name']; ?></td>

Open in new window

The code sends to a file named jasmine.php the url with the date since jasmine contains a calendar. It sends it when you click on the date which contains a link to jasmine.

Jasmine.php:
<div id="content">
    <h2>Hello, Please let me know which date you are looking for </h2>
    <div><label style="font-size: 14pt; font-family: Verdana;">Posting Date: </label></div><br />
    <input type="text" id="date" value= "<?php echo $_GET['id']?>" class="css-input" placeholder="Posting Date..." readonly="readonly" /><br /><br />

    <input type="button" id="validate" value="Let's work!" class="btn" /> 
    <input type="button" id="clear" value="Wanna go Again?" class="btn" />
</div>
<div id="contentarea2" style="display: none;">
    <h2>Results:</h2>
    <div class="view_alerts">
        <table>
            <tr>
                <td>
                     Code
                </td>
                <td>
                    # Posted
                </td>

            </tr>
            <tbody id="view_alerts_tbody">

            </tbody>
        </table>
    </div>
</div>

Open in new window

In Jasmine, I get the date already written for me from file.php, all I need to do is click the button so it could show me a table, is there a way, that it clicks the button on its own if theres a date written, so when I go on that link, it already puts the date and takes me to the table in jasmine.php
0
Comment
Question by:Jasmine Ikhreishi
  • 5
  • 5
10 Comments
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41835012
I am not clear on what is required here.

The code sends to a file named jasmine.php
Which code - what does it send and how - can you show me.
0
 
LVL 1

Author Comment

by:Jasmine Ikhreishi
ID: 41835013
ok on file.php again i have a table like this:
Name                                                                                 Date 
-----------                                                                             -----------
2931550_S21_17806016900.100.6f8	                         04-11-2015
NGS_ILMEB_20140728	                                          09-29-2014
931550_S21_18780304.03.ab	                                  01-04-2015

Open in new window


When I click on the name it takes me to jasmine.php
with the date (which if I click on the first name the date will show as "04-11-2015")
So the jasmine link would be "/jasmin.php?id=04/11/2015" and All I need to do is click the button called "Let's work!" for it to run the date and give me data back. Is there a way to just show me the data directly without needing to click the button, since the date it already there? Should I show you my php code that gets me the data?
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41835023
So the jasmine link would be "/jasmin.php?id=04/11/2015" and All I need to do is click the button called "Let's work!" for it to run the date and give me data back
What do you mean "run the date and give me data back" - what is linked to the "Lets's Work" button I don't see a form or any javascript.
0
 
LVL 1

Author Comment

by:Jasmine Ikhreishi
ID: 41835025
Here is where it says "posting date" is where the date would be okay and I need to click the button for it to generate data for me
Therefore is there a way that I can skip this page and just go to the next one where the data is already generated since i chose the date from file.php
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41835049
Hold on - I am playing catchup here - you are continuing on the assumption that we have full knowledge of your setup - which is not the case. You need to take this one step at a time.
I have no idea what your system does or how it hangs together so you need to take me through it. Based on your description so far I am still confused as to what is happening.

Lets start from the beginning
You have a script that produces a list of links.
The links point to a page "jasmine.php" and include a date in the URL.

First question - what happens when you click the link.
A) Does the link take you to a new page
OR
B) Do you have some javascript that intercepts the click and makes an AJAX call to the target page.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Author Comment

by:Jasmine Ikhreishi
ID: 41835051
It takes me to a new page which has the popup calendar I showed, with the date displaying inside
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 500 total points
ID: 41835072
Ok - next key thing which popup calendar are you using. If you want to know how to manipulate your calendar we need to know which one you are using on your site.
0
 
LVL 1

Accepted Solution

by:
Jasmine Ikhreishi earned 0 total points
ID: 41835082
I got it done by this code:
<?php 
if($_GET['id'] != NULL){

?>
<script>
$(window).load(function() {
	$(".loader").fadeOut("slow");
})

 jQuery(document).ready(function()
 {
 jQuery("#validate").click();
 });
</script>
<?php }?>

Open in new window

0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41835116
Well done.
1
 
LVL 1

Author Closing Comment

by:Jasmine Ikhreishi
ID: 41841661
I found the solution myself
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now