Jump to content

priti

Members
  • Posts

    461
  • Joined

  • Last visited

Posts posted by priti

  1. @pritii: think hes trying to prevent other people from accessing the admin.php page..

     

    @jkkenzie: you can put a admin login in admin.php

    @vbnullchar  My intention to ask this is what may be the reason that index.php and admin.php has to be in same place ??

  2. hi,

     

    can you explain what you meant by "the reason for them being on same folder is so as to be accessed via internet for manipulating the database" .....

     

    i think if you create a single file for database connection then you can include that file anywhere in your web app. so ... i get confused what exactly your idea to keep these two file together.

     

    Regards

  3. I am looking to write a script to bring up hotel rates fast. My question is when I have the url which will bring up rates and use file_get_contents it does not bring up the correct information that I need but if I load that exact url I used in file_get_contents right up into the browser or even load it in an iframe it works flawlessly.

     

    http://www.ichotelsgroup.com/h/d/hi/1/en/rates/mspmd?ias=y&countryRequired=yes&newSearch=yes&packageRatesFlag=&countryId=0001&hotelCode=mspmd&errorURL=%2Fh%2Fd%2Fhi%2F1%2Fen%2Fadvancedsearch%3FquickRes%3Dcity&successURL=%2Fh%2Fd%2Fhi%2F1%2Fen%2Fhotelsearchresults&advancedSearchForwardURL=%2Fh%2Fd%2Fhi%2F1%2Fen%2Fasearch&brandGroupCode=hi&currentBrandId=HI&actionName=advancedSearch&requiresCheckinDate=true&availabilitySearchSuccessURL=%2Fh%2Fd%2Fhi%2F1%2Fen%2Frates%2Fmspmd%3Fias%3Dy%26errorURL%3D%2Fh%2Fd%2Fhi%2F1%2Fen%2Fadvancedsearch&clarifyDestinationURL=%2Fh%2Fd%2Fhi%2F1%2Fen%2Fhotelsearchclarify&searchGroupCodes=HI&searchGroupCodes=EX&searchGroupCodes=RS&searchGroupCodes=SL&searchGroupCodes=SS&searchGroupCodes=FS&rateGroupCode=hi&fromAdvancedSearch=true&datePattern=MM%2Fdd%2Fyyyy&checkInFullDate=02/25/2008&number_Nights=2&checkOutFullDate=02/26/2008&numberOfAdults=1&numberOfChildren=0&numberOfRooms=1&roomTypePreference=3&smokingPreference=3&rateTypeCodes=6CBARC&corporateNumber=&groupBookingCode=&iata=&brands=SS&brands=CP&brands=FS&brands=IN&brands=EX&brands=HI&brands=SL&findHotels.x=0&findHotels.y=0

     

    That is the url I am using and if you copy/paste that in the browser it works fine. Using file_get_contents loads another page all together. Any reason for this or a way around it? Thanks for your help!

     

    what is your allow_url_fopen setting in your php.ini??

  4. i don't have any dummy example which match your requirement as you already have the file upload script with you then you can start going step by step.

     

    i will suggest

     

    first: write a php function to list the directories inmain directory

     

    create a directory on server called 'userUploads' chmid 777

    and create some subdirectory in this

    like

    userUploads

    -flowers

    -trees

    -plants

    (sub directory is your choice)

     

    now write a php script to fetch userUpload and try ot list these sub directory.Once you are thru with this then create a ajax request to call that function and output them on your html form.

     

    finish this much and let me know if you get stuck in somewhere while doing this.

     

    Regards

  5. If you are aware of Programming then my simple suggestion will make you life easy

    i.e

    <form name='frm' action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

     

    $_SERVER['PHP_SELF'] will post the form to the same page and you can recognize weather form is submitted or not.If you don't want to do this in PHP then you can also work with help of javascript.

     

    Regards

  6. hi,

     

    can you check $query['partnerID'] ..... this variable what it return i mean check your query once.It might be returning 5 hence it every time get set to 5 and write your code

     

    if(!isset($_REQUEST['partner_id'])) //if not found in $_GET

    {

    execute your query

    }

     

    Regards

     

  7. hi,

     

    $_FILES['userfile']['type']  can help you to find the type of file

     

    NOTE: The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted.

     

    Regards

     

     

  8. This is the most opted way to connect to Db.you can also use database connection classes availabel on PHP classes or PHP freaks tutorial also if you follow OOPs in your coding approach.

     

    let someone else experienced also speaks on this topic.For security issues the discussion is endless so i think someone else should also speak on this.

     

    Gr8 day

  9. Hi,

     

    If not wrong then you suppose not to allow your user to upload files anywhere on your server.Hence you would be having specific directory where user can upload their files.

     

    Simply set $target_path=path/to/main/directory.

     

    on user side list already existing directory this can be done by making ajax request to list the directory in the main directory.The user is having the option to select any of the one hence thru form you can send the $target_path and upload your temp files to $target_path.

     

    this tweak will be done in both php and html file .

     

    For showing the uploaded document you can do it also.Simply when the file is moved check if file_exists($newly_uploaded_file) on server and show that in html form.

     

    Regards

    Regards

  10. it is a javascript error....

     

    first do one thing create a single string for all xml i.e

     

    $xmlstr= '<?xml version="1.0" encoding="ISO-8859-1"?>

    <person>';

    while($row = mysql_fetch_array($result))

    {

    $xmlstr.=  "<firstname>" . $row['FirstName'] . "</firstname>";

    $xmlstr.= "<lastname>" . $row['LastName'] . "</lastname>";

    $xmlstr.= "<age>" . $row['Age'] . "</age>";

    $xmlstr.= "<hometown>" . $row['Hometown'] . "</hometown>";

    $xmlstr.="<job>" . $row['Job'] . "</job>";

    }

    $xmlstr.="</person>";

     

    //do echoing after completion of your xml

    echo $xmlstr;

     

    now after chaging this tey to alert(xmldoc) i.e your responseText and see wether correct xml is received or not.Use firebug(extension in firefox) to track your error.

     

    Regards

  11. your form - post size should also be more.

    to increase it use php.ini and set post_max_size.

     

    upload_max_filesize = 10M ;

    post_max_size = 20M ;

     

    and remember to check your memory_limit notable point is :memory_limit should be larger than post_max_size

     

    Regards

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