Hello ,

How can i run a php script using vba macro ?

Hi. Thanks for the reply . I used "!=!" insted of "=" and didnt got the error.
Issue solved.

Hello ,

I'm trying to split a string using preg_split() ( since split ) is deprected...
I'm trying to split it using '=' sign and to get the GETS variable from a url but I'm getting the error :
"Warning: preg_split() [function.preg-split]: No ending delimiter '=' found in C:"

The code is :
<?php

$request_url = $_SERVER['QUERY_STRING'];

//parse the page request and get variables
$parsed_url = explode('&',$request_url );

$page_is = array_shift($parsed_url );

$getVars = array();
foreach($parsed_url as $argument)
{
//split GET vars along '=' symbol to separate variables and values
list($variable,$value) = preg_split("=",$argument);
$getVars[$variable] = $value;
}

//this is a test and we will be removing it later
print "the page you requested is '$page_is'";
print '<br>';
$vars = print_r($getVars,TRUE);
print "The following GET vars were passed to the page:<pre>".$vars."</pre>";

?>

[QUOTE=digital-ether;1533850]You'll need to setup a cron job to check when an ad will expire. For example you can add the creation date of the ad to the database, then check with the cron job for expiring ads.

The cron script can be just a regular PHP script, that is called from cron.[/QUOTE]

Yes but the thing is that my site is runing on windows , not unix....

Hello,

I have a website for musicians where all users can post their ads for free.

I need a script that send an email for a member user when his ad is going to
be expired (let say after 30 days).

Any ideas ?

Sammy.

Hello,

I'm trying to get mysql_num_rows from 4 tables where user id is being selected as session .
My question is very simple :
Is this sql is correct :
""SELECT * FROM users_tbl,events_tbl,players_tbl,sales_tbl,teachers_tbl WHERE events_tbl.user_id & players_tbl.user_id & sales_tbl.user_id & teachers_tbl.user_id = '$whois_id'";

?

user_id - The user id
$whois_id - check who is currently logged in (session) .

Please help ...

OK. Now I've got it . There were 2 main issue:

  1. I've changed it to == instead og =..
  2. From the calling page , I've deleted the 2nd variable '?' mark..
    <a href="update_ads.php?record=<?php echo $band_id?>&[COLOR="Red"]?[/COLOR]catagory=events" >ערוך</a>
    Thanks a lot ...Issue solved.

When replacing = with == it shows me nothing...

Hello ,

I'm trying to set 3 different tables using url variable from a differnt page.
When a certain var is selected , the page should display a certain table.

each table is differed by name and im using an IF statement.
My issue is that only the first echo'd table is being displayed....

As you see in my code , I'm trying to get the 'catagory'
variable from the URL and using it to
display the right table.
The .... is the rest of the table so its not relevant to show it here..
Any suggestions ?[code]update_ads.php //the page name
....
<?php

$name = $_GET['record'];
$the_catagory = $_POST['catagory']; //the variable from the
//other page :(<a href="update_ads.php?record=<?php echo $players_name?>&catagory=players">)

if ($the_catagory = "players"){

echo'
'.$name.'
<!-- players section for update -->
<div>
...

}

elseif ($the_catagory = "events") {

echo'
'.$name.'
<!-- bands section for update -->
<div>
....
}

else if ($the_catagory = "sales"){

echo'
'.$name.'
<!-- sales section for update -->
<div>
}
.....[/code]

Hello. I have a Javascript that generates 2 conditional select tags. If condition in 1st is being selected , the 2nd select shows different options.
Here is an example :

case "events" :
document.formname.subcategory.options[0]=new Option("להקות והרכבים","");
document.formname.subcategory.options[1]=new Option("רביעיות כלי מיתר","");
document.formname.subcategory.options[2]=new Option("מעגלי מתופפים","");
document.formname.subcategory.options[3]=new Option("תקליטנים","");
document.formname.subcategory.options[4]=new Option("רקדנים ומופעי בידור","");
document.formname.subcategory.options[5]=new Option("קומיקאים","");

My quetsion is how do I pass each option in this select to a PHP $GET or POST variable ?
Thanks.

Hi Airshow ,

Issue solved thanks to your solution.

Thanks a lot !

Thank you very much for the replay. My main issue is not to show or to hide by regullar ID. It's to show or hide a row that has a variable id : <tr id="p<?php $customer; ?>">

Thanks.

Hi Airshow. My only question is regarding this scrpt :

<script language="javascript" type="text/javascript">
function showHide (a)
{
var p = document.getElementById('p'+a);
if (p.style.display=='block')
{
p.style.display='none';
}
else
{
p.style.display='block';
}

}
</script>

<a href="#" onclick="showHide(<?php $customer; ?>)"> Show / Hide </a>

</td>

<tr id="p<?php $customer; ?>">
<td>
<?php echo $customer; ?>
</td>
</tr>

I need to pass the curruent row number in order to expand it or to hide it . the table is showing users details and when I'm clicking Show / hide link I want to expand the row to view more of that current user details.

Hello .
I'm not sure what is wrong in my code. I'm trying to expand table row to see more details from mysql query . The idea is to click 'show / hide ' link and on that onclick event the row below need to be expanded.Here is my code :

<?php

  while ($row = mysql_fetch_assoc($get))
    {
      $customer = $row['customer_id'];  

       //get data 
      $the_user = $row['username'];
      $the_team = $row['team'];
      $name = $row['customer_name'];
      $phone =$row['customer_phone'];
      $email = $row['customer_email'];
      $product = $row['customer_product'];
      $comment = $row['customer_comment'];
      $date = $row['date'];
      $show_date = date("H:i d/M/Y",$date);
      $i = $i +3; 

     if($i % 2 )
        {
             $bg_color = "#996600";
             $font = "#000000";
        }
        else 
        {
            $bg_color = "#666699";
            $font = "#ffffff";
        }

         echo '

           <tr bgcolor = '.$bg_color.' style="font-size:12px" align="middle">
             <td>
               <font color ='.$font.'>
               '.$name.'
               </font>
             </td>
             <td>
               <font color ='.$font.'>
               '.$phone.'
               </font>
             </td>
             <td>
               <font color ='.$font.'>
               '.$email.'
               </font>
             </td>
             <td>
               <font color ='.$font.'>
               '.$product.'
               </font>
             </td>
             <td align="left">
               <font color ='.$font.'>
               '.$comment.'
               </font>
             </td>
              <td>
               <font color ='.$font.'>
               '.$show_date.'
               </font>
             </td>
             <td>
               <font color ='.$font.'>
               '.$the_user.'
               </font>
             </td>
             <td>
               <font color ='.$font.'>
               '.$the_team.'
               </font>
             </td>

             <td>
               <font color ='.$font.'>
               </font>
            ';?>

 <script language="javascript" type="text/javascript">
 function showHide (a) 
 {
    var p = document.getElementById('p'+a);
    if (p.style.display=='block') 
      {
          p.style.display='none';
      }
      else 
      {
          p.style.display='block';
      }

 }
</script>     

             <a href="#" onclick="showHide(<?php $customer; ?>)"> Show / Hide </a>               

 </td> 

     <tr id="p<?php $customer; ?>">
      <td>
       <?php echo $customer; ?>
       </td>
     </tr>

     </tr>  

    <?php   

  }

 ?>

Thanks....