scootstah
Staff Alumni-
Posts
3,858 -
Joined
-
Last visited
-
Days Won
29
Everything posted by scootstah
-
Couldn't you install an SSH server and use that?
-
Advice on what to charge for a freelance job
scootstah replied to melting_dog's topic in Miscellaneous
Doing "mindless data entry" is still spending your time that you could otherwise be doing something else. In my opinion, charge for the time the project takes you no matter what task you are actually performing. The only other option is to make a deal with your client to split the project into two separate projects - development, and data entry and then you can charge accordingly. -
Controlling Relays or I/O hardware through PHP?
scootstah replied to woolyg's topic in Miscellaneous
I don't think PHP is the best language for this, but it shouldn't be that difficult with Python. -
Knowing how the internal clusterfuck of function calling works from memory.
-
Come on, did you even try?
-
Using Jquery each() to veiw individual divs (modals)
scootstah replied to son.of.the.morning's topic in Javascript Help
So why not do something like this? $(document).ready(function(){ $('.basic').click(function(){ $(this).children('div.hidden').modal(); }); }); <style type="text/css">.hidden { display:none; }</style> <div class="basic"> <div class="hidden">Lorem Ipsum</div> </div> -
No, count will count the number of elements inside an array. What you want is array_sum() like MasterACE14 said.
-
Wow, way over-engineering it. As xyph said, use eval(). If you can't use eval() (sometimes it is disabled) then save the input to a file and then include it.
-
I don't understand how this couldn't also be reproduced.
-
Using Jquery each() to veiw individual divs (modals)
scootstah replied to son.of.the.morning's topic in Javascript Help
What exactly is this script supposed to do? -
100% background image is rendering page useless...help?
scootstah replied to stevengreen22's topic in CSS Help
Why don't you just stick it to the body? body { background:url(btest2.jpg) no-repeat; } -
Export mysql to txt / xml file and download it
scootstah replied to thaidomizil's topic in PHP Coding Help
In my code as well? Because in your code, you call ob_end_flush which is going to dump the buffer and output the results. Since there is output, the headers wouldn't have been sent and thus nothing will download. But in my code, there is no output (unless it's coming from somewhere else). I'm guessing you just don't have errors on so you didn't notice all the errors from calling headers after output. -
Transitioning from Joomla to PHP Framework
scootstah replied to MatthewSchenker's topic in Frameworks
In the end it doesn't really make a whole lot of difference which one you pick. As far as frameworks go, CodeIgniter is probably the easiest and fastest to pick up and use from nothing. It's ridiculously easy to get up and running with it. But in the end, you can do the same things with any framework. So my advice is to download both, spend a few days working with them on a basic app, and pick whichever one you had more fun using. -
Export mysql to txt / xml file and download it
scootstah replied to thaidomizil's topic in PHP Coding Help
If you are sending those headers there shouldn't be any output on the screen. -
Remove changing substrings from string
scootstah replied to CitizenErased's topic in PHP Coding Help
$string = "String (2) string string string (7)"; function removeIntegers($string) { return preg_replace('/(\([0-9]+\))/', '', $string); } Fixed. -
Export mysql to txt / xml file and download it
scootstah replied to thaidomizil's topic in PHP Coding Help
You are ending the output buffer and clearing it, so $text is going to output nothing. Try this instead: $text = ob_get_clean(); header("Content-type: text/plain"); header("Content-disposition: attachment;filename=\"filename.txt\""); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: ".strlen($output).";\n"); echo($text); -
He said he's using Oracle, which doesn't support that.
-
Well that must be part of a template parser. I don't know which one, but by looking at the string I think this might work: <{assign var="title" value="Visit "|cat:$people->getTitle()|cat:" "|cat:$people->getName()|cat:" | Sea.com"}>
-
Yes, but only with Javascript. Here's a quick (untested) script with jQuery: $(document).ready(function(){ $('a.track').click(function(e){ e.preventDefault; $.post('track.php?url=' + $(this).attr('href')); window.location = $(this).href; }); }); Any anchor tags with the "track" class will trigger this event, which will send the HREF to a PHP script which will then interpret the $_GET variable and log it in a database.
-
Remove changing substrings from string
scootstah replied to CitizenErased's topic in PHP Coding Help
$string = "String (2) string string string (7)"; function removeIntegers($string) { return preg_replace('/(\([0-9]\))+/', '', $string); } -
I get that, but what are you writing it in? That is not standard PHP or HTML.
-
I think your problem will be solved if you let SQL do the work for you. INSERT INTO table (id) VALUES (id + 1);
-
What is this syntax from? I am assuming some sort of template parser?
-
By using the value attribute for option. // get forums $result = mysql_query("SELECT * FROM forums"); $select = '<select name="forum">'; while ($row = mysql_fetch_assoc($result)) { $select .= '<option value="' . $row['id'] . '">' . $row['name'] . '</option>'; } $select .= '</select>'; On a side note, please do some reading on how to use JOINs in SQL. Running queries in nested loops is a big no-no, especially 3 levels deep. Take a moment and think about how many queries you are potentially running. First you are looping through all the posts. Then in that same loop, you are looping through the users, then in that loop you are looping through avatars. So if you have 20 posts, you are running like 60+ queries JUST to get the forum posts. Using JOINs, you could do it like this: SELECT p.*, u.*, a.* FROM posts AS p LEFT JOIN users AS u ON u.username = p.poster LEFT JOIN avatars AS a ON a.name = u.useravatar WHERE p.topicon='$gettopicid' And then just loop through that once and you have all the same information.