
ess14
Members-
Posts
45 -
Joined
-
Last visited
Never
Everything posted by ess14
-
just curious, is it better to use regex to check input into databases than using stripslashes/addslashes etc? I figure that using regex to make sure there is only alphanumeric characters in strings no attacks could occur. is this correct? or am i missing something? of course sometimes you want special characters in your DB, so in which case you would addslashes or use other php functions (real escape string etc).
-
perhaps a regular expression would help, try look that up
-
im having trouble with passing variables between functions....below is a cut down version of my script. when i try the document.write after calling isSub("no") its just saying 'undefined'. If i change 'theSub = getSub.value' to 'theSub = getSub' the document write is correct (says "no"). I need to keep the getSub.value because thats the only way i could get the value from the radio button at the bottom. any help? function setBase(getBase){ isSub("no"); } function isSub(getSub){ theSub = getSub.value; document.write(theSub); } ---html form element---- <input name="uni_type" id="cut" type="radio" value="no" onClick="isSub(this);" checked="checked"/>
-
decided on this: preg_match('/' . preg_quote($start, '/') . '(.*)'. preg_quote($end, '/') .'/i', $string, $m);
-
in my usage it should only have 1 result. ie there will be no more matches. if u look at the above code the start and end can only leave 1 thing. but how do i get that into the array? the full stop is stuffing it up somehow
-
having a little trouble with this expression....im very new to regular expressions, so its no wonder im having trouble. As you can see (when u run this script) im getting no output. the problem seems to be the fullstop (.) how do i get the array to return the word 'lambs.'? even when i try escape the full stop, its like the stop is still stuffing things up...what am i missing? function findinside($start, $end, $string) { preg_match_all('/' . preg_quote($start, '/') . '([^\.)]+)'. preg_quote($end, '/').'/i', $string, $m); return $m[1]; } $start = "13"; $end = "mary"; $string = "mary has 6 lambs. phil has 13 lambs. mary stole phil's lambs. now mary has all the lambs."; $out = findinside($start, $end, $string); print_r ($out);
-
ive decided to go with PEARS mail functions (mail_queue) Another question though, how do i test send, say, 5000 emails? Just to make sure they get sent, and see what happens when some arent delivered etc? I have set up a local mail server and I can test that way, but Id really like to test in a WAN environment. If i send 5000 emails to my hotmail, will that have a negative effect on my SMTP host? will they be blacklisted as spam? or should i stick with my LAN testing, and just keep an eye on things when i go online?
-
Ive been doing more research into the topic and ive decided to go with SMTP relay hosting for emails. If i want to send 10,000 emails out, whats the best way of doing that with php? Ive come accross a couple of options for sending the actual mail from php, what do people think? any other suggestions? -- PEARs mail class with PEAR mail_queue -- php's fsockopen(); any pro's and cons? My main concerns are making sure all emails get sent, and that im not viewed as a spammer from mail servers! All contacts on the list are opt-in!
-
wow, thats awesome! you have been a wonderful help! i cant thank you enough!
-
thanks for your help, ive looked into it and im getting closer to where i want to be! Now, im asuming i will have to set my machine up on a static IP so i can get a proper DNS to send email from. I cant send bulk email through my ISP's SMTP and i cant send email from my localhosts dynamic IP address(gets blocked by mail servers). Im not sure if i want to go down this route though.... I guess i will have to find some sort of SMTP hosting for mailouts.... any other ideas?
-
cheers for the tip. i am looking into the CLI now. Could you please give me more information as to why the CLI is the way to go? And how would i use the CRON jobs? is that not just scheduling? Does anyone else have any insight?
-
I want to create a system where people sign up to a mailing list. heres the thing though, when they sign up they pick from a number of options that is then stored in a database with their email. I then want to send out emails to all these people relaying the options they picked. is php capable of going through a possible list of 10,000+ rows and individually mailing the user? is there some other way of doing it? do you know of a better system to use instead of php? Would i need my own mailer (as i know most hosts wont alow you to send bulk emails from their servers)? I imagine if i just did select on every user and mailed them from php my script could time out, or emails would be lost. any input, insight and constructive comments welcomed!
-
haha, thanks!! thats cool, learn something new every day!
-
im not sure exactly what your asking, perhaps be more clear and show some examples of your page/form, and some of your database structure. But here is my solution.
-
Well im using PHP and MySQL and i have a table like so(for example purposes): NAME ORDER john 1 greg 2 benny 3 don 4 If i delete the row GREG, what is the best way to get the order to stay in sequence. ie: Benny's order should now be 2 and dons should be 3 This way the order will have no gaps in the sequnce. imagine theres 30 rows too! so i cant really update EVERY row one by one...can i? should i? thanks for any help.
-
function elemOn(elem_id){ if(document.getElementById(elem_id)) document.getElementById(elem_id).style.display = "block"; } should it just run it twice with the differant variable names?
-
Is there some reason why you cant do the followng in javascript? function showOne(elem_id){ hideAll( ); elemOn( elem_id ); elemOn( elem_id+"T" ); } is it okay to call the elemOn function twice with differant variables? for some reason it will only do the one that comes first. not a big javascript guy so maybe its not possible? any more information or help?
-
can anyone tell me why the following code isnt working? $sql = mysql_query("INSERT INTO users (tracknum, username, address, state, city, phone, fax, email, groupn, isdone) VALUES('$tracknum', '$username', '$address', '$state', '$city', '$phone', '$fax', '$email', '$groupn', '$isdone')") or die (mysql_error()); I know all the variables exist before that statement. Is there anything else it can be? Im not getting any error codes or anything. only this... if(!$sql){ echo 'There has been an error creating your account.'; } Has anyone got any ideas of what it could be or how to get some more useful error messages?
-
sorry, i looked for somin like that but didnt see it...
-
are you hosting the servers?! if not... youd wanna get onto them about it.
-
Im by no means a vetran at php programming, but this is the first time ive really been stuck stuck. And im starting to lose the plot! I really need some help from you guys with modifying this script i have. Now, i really dont think i could explain everything over here, so im asking if some people can step forward and send me their msn address so i can send them some files to look at and possibly give me a little help with this script. Im willing to give some money to anyone who can solve my problems...somewhere around the $50US mark. im really getting desperate here! Thanks alot!
-
cheers for that... month worked.
-
Having a little problem working out the proper sql for this query.... What im trying to do is return some results grouped by the month they were added. So how do i do that in sql when my columns are in DATE type. so, say the date is 2007-02-20 in my date field, how do i use SQL to just return the month(ie 02) so that i can group it? Can i use DATEPART() on a Date type column? thanks for the help
-
[code=php:0] if (get_magic_quotes_gpc()) { $stripTrack = stripslashes($_POST['tracknum']); } $tracksimple = $stripTrack; $tracknum= mysql_real_escape_string(trim($tracksimple)); [/code] Will that sort of data check be okay? is it correct?