oni-kun
Members-
Posts
1,984 -
Joined
-
Last visited
-
Days Won
1
Everything posted by oni-kun
-
Why not look up the JS tutorial for window.open.. I'm sure you'll find your answer there. But this is the wrong forums, it's for PHP not JS.
-
Might be. Look in upload.php line 7 and callcPanel.php line 15, You'd usually get that sort of error on an eval() or include() if they use the same declarations when instantiated..
-
That sort of captcha will require a hundred thousand line OCR, preferrably in C++ to filter through. Doubt you'd want to do that now would you?
-
Whoops, Forgot to encase the elseif in brackets. Replace it with this line: } elseif (preg_match('/httpdocs/i', $docRoot)) { And it should work.
-
I've been thinking of freelancing, but not so much in the corporate world, more of referrals or 'for a friend's friend'. My older brother has wanted to start up a T-Shirt company, a local one downtown, who's a better person to turn to than me for a website for promotion? $100 for a template editing and simple session/e-mail developing.
-
Yes! 80% of them are whiney 14 yearolds who apparently cannot say anything other than 'FUCKIN CAMPIN NOOB GOD', or..er.. older's ... make that 100% That is why I turned voice Off, seriously, only place i'd want it on is in WAW with Nazi Zombies. (Can't wait for next mappack!!!)
-
And here's my contribution, Rollover for CV's:
-
Maybe you should look at the eval function and read what it actually does.
-
I'm sorry I don't get it what is /i and getnv for? $_SERVER is a superglobal of getenv. /i is a modifier to make the case insensitive. So it can be "PUBLIC_HTML" or "public_html", It's usually just safer that way.
-
Prevent PHP mail( ) from appending hostname to from address
oni-kun replied to jrw4's topic in PHP Coding Help
But that is what I said already... if I try $header = "From: 9996663333"; Then PHP appends the host name to the from field (see thread topic). So the phone will then see that the SMS is from 9996663333@host. I do not want this, I am asking how to stop PHP from appending the hostname on the from field of an email. Grow up. Can you send data from a machine without an IP address? The recipient physically has to have the connection from their SMTP server to yours to recieve the message. If the host does not recieve a HOSTNAME, than it will drop it in error. Further, if you're sending it to a mobile host, than obviously it'll need its host to be 'vtext.com' and not blank, nor yours. EDIT: What on earth does PHP have to do with an SMTP wrapper class? PHP isn't appending anything. -
Then this is an HTML question, Not PHP. Always use & instead of '&'. If you're looking for a PHP function, use url_encode $string = 'onclick="window.location=\'index.php?'.urlencode('Page=Profile&PROFILE_ID='.$USER_ID.'\'">');
-
Haven't tested this code that I wrote, but it's not hard. $docRoot = getenv("DOCUMENT_ROOT"); if (preg_match('/public_html/i', $docRoot)) { include("callcPanel.php"); } elseif (preg_match('/httpdocs/i', $docRoot) { include("callPlesk.php"); } else { exit(); } So you know, DOCUMENT_ROOT returns something like.. " /usr/local/apache/share/htdocs" preg_match is a good function to match something from it. EDIT:'ed a few things
-
I have a table set where the rows are in this format: ID - Done - Length - Weight And there are 43 rows.. but if I wanted to update a row (from a mass of inputs) for ($i = 0; $i <=42; $i++) { $sql = " UPDATE `personal` SET done='".mysql_real_escape_string(Checkboxfilter($_POST['done'], "$i"))."', //returns yes/no length='".mysql_real_escape_string($_POST['len'][$i])."', weight='".mysql_real_escape_string($_POST['weight'][$i])."', WHERE id='".$i."' "; mysql_query($sql) or die('MYSQL Erorr:' . mysql_error()); } It gives me this error: MYSQL Erorr:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='0'' at line 5 Is there a problem with using WHERE id=$id in the update command?
-
Actually another question. Since I inserted all of them so the SQL table is filled now, I need them to update, not submit more: "UPDATE personal SET weight = $_POST[weight][$i] WHERE ID = $i" Will that work? An example is if I filled in another textbox, as they all will slowly be filled in over time. Just want them to update and populate slowly.
-
You forgot the ")" at the end of each $_POST's! but nonetheless this works perfectly, was confused if I had to use a foreach loop or not, This way is the way I like it, simple Thanks.
-
I have three arrays (of 43 elements each) sent from an html form: done[], len[], and weight[] How do I use a loop with insert for a query?.. for example: foreach ($_POST['len'] as $v1) { echo $v1; } Will echo all of $_POST['len'][0-43], but how do I loop all three $_POST['done'][0-43], $_POST['weight'][0-43] arrays and put them into one INSERT query?! In the SQL, my structure is "ID, done, length, weight" .. so I just need to somehow loop from 0-43 and insert each value.
-
Any variable will be passed with the include provided they are in the same scope. a.php: $a = "foo"; include('b.php'); b.php: $b = "bar"; echo "$a$b"; //echos foobar
-
I'm being incredibly ignorant and making 62 textboxes, basically 3 per day, for reasons I have for logging some stuff. So when I enter something like textbox 3.. It'll update that and not the the others, so I can add upon the forms as I get the info I need for them. How would I insert $lenxx into record xx for sql?.. I guess i'd need to use explode.
-
Could do, but need to check if they're false or whatnot. I want to make love with you. $var_array = $_POST; extract($var_array, EXTR_PREFIX_SAME, "xx"); echo $len33; Works perfectly. I can so easily loop it now. Wow, lots of good answers. I can use this with the other one to loop it into the database, Thanks! It's 8am, OCD made me want to finish this, I can sleep in tomorrow
-
You'll think it's completely lame, For the shite of it I wanted to create an exercise log, with each textbox as a day, so I can store each progess (length of run, weight) into all those textboxes and send them into the DB so I can compare data, and whatnot. Little did I know, I needed 3942034092390 variables and a forloop or else i'd be repetatively coding for days. I know it's wrong, but just need to finish this darn loop! Hmm.. I need 3 foreach loops then? because I have three variable++++'s that I'm using..
-
Do I do it as so? foreach ($_POST as $key=>$value) { ${'lendata'.$key} = $value; } What I want to do is just grab a billion textform inputs from the same page (len1, len2, len..), for some stupid script of mine, I just want it to assign every box to a variable (empty or typed) so I can insert it into the DB, heh. EDIT: fixed foreach pseudoexample..
-
How would I write that simple statement as a foreach? I am usually confused with those..
-
I'd recommend glob and array_rand EDIT: You can use count on the array of files to get the auto-count, but it's pointless to append numbers to a filename, like that, not as fast.
-
I tried the above method and it didn't work: echo $_POST['len33']; //echo's fine for ($i=22;$i>=62;$i++) { ${'donedata'.$i} = $_POST['dec'.$i]; ${'lendata'.$i} = $_POST['len'.$i]; ${'weightdata'.$i} = $_POST['weight'.$i]; } echo "$lendata33";// Does NOT echo "Undefined variable: lendata33" <--- Do I need to use $GLOBALS since it's in for? Why does it not associate $lendata33 with $_POST['len33'] ? Your foreach, Maybe i'll wonder into that once I get some answers here. It looks like it should work, why not!?
-
Lets say I have a form with 40 elements. How can I dynamically assign them into a variable?... I think I tried something like for ($i=0;$i>=40;$i++) { ($data$i) = $_POST['data_form_'.$i]; } How on earth do I assign it with a loop?