-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
I'm actually having a great day, finally got my paycheck after weeks of having nothing because of some clerical iussues
-
http://www.phpfreaks.com/tutorial/basic-pagination
-
How do I detect the length of text in pixels in PHP?
mikesta707 replied to hedgehog90's topic in CSS Help
why not just make 2 brs if its less than or equal to? -
$string = "blahblah.blahblah.flv"; $tokens = explode(".", $string); array_pop($tokens); $stringNew = implode(".", $tokens); $stringNew .= ".jpg"; echo $stringNew; untested but that should work. edit: fixed a few things, and tested, output: blahblah.blahblah.jpg
-
I would, instead of having inviduvidual post variables like you do, make an HTML array, so your form should resemble <!-- questions --> <input type="text".... name="Question[]" /> <input type="text".... name="Question[]" /> etc <!-- question ids (assuming they are hidden fields? --> <input type="hidden" name="qid[]" /> <input type="hidden" name="qid[]" /> etc and then you could just loop through each question and corresponding id like so foreach($_POST['Question'] as $key=>$value){ $aid = $value; $qid = $_POST['qid'][$key]; $query = "UPDATE ...... WHERE aid= '$aid' AND qid='$qid'"; //do query }
-
Pass variables into form but still use POST to submit
mikesta707 replied to blommer's topic in PHP Coding Help
if you submit a get to the page the form is on, you can just do something like $textbox = '<input .... value="'.$_GET['school_name'].'".. >'; -
meh, you should definitely learn as much as you can about linear programming, but you don't have to wait to learn OOP. There are many tasks that are more efficient in OOP than linear, and there are many where the opposite is true. It is best to use the best tools you have available for the task, and as you program more things, you will realize whats best, and learn naturally. However, don't get over your head, if you don't feel comfortable with doing OOP, than by all means, just use a linear style for a while. The best way to learn is to do something you're interested in. You seem to want to create your own site. Well I would suggest trying to create a simple site. make a user login system, maybe some admin stuff. progress to a simple content management system (CMS) with comments or some sort of user interaction. Maybe try out Wordpress so you get some experience using other peoples code. Try making a facebook application afterwards. Once you get comfortable with OOP, try making more robust systems than the simple one's you made earlier. Just make sure whatever you're doing is of some interest because boring projects are just... well... boring
-
same code works perfectly fine for me? did you update the counter? //while loop stuff above $counter++; }//end while sorry forgot to put that, but thought it was obvious btw you may want to set $counter to 1 instead of 0. 0%4 is 0, so the first time the loop runs it will do the //do something every 4 code
-
[SOLVED] Newbie looking for help before I pull out my hair
mikesta707 replied to deadline's topic in PHP Coding Help
that wouldn't really make sense? what would your condition be? just post the code where you set the variable and send the email -
variable names don't matter. you could name your variables goboldygook1, 2, and 3 and it would work fine
-
[SOLVED] Newbie looking for help before I pull out my hair
mikesta707 replied to deadline's topic in PHP Coding Help
alright, well im not gonna trod through all your mass of code, so post the relevant code in code or php tags so I can take a look. -
ahh thought i say a 1 in your suggestion
-
oops $counter = 0; while(condition){ if ($counter % 4 == 0){ //do something ever 4 } //do other stuff }
-
shouldn't it be $_POST['num1'] not $_POST['num']?
-
try setting the mime type as text/html
-
$counter = 0; while(condition){ if ($counter % 4 = 0){ //do something ever 4 } //do other stuff } second post like this today
-
set them to null in the table (rather than a blank value) consult this page for tips on dealing with null values http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html
-
[SOLVED] PHP form for Editing a MySQL database
mikesta707 replied to csteff24's topic in PHP Coding Help
it would help if you posted the errors -
Way to insert code after so many items display in a loop
mikesta707 replied to msaz87's topic in PHP Coding Help
$counter = 0; while (condition){ //stuff if ($counter % 4 == 0){ //do somethign every 4th time } $counter++; } untested but should work. you may need to set counter to 1 -
well if someone has access to your .cfg file, than they have access to the rest of your files.. no? but look into feof() (or file_get_contents), and try to get the contents of each line of the .txt file, and then come back with whatever issues arise
-
create a table of categories, and have a column that holds the parent for that category (default it to NULL if you want) thats How I would do it
-
if its just the values, than a nested foreach loop should do the trick. alternatively you could just concatenate all the values into a string, or use implode, IE $text = implode(',', $array);
-
pretty much what s0c0 said. $sql = "SELECT email FROM table WHERE id=$id LIMIT 1";//limit to 1 row returned $query = mysql_query($sql); $row = mysql_fetch_assoc($query);//could also use fetch_array or fetch_row i guess, but i prefer fetch_assoc $cell = $row['email'];//$cell now contains the email address just replace table with your table name, and id with whatever the userID column is, and obviously $id with whatever variable you are using that stores the id of the row you want to access
-
anyone ever use Talend? and integrate it with some Java code. My boss pretty much just threw me in the water without any water wingies, so I'm kind of lost as i've never used this software, or any other ETL software before in my life. Any tuts or tips to get Java working? or at least how to set the class path of some script
-
well thats what serialize does. How are you doing to be using this textfile? if you just want to store the value of the array so you can access the array again (and use it like an array) than sasa's script is the way to go