1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need Some help for editing return string

Discussion in 'PHP' started by millst2, Oct 7, 2005.

  1. #1
    Could someone tell me how that i could change the script to show more items in a category selected?

    My site is www.jokexxx.com , and say if you go to blonde jokes and click on the link, it only shows like 8 results , and it is placed under Newest results. Is there a command i could put in that would open like 30-40 jokes per page ( with several pages) all in the same topic of jokes?

    If you went to search and typed in blonde, it pulls up 4 pages of blonde jokes. I just want to implement that same style of layout for every category,, Not just only being able to do so by searching.

    If this makes since, i sure could use a hand.
    Thx in advance,
    Mill

    Also I am getting this error when trying to upload a picture,, I am sure this is something as easy as moving a file to another folder or changing a command string, but could use any help on that also. I am a PHP /sql newb

    failed to open stream: Permission denied in /home/millunar/public_html/doupload.php on line 57
     
    millst2, Oct 7, 2005 IP
  2. millst2

    millst2 Guest

    Messages:
    292
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe this is the area where I am having me error. It says lines 54 -57 on different tries. I set the chmod to 777 and still nothing. ANYONE? :)


    mt_srand( (double)microtime() * 1000000);
    $randvar = mt_rand(1,1000000);
    settype($randvar,"string");
    //$dir=basename(dirname($_SERVER["SCRIPT_FILENAME"]));
    //die($dir);
    //$newfilename = dirname($_SERVER["SCRIPT_FILENAME"])."../images/uploadedimages/" . $randvar. str_replace(" ","_",$realname);
    $newfilename = "../uploadedpics/" . $randvar. str_replace(" ","_",$realname);
    echo $newfilename;
    $shortfname = $randvar. str_replace(" ","_",$realname);
    while ( file_exists($newfilename) != FALSE )
    {
    $randvar = mt_rand(1,100000);
    settype($randvar,"string");
    $newfilename = "../uploadedpics/" . $randvar. str_replace(" ","_",$realname);
    $shortfname = $randvar. str_replace(" ","_",$realname);

    }
    //////////////////////
    copy($_FILES['userfile']['tmp_name'], $newfilename);
     
    millst2, Oct 8, 2005 IP
  3. SecondV

    SecondV Active Member

    Messages:
    76
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    70
    #3
    As far as the error goes, try changing this line:

    
    $newfilename = "../uploadedpics/" . $randvar. str_replace(" ","_",$realname);
    
    PHP:
    To:

    
    $newfilename = "./uploadedpics/" . $randvar. str_replace(" ","_",$realname);
    
    PHP:
    Because " /home/millunar/public_html/doupload.php" ... it's looking for a directory back behind public_html .. Changing to the above should fix it. :)
     
    SecondV, Oct 9, 2005 IP