Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
<?php for($i=0; $i<=360; $i=$i+1) $d=deg2rad($i); $sin=sin($d); echo "$sin"; ?> You have some things backwards, try that?
-
Does this work: <?='<p>Order processed</p>'?> What about <?php $foo = '<p>Order processed</p>'; print $foo; ?>
-
"it is much easier to build a website that will display right in IE7 than it is with Firefox." Perhaps for some people. I find it easier to code for the standards, and add in hacks for IE. Most pages will look the same in Opera, Firefox and Safari without hacking at it much. Then you have to deal with IE7. As a developer, it's up to you to make it work for everyone, not just the browser you like.
-
See in the example, they use it. You keep saying you want it to print multiple errors, but you don't know how you will pass it those multiple errors. That's not really how error handling works. You have to create each error, or the error gets triggered by the code. As far as I can tell, there is no way to pass multiple errors to the error handler, you have to do each one individually.
-
That is odd. That happens to me sometimes when the file upload gets interrupted. Try saving the file again and accessing it? You did save this as a php page, correct?
-
So instead of calling trigger_error everytime you want an error, put the error messages and the nums into an array, and then when you want to display all these errors, loop through that one and call trigger_error. Otherwise I don't see how you could do what you're saying.
-
Because that function only ever gets ONE number for $errno. I still don't see how you're going to pass it anything but one integer. If you explain how you can get $errno to be an array instead of one int, then we can go from there. But since PHP handles the errors, I don't see it. Using trigger_error, you can still only pass it an INT for the errno. Show me an example of when you create an error that can have more than one error. Perhaps you want to make an array of all your Errnos, then do foreach and trigger the error in that foreach?
-
...Perhaps you should ask the person who wrote that. This seems like one of those pranks seniors pull on freshman, asking them to find an item that doesn't exist, for no reason. If you don't know what they're for, how to use them, anything about them, and googling turns up nothing, it's likely there's no reason you'll need to use them, and are probably wasting your time. lol.
-
see, according to the manual "errno The first parameter, errno, contains the level of the error raised, as an integer. " So $errno will never be an array, and you'll never be able to use foreach on it. Perhaps what you're trying to do is over my head, but I don't see how you're ever going to pass it an array as the first argument,
-
Okay, how about a little more context? How are STI modules related to PHP? Where did you hear about them in the first place?
-
Okay, but you still didn't show me where you call it. You need to pass it an ARRAY for $errno, because whatever your passing it now as the first argument is NOT an array. Try: if(count($errno) > 0){ foreach ($errno as &$errortype){ echo"ERRORFOUND!"; } } PS: Using a reference value in foreach only works in PHP5, IIRC.
-
So you can do that in your query. "SELECT members.*, pictures.* FROM members, pictures WHERE pictures.primary != 'y' AND pictures.active != 'y' AND members.id = pictures.(whatever the memberid is?)";
-
When you call it, what arguments do you pass it: ErrorHandler($errno,$errmsg,$file,$lineno){ You need to pass it an array for $errno.
-
You didn't tell us what the problem is.
-
I don't know how I could explain it when I already wrote it out for you. Just change the table name and row names to yours.
-
What do you think of GoDaddy's hosting service???
Jessica replied to rantsh's topic in Miscellaneous
I like them. Best service, best prices. I had some problems when my traffic got too high, but if that happens, they have upgraded packages. -
It is possible to use syntax like this: "SELECT * FROM table WHERE field > '2007-01-27 23:59:59' AND field < '2007-02-11 23:59:59'"; Just format your strings the same as the mysql datetime field and this should work. Plus what poco said.
-
PHP <option> to $_POST... Not working.....This should be easy...
Jessica replied to cwncool's topic in PHP Coding Help
do print_r($_POST) at the top to see all post vars. Try changing the option to this: <option value="Paypal">Paypal</option> -
mysql_real_escape_string helps prevent SQL injection, it has nothing to do with users. What you have is an example of how it would be used. It should be used on any user input.
-
Try this: (change it to fit your code.) $pictures = array(); $pictures[] = array('image.jpg'=>'description'); $pictures[] = array('image2.jpg'=>'description2'); $pictures[] = array('image3.jpg'=>'description3'); $pictures[] = array('image4.jpg'=>'description4'); $pictures[] = array('image5.jpg'=>'description5'); shuffle($pictures); for($i=0; $i<3; $i++){ print_r($pictures[$i]); }
-
Good catch Andy! A table that big is REALLY a bad idea.
-
Holy Batman, that is an insane table. Change to: $result=mysql_query($query) or die("Query: $query, Error: ".mysql_error()); So you can make sure the values are as you expect.
-
"is there a way in SQL to say "grab all the records that fit this description, then remove all these from it"?" Remove from the table, or just remove from your results?
-
Alexa does this, as do many other reviewing sites, and http://browsershots.org/ I'm not aware of a way to do it in PHP, what browsershots.org does is add it to a list and then they have dedicated machines which automate the screenshots.