-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
and you also need to put these lines before the "while" loop. echo "table"; echo "<tr>"; (and you also need to have "<table>" not "table")
-
remove the "for ($y...)" loop. In the example code, that loop was meant to simulate the "while" loop you already have for looping through the files.
-
And it also says read the ToS to find out the rules/conditions/limitations surround that statement. Do yourself a favor: stop being retarded and accept responsibility for your mistake and learn from it. I know it's really hard in this day an age, seeing as how it seems society encourages you to to point the finger at other people, but that's a pipe dream. Unless you are already on top, you will not get very far by trying to hold other people accountable for your mistakes, and in many cases, you will wind up getting burned even worse in trying to do so.
-
Not sure I understand the question. The example code only outputs one table. It starts out by echoing out the opening table tag and opening table row tag. Then in the loop it outputs a closing and then opening table row tag based on the condition, meanwhile outputting individual table cell tags for each value. Then after the loop, it finishes off by outputting a final closing table row tag and finally the closing tag for the table.
-
hmm..kinda odd that adding slash doesn't do it for you...anways, yes, ([0-9]+) means to match one or more numbers and capture into $1
-
You said you went with the $100 silver plan. The listed price on their website is $100 (or like $99.95 or something, close enough). While you did not explicitly say "I paid $100," I think it was reasonable to infer from your statements that you did indeed pay full price. If that wasn't the case, then okay sorry for misinterpreting..just sayin' though... Again, that is your opinion. In my opinion, they are very clear in what they sell. It is you who misunderstood, and you misunderstood because you failed to research. You cannot blame Yola for your failure to research and ask questions before buying. That is your fault. But Yola isn't a traditional hosting provider. They do not claim they are. They claim to provide non-tech oriented hosting solutions. All over the place they explain what their services are geared for, and what they offer in that regard. As I have mentioned earlier, it is not fair to expect a company to list the things they do not offer. What is fair is to expect the customer to find out by actually reading and asking questions, if they are unclear about something - something you clearly and admittedly failed to do. I can't speak one way or the other to this. Maybe they are giving you the runaround, maybe they aren't. If I had to make a judgment based on what I do know (what I see on their site vs. your posts), I would err on the side of you being the one unreasonable. I read the Money-back Guarantee portion of their ToS...it is not as simple as you make it out to be. Certain parts of the price are non-refundable, and between that and your coupon discount, you may not even have anything to be refunded. Did you bother to read the ToS? You've already admitted to not reading anything else. Okay clearly the service they are offering is not what you were looking for. But you have nobody to blame but yourself for signing up for something without doing your homework. And by homework I mean actually reading what the do and do not offer that is clearly posted throughout their website, or even contacting them to ask questions. This is not a good indication of a poor hosting choice. This is a good indication on poor judgment on your end. This is your fault, not theirs. I'm sorry, it's nothing personal and I'm not necessarily trying to come down on you. But you are unfairly defaming someone else for your mistake. The only takeaway I see here is next time, don't just jump headfirst into something before buying it. Read the description. Ask questions.
-
also, just nitpicking but the regex should serve your purposes but it could stand to be a bit better. Instead of matching one or more of anything that's not a forward slash, it should only be matching for what the expected value of id should be. Examples: only numbers: RewriteRule ^/videos/([0-9]+)\.m4v fileserve.php?id=$1 alphanumeric RewriteRule ^/videos/([a-zA-z0-9]+)\.m4v fileserve.php?id=$1 This is especially important since you aren't validating $_GET['id'] before using it in your sql query (which you should be...). As of right now your script is vulnerable to sql injection.
-
you don't really need a rewrite base. You could have done RewriteRule ^/videos/([^/]+)\.m4v fileserve.php?id=$1
-
remove whitespace, blanklines and <br/> type tags at the beginning and end of script.html
-
Yeah I saw that. Which brings me to the part where I mentioned that you need to also call your $('.edit').click(...) stuff whenever the plugin loads new content, after it is loaded. The plugin may have a special callback function you can put the code in. If not, you will have to hack the plugin. I told you the issue in general and pointed you in the right direction of what you need to do as a next step. I can't really be more specific than that because I don't know that plugin and TBH I'm not really interested in researching and finding out the inner workings of arbitrary scripts (like plugins) unless someone is interested in throwing money at me. Perhaps someone else around here has experience with that plugin specifically and will know offhand where you need to apply your code in regards to that plugin. Or you may have better luck by going to the site of whoever made the plugin.
-
Welp, I'm here to help people learn, not hand out freebies, as I do this sort of thing for a living. I'll be more than happy to apply the concept to your posted code and hand you the resulting code if you want to pay me for it. Or perhaps a more altruistic soul will do it for you for free. I do suggest you try to learn it though, otherwise what is the point in coding it yourself?
-
So I just went to their website and did a basic, quick recon of their pricing/plans, services, other sections of the site, and here is what I found: You complain about them not saying what kind of access you get but it seems to me that they clearly tell you what access you get. They have a snapshot of features in the pricing lists. They have a "features" tab that shows you what all they offer, what you can do with their services outlined with screenshots and a link for more details of exactly what you can do. So what you're really complaining about is them not telling you what kind of stuff you don't get. IMO that really isn't a fair expectation to set. Why should a company be expected to list what they don't offer? Which brings me to my next question: why didn't you research what they did and didn't offer, before making the purchase? Looks like they have plenty of venues for asking them questions. They have forums to ask/search. They have a popout tab on the left of the site encouraging you to talk to them. They have a phone number plastered everywhere inviting you to call them. They have a "get help" tab right there on the top. You can enter in questions and it tries to spit out answers. For example, I typed in "ftp" and I got: I'm sorry, I looked around their site and it is my opinion that they clearly advertise website building/hosting services oriented for non-technical people, and clearly detail what they do offer in that regards. Bottom line is that instead of doing even basic research, you just made some assumptions or worse, didn't even think about it at all, and then dove right in. TBH I don't really feel you deserve a refund. Not under the basis of them being shitty or false advertising or whatever. IMO you are at their mercy as far as a refund and they are justified in keeping your money in exchange for the product/service they sold to you. But one thing I have a question about...you said you spent $100 on the silver plan but that looks like their regular price, so where does the coupon discount come into play? Assuming there really is a coupon at play here...did you read the fine print regarding using it? Do the terms of using it state no refunds on use?
-
you don't place that directly in your code. You learn from the principle and apply it to your code. The principle is this: use a variable to act as a counter, that increments every iteration of the loop. Also within your loop, use the modulus operator to check if the current value of your counter variable is divisible by 4 (the number of columns you want). If it is, end the current table row and start a new one.
-
example: echo "<table>"; echo "<tr>"; for ($y = 0; $y < 50; $y++) { echo ($x % 4 == 0) ? "</tr><tr>" : ""; echo "<td>" . $y . "</td>"; $x++; } echo "</tr>"; echo "</table>";
-
I'm not going to fine-tooth comb your code but from eyeballing it, it looks like you are loading each page (pagination) via ajax. So whenever you click on a new page it doesn't reload the whole page (more specifically, the edit click event) so the edit click event never gets added for new stuff. The $('.edit').click(...) code needs to also be called whenever new content is loaded from the pagination. Maybe your paginator plugin has a generic callback function you can place the edit code in, or if not, you will need to hack the plugin itself.
-
okay so there are a couple ways to go about this. One is by making use of eval() as AC has shown. I don't really recommended doing this because it opens up for a lot of potential security issues. eval() executes whatever string you pass it as php code. So the user can enter in php code and eval will execute it. One alternative to setup a condition like so: $c1_op = "+"; $a1_num_user = $_POST['a1_num']; $e1_num_user = $_POST['e3_num']; switch($c1_op) { case '+' : $row_1 = $a1_num_user + $e1_num_user; break; case '-' : $row_1 = $a1_num_user - $e1_num_user; break; // etc... } echo "result: " . $row_1;
-
You mean like this? <form action='file.php' method='post'> <input type='submit' value='run' /> </form> This will cause a new request to be made, same as just clicking on a link, though you now have control over whether or not to send values via post or get method, vs. just get /w a link... or are you talking about having it run but not (re)load the page? You need to use AJAX for that. Simplest way is to use a framework like jQuery. Go to the javascript/ajax forums for help on setting it up.
-
p.p.s - yes, you should be using your getter/setter methods even within your own class. So for instance, if you are passing some values during object instantiation to be set when the object is created, you should be calling the getter/setter methods from within your __construct(). This is also for ensuring that you are setting it w/ correct values/formats. It helps cut down the debug/qa time of development because it helps you track down bugs easier. For example, let's say you set $age directly in your construct but then later on you use it to do something like calculate birth year. PHP will happily accept a string for $age but when your calculate_birthyear() function goes to use it, it will mess up. At best, it might give you an incorrect value. At worst, it will cause a php error that may or may not stop the script. You of course could validate $age and make sure that it is an integer before trying to use it, in the calculate_birthyear() function example, but let's say you have 10 functions that use it - you would have to validate $age in all of them. With the setter method, it's validated in one place, so you don't have to worry about it being the correct value/format in your other functions.
-
p.s. - we like to refer to PHP Object Oriented Programming as POOP
-
__construct() is used to automatically do stuff when an object is instantiated. Setter methods are used to set properties of a class/object. The point of setter methods is to not allow people to directly access object properties. It is used to ensure that they are only set with correct values/formats. For example: class person { var $age; } Let's say you have an $age property for your person object. You expect this to be an integer value in other methods used to do whatever based on age. As it stands in the example above, you can set it to whatever you want (like a string, array, another object, etc...) but that will break your other code that depends on it being an integer. In order to ensure that it will always be an integer, you create a setter method that validates the data before setting it. Basic example: class person { private $age; public function set_age($age) { if (!preg_match('~^[0-9]+$~',$age)) { // not an integer, throw an error/exception or do something else involving screaming at someone instead of setting $age } else { $this->age = $age; } } } If you do it this way, you can ensure that the class is encapsulated. You can ensure that if someone else is using your class, that passing something other than an integer for age will not break other things in your class. If it helps, you can think of it as the same principle as form validation / error handling for a form on a web page.
-
sounds like you are not actually creating an image resource from the image column in your db, and outputting it as an image. You should be selecting the data from the image column in your db and using imagecreatefromstring() with that data to create the image resource and then outputting the image by setting the content type with header() and imagepng() or imagejpeg() or similar (based on what image type your image data is saved as). See the example in the imagecreatefromstring() manual entry.
-
I don't think so... I just changed my avatar to something other random thing and worked okay. If it is telling you the image is too large, the file size is probably too large. What are you trying to use? I don't know what the exact limits are but if it's over 30k then it's probably too large.
-
URGENT - block someone from posting from a remote area
.josh replied to HCProfessionals's topic in PHP Coding Help
oh. I thought you meant urgent as in "oh noes the singularity has happened and my website is being engulfed into an intervoid" urgent. YAWN. -
URGENT - block someone from posting from a remote area
.josh replied to HCProfessionals's topic in PHP Coding Help
You are calling this person your friend? Who do you consider your enemy? -
I don't really know offhand any good reseller hosts / reseller hosting plans. Maybe a good place to start before making your own thread is the Web Host List sticky that lists suggested/recommended hosts. Perhaps people specifically listed reseller features as reasons. Or if nobody specifically mentions your needs in that thread, you can always start your own thread asking about it in the Misc. Forum