Jump to content

pgrevents

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

Posts posted by pgrevents

  1. Ok what I am trying to do is send an argument to a perl file to execute im making headway but there is an error here is my code

    <? php shell_exec('/usr/bin/php get_iplayer  --info > testfile.txt'); ?>

     

    The error is getting printed to a text file thats what the > testfile.txt is the error is

    X-Powered-By: PHP/5.2.8
    Content-type: text/html
    
    <br />
    <b>Parse error</b>:  syntax error, unexpected T_STRING in <b>/home/steve/public_html/get_iplayer/get_iplayer</b> on line <b>1610</b><br />
    

     

    No only when I put the /usr/bin/php in the shell_exec do I get any printout whatsoever.

     

    I know this script works as I use putty to print that command is there anything on the php side to eliminate this. I think the reason it does error is cause of the usr/bin/php but thats the only line that will make the script react to anything outside shell

     

     

     

     

  2. Thanks for that I have tried implamenting that ill show you my code;

     

    <?php
    $query = mysql_query("SELECT * from programme ORDER BY expiry DESC WHERE expiry > (curdate(), INTERVAL 1 WEEK)") or die(mysql_error());
    if(empty($query)){
    print "NOT VALID";
    }
    
    while($row=mysql_fetch_array($query, MYSQL_ASSOC)){
    ?>
    <?=$row['pid']?><br/>
    Expiry : <?=$row['expiry']?><br/>
    <hr>
    <? } ?>

     

    This throws back an error which is

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE expiry > (curdate(), INTERVAL 1 WEEK)' at line 1

  3. I have a field which I am trying to sort to show the last seven days and I have hit a stubmling block can anyone help please

     

    <?php
    $date =date('Y-m-d');
    $time = date('h:i:s');
    $query = mysql_query("select * FROM programme  WHERE expiry <='$dateT$timeZ' ");
    ?>

     

    The field expiry all content is like this 2009-06-15T16:24:00Z

     

    Now the code executes but its not showing what I am wanting its showing the fields that are empty is there anyway to make this to work

  4. actualy not solved here is the php code how do i now run and put the command through it?

     

    <?php
    //$poc = shell_exec("cd /../cgi-bin/net; ./excalc.pl php where=$_REQUEST[where]");
    
    //$parms = explode("&",$poc);
    //$command = $_SERVER[DOCUMENT_ROOT].'/public_html/get_iplayer/get_iplayer.pl --info > testinfo.txt';
      
      $var2 = 'get_iplayer/get_iplayer.pl';
      print $var2 ."<br />";
      $var3 = 'get_iplayer > test1.txt';
      $var4 = $var2 .",".$var3;
      if(virtual(`$var2, $var3`)){
    
    
    print "<br /> <p style=\"font-size:24px; color:#900; text-align:center;\">If you see this the file has executed and passed the variable</p>";
    }
    else{
    print "Error not executed";
    }
    
    
    
    
    ?>

  5. How would I go about getting a mysql Select query to search by letter for example I am searching the a field called titled and lets say I only want to search by their first letter

     

    lets say i have two titles;

     

    Alpha

    Bravo

     

    I only want to see the Bravo so the SELECT would be defined by B how would I go about this.

     

    thanks

     

    Paul

  6. can you see anything wrong with this? I have tried everything and it will not insert I have double checked spelling and everything i execute this code. The database connection is above the top if .

    <?php
    if(mysql_connect($dbhost, $dbuser, $dbpass)){
    	print "Mysql Connected <br/><br/><br/><br/>";
    	}
    else{
    	print"Mysql Not Connected <br/><br/><br/><br/>";
        }
      
      mysql_select_db($dbname);
       $filename = 'info.txt';
      $entry = null;
      foreach(file($filename) as $line){
        //Split the data
        $parts = preg_split('/\s*:\s*/',trim($line),2);
        //Skip Blank Lines
        if(count($parts) !== 2) continue;
        
        if(is_numeric($parts[0])){ //New Entry
          if(is_array($entry) && count($entry))
            addEntry($entry);
          $entry = array();
        }elseif(is_array($entry))
          $entry[strtolower($parts[0])] = $parts[1];
      }
      if(is_array($entry) && count($entry))
        addEntry($entry);
    
      function addEntry ( $entry ) {
        $availiable = "{$entry['available']}";
        $catagories = "{$entry['categories']}";
    $channel = "{$entry['channel']}";
    $description = "{$entry['desc']}";
    $duration = "{$entry['duration']}";
    $episode = "{$entry['episode']}";
    $expiry = "{$entry['expiry']}";
    $epiry_relative = "{$entry['expiryrel']}";
    $first_broadcast = "{$entry['firstbroadcast']}";
    $index = "{$entry['index']}";
    $last_broadcasted = "{$entry['lastbroadcast']}";
    $title_long = "{$entry['longname']}";
    $mode = "{$entry['modes']}";
    $mode_size = "{$entry['modesizes']}";
    $title_name = "{$entry['name']}";
    $player_url = "{$entry['player']}";
    $pid = "{$entry['pid']}";
    $thumbnail = "{$entry['thumbnail']}";
    $time_added = "{$entry['timeadded']}";
    $type = "{$entry['type']}";
    $version = "{$entry['versions']}";
    $ultimate_url = "{$entry['web']}";
       
    if(mysql_query("INSERT INTO programme (availiable, 
    									   catagories, 
    									   channel, 
    									   description, 
    									   duration,										  
    									   episode, 
    									   expiry, 
    									   expiry_relative, 
    									   first_broadcast, 
    									   index,
    									   last_broadcasted, 
    									   title_long, 
    									   mode, 
    									   mode_size, 
    									   title_name, 
    									   player_url, 
    									   pid, 
    									   thumbnail, 
    									   time_added, 
    									   type, 
    									   version, 
    									   ultimate_url) VALUES ('$availiable',
    									   '$catagories',
    									   '$channel',
    									   '$description',
    									   '$duration',
    									   '$episode',
    									   '$expiry',
    									   '$expiry_relative',
    									   '$first_broadcast',
    									   '$index',
    									   '$last_broadcasted',
    									   '$title_long',
    									   '$mode',
    									   '$mode_size',
    									   '$title_name',
    									   '$player_url',
    									   '$pid',
    									   '$thumbnail',
    									   '$time_added', 
    									   '$type',
    									   '$version',
    									   '$ultimate_url',
    									   ")){
    	   print "Success";
       }
       else{
    	   print "Error Not Entered";
       }
    
      }
    ?>

     

     

    this is the output i get

     

    Mysql Connected <br/><br/><br/><br/><br />
    <b>Notice</b>:  Undefined index:  expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br />
    
    <br />
    <b>Notice</b>:  Undefined index:  player in <b>G:\queue\parse.php</b> on line <b>49</b><br />
    <br />
    <b>Notice</b>:  Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br />
    Error Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not Entered<br />
    
    <b>Notice</b>:  Undefined index:  expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  player in <b>G:\queue\parse.php</b> on line <b>49</b><br />
    
    <br />
    <b>Notice</b>:  Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br />
    Error Not Entered<br />
    <b>Notice</b>:  Undefined index:  firstbroadcast in <b>G:\queue\parse.php</b> on line <b>42</b><br />
    
    <br />
    <b>Notice</b>:  Undefined index:  lastbroadcast in <b>G:\queue\parse.php</b> on line <b>44</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  longname in <b>G:\queue\parse.php</b> on line <b>45</b><br />
    <br />
    
    <b>Notice</b>:  Undefined index:  modes in <b>G:\queue\parse.php</b> on line <b>46</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  modesizes in <b>G:\queue\parse.php</b> on line <b>47</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  versions in <b>G:\queue\parse.php</b> on line <b>54</b><br />
    
    <br />
    <b>Notice</b>:  Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br />
    Error Not Entered<br />
    <b>Notice</b>:  Undefined index:  expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br />
    
    <br />
    <b>Notice</b>:  Undefined index:  expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  player in <b>G:\queue\parse.php</b> on line <b>49</b><br />
    <br />
    
    <b>Notice</b>:  Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br />
    Error Not Entered<br />
    <b>Notice</b>:  Undefined index:  expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br />
    <br />
    
    <b>Notice</b>:  Undefined index:  expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  player in <b>G:\queue\parse.php</b> on line <b>49</b><br />
    <br />
    

     

    its a large file i am trying to process and have even extended the execte time in php ini sorry to be such a pain

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.