Jump to content

suzzane2020

Members
  • Posts

    233
  • Joined

  • Last visited

    Never

Posts posted by suzzane2020

  1. hmm

    actually i want to bring to your attention that

    if i create the folder manually and give it permissions .the same script works great!!!!

     

    its only when i use the mkdir and the chmod function.

    But i need to use them too ???

  2. Hi,

     

      I have a strange issue here.

    I have written a script to make a directory and ten copy a file to that directory.

    I have given the directory full prmissions using the chmod function.

     

    The directory is created but am not able to copy the file.

     

    here is the code

     

    if(isset($_POST["reg"]))
    {
    $brand  = $_POST["brand"];
    
    $file_name = "template1.php";
    $file_path = "brand_sites"; 
    
    if(!is_dir("$file_path/$brand")) {mkdir("$file_path/$brand/"); chmod("$file_path/$brand/",0777);}
    
    
    if(copy("$file_path/$file_name","$file_path/$brand/$file_name"))
           {
              		 	print "Copied"; 
    }
    
    
    }

     

    Whats strange is that -if i create a folder manually and give it permissions the file can be copies using the function.

     

    could anyone please throw some light on this problem.

     

    thank you

  3. ok

    In the query you use to get the images from the databse;

     

    include a keyword DISTINCT

    for eg:  select distinct(image),and all the other fields u want from tblname"

    that way when u use distinct, images with the same name  or url wud not appear

    I hope u gt it :)

  4. this

    <?php include("system/replace.php"); ?>
    <form method="post" action="index.php?show=artikel">
    <?php $sql="SELECT * FROM artikel ORDER BY id";
    if(!empty($artikel)) { $sql="SELECT * FROM artikel WHERE category='$category' ORDER BY id LIMIT 1"; }
    $data2=mysql_query($sql, $db);
    while ($artikel = mysql_fetch_object ($data2)) 
    $num=mysql_num_rows($res);
    if($num!=0)
    {
    while($row=mysql_fetch_object($res))
    {

     

    wud be this

     

     

    <?php include("system/replace.php"); ?>

    <form method="post" action="index.php?show=artikel">

    <?php $sql="SELECT * FROM artikel WHERE category='$category' ORDER BY id LIMIT 1"; }

    $data2=mysql_query($sql, $db);

     

    $num=mysql_num_rows($artikel);

    if($num!=0)

    {

    while ($artikel = mysql_fetch_object ($data2))

    {

  5. First of all u have an extra query here which is nt required

     

    <?php include("system/replace.php"); ?>
    <form method="post" action="index.php?show=artikel">
    <?php $sql="SELECT * FROM artikel ORDER BY id";
    if(!empty($artikel)) { $sql="SELECT * FROM artikel WHERE category='$category' ORDER BY id LIMIT 1"; }
    $data2=mysql_query($sql, $db);
    while ($artikel = mysql_fetch_object ($data2)) 
    $num=mysql_num_rows($res);
    if($num!=0)
    {
    while($row=mysql_fetch_object($res))
    {
    

    and in the code above the number of rows shud be taken for the main query .ie

    the query that displays the records

     

    change it to the code i gave before

    it will work

  6. ok so all u wud need is this query

    <table style="width:95%" cellspacing="1" cellpadding="0" class="forum">
    $res=mysql_query("SELECT * FROM artikel WHERE category='$category' " )
    
    $num=mysql_num_rows($res);
    if($num!=0)
    {
    while($row=mysql_fetch_object($res))
    {
    
    <tr><td colspan="2" class="headb">
    <?php replace("$artikel->headline"); ?>
    </td></tr><tr><td colspan="2" class="leftc">
    <?php replace("$artikel->text"); ?>
    </td></tr><tr><td colspan="2" class="headb">
    <b>Kommentar</b>
    </td></tr><tr><td colspan="2" class="leftc">
    <?php replace("$artikel->comment"); ?>
    </td></tr>
    <?php }
    }else{ echo "no records"}?>
    </table><br> 

  7. When the download  link is clicked save a record in the databse with the file name or id and a status yes or no

    when the download is clicked set it as yes and if not by default 'No'

     

    So u just need to check the value in the databse and display Yes or no

×
×
  • 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.