ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
The API you're posting to requires a specific content-type, and you are providing the wrong one. CURLOPT_HTTPHEADER is the option you must use to set the proper content type. Also, why is your XML all encoded like this?
-
If you believe that question is self-explanatory then your answer is "err...no...?" If you're asking "is it possible to have conditional code inside a class but outside the functions in that class" then the PHP interpreter itself could have given you that answer: trying to do that produces a fatal error.
-
You have absolutely no idea how to debug a script on your own? What do you do when there's a problem like this? Do you just stare at the screen and pray that you'll see it? I've given you the steps you need to take to start debugging. they were in the list of questions you failed to answer.
-
You must wrap the entire list in a single form tag, only one form can be submitted at a time. If the problem is now "my site looks all weird," then xyph is right, your problem is a style one not a PHP one.
-
How can I publish sports standings on my website?
ManiacDan replied to twebman84's topic in PHP Coding Help
Sports scores are important and valuable information, you cannot get them for free. You'll have to buy them from someone. I believe Yahoo might sell this information. -
Asking "would I use explode" is like asking "how would I climb a mountain, would I use a rope?" Yes, you would...and 5,000 other things. If you want to allow people to select multiples of something, name the checkboxes "selection[]" and put the values as the IDs you want to select. Then $_POST['selection'] will be an array of the items selected. You can loop through them using foreach.
-
Have you done any debugging of this on your own? Anything at all? Have you dumped the contents of $_GET? Have you done a var_dump of any of the variables in the IF statement? Why do you believe you can dump 100 lines of code on a group of strangers and get your answer? Work for yourself and it will happen a lot faster. Also, bumping threads is against the rules. Show the work you've done to debug this on your own and then we'll help you continue to debug.
-
Not really, no. Simply putting quotes around it inside the SQL would have been fine, but working is working.
-
MySQL and PHP are separate languages. Your problem is not in PHP. your problem is that you're building a MySQL string that says: INSERT INTO mytable ( someField ) VALUES ( 19-23 ); That will put -4 into someField. QUOTE YOUR STRING INSIDE THE MySQL QUERY.
-
What exactly is the issue? Your code works fine for me, it matches the whole TD ... /TD space. If you're actually trying to match INSIDE the tags, you need to add the > and < and use parens to make a capture group.
-
Help with putting facebook stream in Special PHP code
ManiacDan replied to davidjmorin's topic in PHP Coding Help
What does the documentation say about this? Why do you believe data-site= is a valid <div> attribute? -
Ok, you need to learn how to communicate a little better. You saw? You tried "some"? What are some? Some of the sorting functions? Why did you try them, and how did you do it? How did you determine they didn't work? What does "work" even mean to you? Did your computer catch fire? Did they come out in the wrong order? Did your monitor go blank? Maybe you can help me with my car while I'm here. It was making the noise, so I tried things, and they didn't work.
-
Put your <form> and </form> tags INSIDE your loop, that will solve your problems.
-
When you have multiple inputs of the same name in a form, only the LAST one will be submitted when you submit the form. You must name your input name='id_zamjena[]', then $_POST['id_zamjena'] will be an ARRAY of these inputs. -Dan
-
Better yet, just use parse_url. Also, your original post was missing the beginning and ending delimiters, which might be why it wasn't working.
-
fopen returns true but there is no file there???
ManiacDan replied to Allenph9's topic in PHP Coding Help
fopen does not return true, ever. It returns either a file handler resource or false. According to my chart here, objects of type resource will never be equal to an integer (which is what you're using instead of true/false). -
Haha seriously. Also, captain necro has been warned twice, third time's a ban^H^H^Hcharm.
-
Drop down list of... days in the current week
ManiacDan replied to leszer's topic in PHP Coding Help
$date = strtotime('-1 saturday'); do { echo date('l F jS, Y', $date) . "\n"; } while ( ($date += (60*60*24)) && $date <= strtotime('next friday') ); -
PHP mail funtion and print email button
ManiacDan replied to raymond_feliciano's topic in PHP Coding Help
I bet their client strips javascript, that's why I said that. They already have a print button, it's right there at the top of their screen. Forcing you to add another one is stupid. Tell them "emails can be printed using the method best appropriate for your email client. As some email clients block such functionality, and some have completely separate printing formats, adding this button would decrease functionality." -
PHP mail funtion and print email button
ManiacDan replied to raymond_feliciano's topic in PHP Coding Help
Are they not capable of printing the email using their email client? ctrl+p will print in every email client and web browser I've ever used. -
Don't suppress warnings, fix them. You were probably trying to process a blank line, which you could skip by adding this to the first line of your loop: if ( trim($var) == '' ) continue;
-
Also, you may be interested in file as well as file_get_contents
-
$total = 0; foreach($out as $var) { $tmp = explode("|", $var); $total += $tmp[count($tmp)-1]; for($i=0;$i<count($tmp);$i++){ echo $tmp[$i] . "<BR>"; } } echo "Grand total: {$total}";
-
I had a guy on devshed once get into a 4 page argument with me and another guy, screaming and calling us names, saying that we were in a gay relationship, telling us he was going to kill us, etc. Real mature stuff (especially for a 70 year old, which he was). When we finally got fed up with the conversation, he went back and edited all of his posts to be reasonable and then quoted-replied against our replies to say that we were crazy. The thread is here if you're interested. It's pretty hilarious to watch arty explode.