Jump to content

nadeemshafi9

Members
  • Posts

    1,245
  • Joined

  • Last visited

Posts posted by nadeemshafi9

  1. Hello

     

    I am trying to set extra headers for the email in order to set a return-path for bounces, i am using pear mail mime and its working wonderfully but i cant seem to set this header, when i look at the code of the email when it arrives the return-path header is at default, myname@mymachine.com which i would like to change.

     

    my code follows the instruction

    http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodheaders

     

    array &headers( [array $xtra_headers = null], [bool $overwrite = false])

     

    Parameters:

    array $xtra_headers — Assoc array with any extra headers. Optional.

    bool $overwrite — Overwrite already existing headers.

     

          
    <?php
    // Body
    	$body = $this_mail_mime->get();
    
    	// Extra Headers 
    	$extra_headers['return-path'] = 'nadeem.shafi@mycomp.com';
    
    	// Headers 
    	$headers = $this_mail_mime->headers($extra_headers, true);
    ?>
    

     

    Thanks

  2. i would like to delete or set permissions on a file immediately after download, i am creating a file and will allow the user to download it but it need to be deleted as soon as its downloaded, is there a way of doing this.

     

    I was also wondering can you you create a file but not keep it on your server but just let the user download it.

     

    i know JavaScript is involved.

     

    can someone give me some plain English ideas. I basically want to stop people from manually downloading confidential data files yet allow the user to create dumps etc and download them.

     

    thanks

  3. really? my personal and from-hearing experience with 'higher education' is that they just give you a list of all the homework/papers you need to turn in, tell you what books to buy, and then it's up to you to make sense of everything.  Professor rarely around and if he is, he's reading from something or other.  May as well be on TV or radio and they actually do do that a lot... One on one help? Go find a study group of people in the same boat as you, trying to figure it out.  Motto seems to be that you may learn the material, but you won't learn to think for yourself when someone else is holding your hand explaining it to you. 

     

    But...it's possible I've just been to and heard about crappy colleges.

     

    you need to go to lectures, where u sit and listen, professors may not be around in seminars or classes where they task you to it and leave you alone, but in lectures u sit there and absorb .

  4. Thanks for the reply, that is what I was afraid of. But I still don't want to be coding the mechanics of a site from scratch. If it's not practical to plugin PHP code into a CMS such as drupal, then can it be done the other way around? In other words, are there frameworks, libraries etc that allow you to easily build a website around some PHP code?

     

    Caroline

     

    yes you may use Jquery and its plugins for your frontend and tigra menues and PEAR for functionality

  5. if your brand new to php you should not go near drupal reconfiguration with a 100 foot pole, you should make bespoke applications before you can get a grasp of the ideas used in those types of applications. just because you use drupal dosent mean it will be easier to make the application, drupal is just a system which you use for fast effective mass production of cms sites, it will restrict you in what you are trying to achieve. in essence you will spend alot of time learning drupal and its glitches and kinks or ideas rather than learning programming principals and cross browser computability.

     

     

    i have used drupal before i was a professional php developer and it was like looking at a bowl of spaghetti, after i developed loads of bespoke systems and implemented my own frameworks for CMS's and learned computability and php issues and concepts only then was i able to pick up the manual for drupal etc and do anything with it, thats my advice.

     

    from my experience using drupal is like trying to draw a circle without a stencil. but once you get the hang of it its ok but your development will always be latched onto the core so if the core dosent except your development then your screwed.

     

    eg. you want to create a new function but you cant pass the data around like you want etc

     

    you want something to happen at a specific time but you cant.

     

    there can be allllllllllll sorts of issues unless its gona be a str8 forward CMS with some basic front end functions you should be starting from scratch.

     

     

    admin panels are easy to code, as for forums you can easily make one or you can use one that's readily available. You can use frameworks such as JQuery and repositories such as PEAR.

     

    so my answer is basically learn php first before you learn a refined system like drupal, drupal has a lot of jargon which will no doubt confuse you and waste your time.

     

    time is money

     

  6. Hi. I am a thirteen year old w/ no life who is learning PHP for a project. I did a little BASIC programming in fourth grade and I tried to learn C++ when I was in fifth. Didn't turn out too well. I might start that up again after I'm done with this PHP project... then again, might stay the course. I want to become a physicist at CERN when I grow up, and I am good with photoshoping images.

     

    i tried learning programming when i was 13 aswell and it didnt go well i also used BASIC the language if that's what you mean, dont worry as long as you have a taste for it, when there is somone to teach you how to program you will pick it up easily just like anything else in the world once you are taght how to do somthing using a combination of methods that they use in universities you will know how to do it. In schools they dont use these teaching methods rather they expect you to memorise, university is different you are expected to understand underlying theories and constructs.

     

    Dont worry you will learn when your taught, you cant expect to do a few tutorials and know it all, someone with a proper teaching plan will get the knowledge into you, at university, you prob have to go college first.

     

  7. UPDATE tbl SET name = REPLACE(REPLACE(name, '\r', ''), '\n', '');

     

    what if its a vbCrlf not a /r or /n or what if its a /r/n

    vbCrlf is a constant used in languages based around MS basic.

     

    im not with you my knowledge is not vast on that side, but i remember trying to remove new lines in ASP a few years back and it took me ages until i removed the vbCrlf, so i was thinking it may have gone in as that, or would that be what ASP calls it in the code ?

  8. Trim didn't work, nor did the ereg replace, regretably.

     

    I have a temporary fix in using LIKE 'name%' Which would work in the program as none of the names would double trigger that search function. But I would prefer to find a fix incase it does come up :(

     

     

    listen you need to do an reg exp that says anything that isnt a number and and isnt a characher alpha i dont know how to negate but it is as follows [a-z 1-9]

  9. if you are using IE you need to add the date or time

     

    xmlHttp.open("GET", "lib/additem.php?tablename=" + tablename + "&"+ie_fix(), true);

     

     

    function ie_fix(){

    // this function creates a timestamp to append to AJAX

    // url's in order to fix a chaching issue with IE

    var date = new Date();

    var timestamp = date.getTime();

    return "time=" + timestamp;

    }

     

    IE thinks the url is same so page must be same so caches it and does not update page from server but from cach

     

     

     

     

    if teh tabel name isnt getting there that means you have space sin teh table name or it just isnt getting throgh right, you may need to url encode and decode

  10. well with regular expressions you can say get rid of the /n/r and naything else you want to get rid of and then you can re update the record with the new value, use php to do your reg exp

     

     

    result = sql = get all from table

     

    while (record = mysqlgetarray(result)){

          new_username = ereg_replace("/r/n", "", result['name']);

        // add other things to ur reg exp aswell [1-9][a-z] i think \z* means 1 from last and you can replace it with ""

        update table set name = 'new_username' where id = result['id']

    }

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