Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:18:57+00:00 2026-05-29T22:18:57+00:00

i try to solve a problem but didnt succeed. I retrieve datas from google

  • 0

i try to solve a problem but didnt succeed. I retrieve datas from google analytics and i have to send start and end date. I have two textbox and user select start and end date.However, but before user select enter image description herestart and end date. The problem occurs..

The place that i use isset is here,

This is my full html

<?php
define('ga_email','mertmetinbjk@gmail.com');
define('ga_password','************');
define('ga_profile_id','*******');

require 'gapi.class.php';
require 'connectDB.php';

$ga = new gapi(ga_email,ga_password);




?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>İçerik</title>
<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com 

</script>
</head>
<div></div>
<body>
    <table align="center">
        <tr> 
        <td><br />
    <br />
    <form action="#" method="post" name="formDates" id="form1" >
    <table width="303" height="40" border="0" align="center">
        <table width =""
  <tr>
    <td>Başlangıç Tarihi</td>
    <td>
      <label for="txtStartDate"></label>
      <input type="text" name="txtStartDate" id="txt1" value="" /><a href="javascript:NewCal('txt1','ddmmyyyy')"><img src="images/cal.gif" width="16" height="16" border="0" alt="Başlangıç Tarihi Seçin">
      </a>
    </td>
  </tr>
  <tr>
    <td>Bitiş Tarihi</td>
    <td>
      <label for="txtEndDate"></label>
      <input type="text" name="txtEndDate" id="txt2" /><a href="javascript:NewCal('txt2','ddmmyyyy')"><img src="images/cal.gif" width="16" height="16" border="0" alt="Bitiş Tarihi Seçin">
      </a>

    </td>
  </tr> 
    </form>
        <tr>
             <td><input type="submit" name="btnSubmit" value="Gönder"</td>
        </tr>

</table>
    <table width="1250" height="26" align="center">
  <tr>

    <td width="138"><strong>Kanal Adı</strong>
    <td width="150"><b>Kategori Adı</b></td>
    <td width="130"><p><strong>Event Adı</strong></td>
    <td width="145"><strong>Toplam</strong>

  </tr>
    </table>



            <?php

            if(isset($_POST['submit'])){     
                $startDate = $_POST['txtStartDate'];
                $endDate = $_POST['txtEndDate'];  
             }


             $arrDates = explode("-",$startDate);
             $startDate=$arrDates[2]."-".$arrDates[1]."-".$arrDates[0];
             $arrDates = explode("-",$endDate);
             $endDate = $arrDates[2]."-".$arrDates[1]."-".$arrDates[0];

             echo $startDate;
             echo $endDate;



            $ga->requestReportData(ga_profile_id,array('eventCategory','eventAction'),array('totalEvents'),$sort_metric=null,$filter='eventAction==InitPlayer',$start_date='2012-02-02',$end_date='2012-02-16');
            foreach($ga->getResults() as $result2);
            {
                echo $result2->geteventCategory();
                echo $result2->geteventAction();
                echo $result2->gettotalEvents();
            }


            $ga->requestAccountData();
            $mysql = new mysql(); 
            $mysql->connect();  
            $counter = 0;



            foreach($ga->getResults() as $result)
            {     
                 echo $result . ' (' . $result->getProfileId() . ")<br />";
                 echo "<br />";
                 $counter++;
            }

            $result = mysql_query("select profile_id from profiles");
            $num_rows = mysql_num_rows($result);



            if($counter != $num_rows)
            {
                $mysql->query("delete from profiles");

                foreach($ga->getResults() as $result)
                { 
                   $mysql->query("insert into profiles values(".$result->getProfileId().",'".$result."')");
                }
            }






            ?>

</td>
    </tr>
    </table>
</body>
</head>
</html>

what is wrong?

if a choose start and end date problems is solved , problems occurs before that i choose

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:18:58+00:00Added an answer on May 29, 2026 at 10:18 pm

    I think it should be:

    if(isset($_POST['submit']))
    

    instead of:

    if(!isset($_POST['submit']))
    

    The exclamation mark in front of isset means not. Also I would check for the actual fields you want to use, not for $_POST['submit']:

    if(isset($_POST['txtStartDate']) && isset($_POST['txtEndDate']))
    {
        // Do something with $_POST['txtStartDate'] and $_POST['txtEndDate']
    }
    

    The reason you were getting the error is that $_POST['submit'] does not exist. There is not input element with a name attribute called submit. Beware of the difference between type and name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem that I could not solve. When I try to
So I managed to solve a problem of retrieving information from the bundle, but
I have a problem, which I do not seem to be able to solve...
I've serached a little but I didn't find anything that could solve my problem.
I'm noticing in my code that when I try to start an NSTimer from
its been I while since I try to solve that problem, I've already asked
So I've decided to try to solve my physics homework by writing some python
I'm trying to build a program to solve a problem in a text book
I am trying to to solve a problem where I need to pass large
I looked the site to find a solution for my problem, but couldn't find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.