![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
nadeemshafi9
-
Posts
1,245 -
Joined
-
Last visited
Posts posted by nadeemshafi9
-
-
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
-
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 .
-
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
-
-
basicaly it might conflict with what you want and it will take alot of time to get your head around it, it wont have methods of doing things like you may think it has, its just a managment system, you need to look into jquery and pear
-
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
-
With SQL, how can I select 3 random values "WHERE status='2'" ??
Thanks.
something along the lines of
SELECT * FROM table WHERE status=2 ORDER BY RAND() LIMIT 3;
-
are you sure that the mail is not sent and blocked as spam ?, are some emails getting through, if so which ones
-
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.
-
output everytthing in php and everything in javascript with a ALERT() and see what the state is once you pressed teh button and you will see where it is
-
this dudes using a textfeild for username
-
if you are using IE...
this happens in FF, IE and Safari...
did u fix ur prob ?
-
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 ?
-
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
-
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]
-
-
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
-
lol use jquery its oooooooo so much simpler
-
i think \z+ means 1 from last and you can replace it with ""
-
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']
}
-
Newbie question: I have index.html as my main site file. Can I use php within that file? Or do I NEED to run php only within a php file?
there may be soem way to use php on that file by changing the web servers config to parse all html files wihc would be silly better off rename teh file .php
-
you will have to get the results with php one by one and then ereg replace the /r /n or woteva with '' and update the record one by one, make a copy of the db and test it out. some of the experts here may be able to show you regex functions in sql if there are any
-
you may also want to look into jquery
-
as far as i can see no but i have never used php mailer, unless you need to send them the image which your not meant to do, you should store the image on therver and link back to it.
[SOLVED] PEAR Mail_mime extra headers help
in PHP Coding Help
Posted
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.
Thanks