ShawnCplus 456 Code Monkey Team Colleague

responSe, not responCe

ShawnCplus 456 Code Monkey Team Colleague

Video tutorials:

http://net.tutsplus.com/videos/screencasts/diving-into-php/

But I am surprised at the no-bashing in this thread; usually, someone would have posted a venomous "go do your own searching on google" message by now... :puzzled:

There's no bashing because it was 5 YEARS AGO!!!!!!! It was a simpler time when people rarely bumped half-decade old threads

ShawnCplus 456 Code Monkey Team Colleague

the onclick doesn't work because your onclick attribute and your confirm() function are both usiing '', the they have to uses different delimiters

ShawnCplus 456 Code Monkey Team Colleague

They're pretty easy to make, I made one a long time ago that I called "The Oracle". I didn't add as many edge cases and it didn't use a database but it was fun nonetheless

ShawnCplus 456 Code Monkey Team Colleague

but dear i know all these thing but i cant have not good concept and logic u can telll me how i can creat good logic or what is the prob y i cant creat logic is it main dulness or any other thing

If you knew those things then you would understand the logic. So read them over again, write some things yourself, test it out.

ShawnCplus 456 Code Monkey Team Colleague

i did try but sql was mainly involved from what i could gather


anyone else with anything constructive please do reply

Then you're looking at the wrong things. Take a look at w3schools.com, read the tutorials for PHP

ShawnCplus 456 Code Monkey Team Colleague

http://lmgtfy.com/?q=php+mail+form
Really, google is your friend, use it, learn it, get to know it.

ShawnCplus 456 Code Monkey Team Colleague

I personally like Symfony http://symfony-project.org. Open source, free, MIT licensed, huge community behind it and some of the best documentation of any framework available.

ShawnCplus 456 Code Monkey Team Colleague

when time is echoed what format is used?

I usually use date as I can specify the format I wish to use?

time() returns the unix timestamp, you have to use strftime to convert it to a human readable date

ShawnCplus 456 Code Monkey Team Colleague

Yeah... you can't do that. It's up to the user. You can't and will never be able to have direct interaction with the user's filesystem outside of creating cookies.

All you can do is check AFTER they submit the form to see if you got any errors during upload.

ShawnCplus 456 Code Monkey Team Colleague

2. Why don't you translate it yourself.

Well, that's obvious, she's says it's very simple. It is obviously below her to solve such a simple problem.

ShawnCplus 456 Code Monkey Team Colleague
#define DEBUG 1 // on
//#define DEBUG 1 // off
ShawnCplus 456 Code Monkey Team Colleague

is that the ans of my question?

Yes, turn that in, quick, before it gets deleted!

Salem commented: ROFL - There's more than a passing chance they might :) +33
ShawnCplus 456 Code Monkey Team Colleague

Firstly, don't put this inside a loop

$sql = "SHOW COLUMNS FROM $dbname.dealerPrice";
$result = mysql_query($sql);

That's going to be the same for each iteration of the loop so you're wasting database time. Do it above the loop and store the result in an array.

Secondly, don't use value1 as a variable name, pick something meaningful.

Thirdly, I have no idea what your 2 inner loops are trying to do and you're tossing arround array_push like there's no tomorrow, []= exists for a reason.

ShawnCplus 456 Code Monkey Team Colleague

I have no idea, show me your code.

ShawnCplus 456 Code Monkey Team Colleague

You can put anything you want in the email. And you wouldn't need a SQL table unless you're storing information in some way.

ShawnCplus 456 Code Monkey Team Colleague

Why don't you just use thickbox?

ShawnCplus 456 Code Monkey Team Colleague

Try searching for pagination. If you can't find it with that then you aren't looking hard enough.

ShawnCplus 456 Code Monkey Team Colleague

This is what Console.log is telling me:

Object length=0 prevObject=Object context=document       <-- votes_count
Object length=0 prevObject=Object context=document       <-- vote_bottons

I don't know how to interpret that..

length=0 means it isn't returning an element. Right click on each of those, if it doesn't have "Inspect in HTML Tab" then the element doesn't exist in the dom, make sure you actually have something in the HTML that would match "#votes_count"+the_id

ShawnCplus 456 Code Monkey Team Colleague

Make sure that $("span#votes_count"+the_id) and $("span#votes_buttons"+the_id) are actually returning elements by using console.log from FireBug

// in your success function
console.log($("span#votes_count"+the_id));// do the same for votes_buttons

As a side note, you don't have to specify span in front of the #. An ID is supposed to be absolutely unique, there should never be more than one so having extra identifiers is unnecessary.

ShawnCplus 456 Code Monkey Team Colleague

If that's the case then it means your success function is failing somehow. Do an alert() at the top of the success function to make sure its being called and do any other debugging you see fit to make sure that the actions in that function are actually happening

ShawnCplus 456 Code Monkey Team Colleague

Parse error: syntax error, unexpected T_VARIABLE, expecting ']' in /home/bluetek/public_html/dac/main.php on line 30

Line 30 is this part:

// This will echo out all the links to the downloads
28  
$count = 1;
29
while( $row = mysql_fetch_array( ) ) {
30
if( $row[file$count] == 1 ) }
31
$file_dets = fetch("SELECT * FROM `files` WHERE `file_id` = '$count'");
echo '<a href="'.$file_dets['file_src'].'" target="_blank">'.$file_dets['file_name'].'</a><br />';
}
$count++;
}
echo '<br/ >';
echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
echo "[<a href=\"process.php\">Logout</a>]";

thus this line

if( $row[file$count] == 1 ) }

... ... ... then fix it, you can see where the error is . file$count is not a valid variable

ShawnCplus 456 Code Monkey Team Colleague

Make sure you check the Net tab and you're not getting any 404s. If that's not the case then in the Console tab check to see what the AJAX call is actually returning by looking at the Response sub-tab on the Request once its sent

ShawnCplus 456 Code Monkey Team Colleague

It is better to fix the deficiencies in your code, rather than trying to make separate CSS sheets for different browsers:

1. Validate your html/xhtml with the W3C validator. Repair all code that does not validate. Bad code throws each browser into its quirks mode. Quirks mode causes widely varying renderings.

2. Watch making objects not fit. If the browser can't render the page as written because objects do not fit in the available space, different browsers do different things to make adjustments needed to render the page.

For example, if two images are too big to fit side by side, IE causes the last image to drop below the other one. Firefox causes one image to cover part of the other one.

3. IE renders certain objects differently than other browsers. For this reason, it is not a good idea to put size styles (width and height) and surrounding styles (margin, border, padding) in the same style or on the same tag.

To fix this, nest two tags, one with the size styles, and the other with the surrounding styles.

4. IE has tiny differences in rendering (compared with other browsers) that can make the design fall apart. To avoid this, never make the fit so tight that a few extra pixels prevents the fit.

5. Don't use pixels to define sizes. Use percentages to lay out pages, and ems to adjust sizes around text.

6. Make your design flexible. Different computers, different browsers, and different toolbar selections leave …

ShawnCplus 456 Code Monkey Team Colleague

If you're using Firefox get Firebug and see if you're getting any errors

ShawnCplus 456 Code Monkey Team Colleague

Try using absolute paths(start with /, as opposed to relative that use ../)

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

My guess is that the inner query is supposed to be querying the uservotes table, not the entries table. Also, you're using mysql_fetch_assoc on $r instead of $s. Don't use one letter variables, they are hard to follow and keep track of, as is obvious in this case.

ShawnCplus 456 Code Monkey Team Colleague

Visit both sites and look at the Developer or API links, they'll explain (if available) how to use their API

ShawnCplus 456 Code Monkey Team Colleague

It's usually better to add/remove CSS files for specific browsers using HTML conditions like so

<link rel="stylesheet" type="text/css" href="somestyle.css" />
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="ie7specific.css" />
<![endif]-->
ShawnCplus 456 Code Monkey Team Colleague

Don't do that, there's a built-in PHP function. array_keys($array, "search_key") , that returns an array containing the indices for the searc_key

ShawnCplus 456 Code Monkey Team Colleague

If he wants the access database to send out forgotten credentials that tells me that you're storing passwords in plain text. That's a huge no-no. You should MD5 the passwords and have the only recovery method as resetting the password OR use reversible encryption which is more difficult.

ShawnCplus 456 Code Monkey Team Colleague

Did you call php_info() to see if your extension was loaded or not?

ShawnCplus 456 Code Monkey Team Colleague

I was treading on a thin line for a while with the PHP forum but I have finally gone and lost all hope for this forum that I've called home for 4 years. And it only took 7 simple words for me to lose hope completely.

and what do you mean by debugging?

From: http://www.daniweb.com/forums/thread195134.html

ShawnCplus 456 Code Monkey Team Colleague

a:link, a:visited, a:active { text-decoration: none} Should be outside of the body{} block. Move it, that should fix it.

Same goes for .mainrow near the bottom. You can't nest CSS selectors like that.

ShawnCplus 456 Code Monkey Team Colleague

Like I said, start with making sure your variables are what you think they are (using print_r or var_dump)

ShawnCplus 456 Code Monkey Team Colleague

Did you seriously just ask that? Debugging, as in making sure your variables are what you think they are, making sure you haven't done anything dumb like missing a semicolon (haven't in this case) or used = instead of == in a condition, that's debugging in a nutshell. http://php.net/var_dump, http://php.net/print_r. This is not a Daniweb specific thing, this is a programming thing, get to know it well. That is, of course, unless you just copied and pasted code and have no intention of learning how to program and just want the script to work.

ShawnCplus 456 Code Monkey Team Colleague

A) what is this function doing getAllTOTALByTeam($TeamID); B) This is obviously not all of your code, you're using arrays that have clearly been defined before but you're just giving us a snippet.
C) Use uasort
D) No, I'm not going to help you/show you/give you code on how to use uasort, use the documentation

ShawnCplus 456 Code Monkey Team Colleague

Don't bump your posts like that, it's annoying. Where is $_SESSION being set and did you make sure that they are in fact equal, there are some debugging steps you can do yourself before you go to a forum, and if you have tried to debug it yourself what steps have you tried?

ShawnCplus 456 Code Monkey Team Colleague

What exactly isn't working in safari/chrome (specifically what part of the CSS isn't working)? The PHP has nothing to do with it I can tell you that.

ShawnCplus 456 Code Monkey Team Colleague

HAHA, fire the developer, there's your feedback. Stylesheets promote a centralized design(reusability, consistency, etc.) They save time, are (most of the time) completely cross-browser compatible(you'll learn to hate IE6)

itsjareds commented: Hahah. +1
ShawnCplus 456 Code Monkey Team Colleague

What is the msort function supposed to do, frankly I can't tell.

ShawnCplus 456 Code Monkey Team Colleague

y should be in quotes, it's a string

ShawnCplus 456 Code Monkey Team Colleague

Why are you putting your message text directly in the header and leaving the message argument blank? http://php.net/mail

ShawnCplus 456 Code Monkey Team Colleague

Arrays start from zero. Unlike counting t ten etc. :P
(Only example I could conjour up)

With preg_match array index 0 is the entire string that was matched, the rest are the matching groups.

ShawnCplus 456 Code Monkey Team Colleague

No, it means that args doesn't contain what you think it contains so print_r the array and check to see what's in it.

ShawnCplus 456 Code Monkey Team Colleague

Hei ShawnCplus,

After changing $args[2] to intval($args[2]) it is showing an error. as follows :

That means you're passing it an empty host and port 0. So print_r your args array and make sure there's stuff actually in there.

ShawnCplus 456 Code Monkey Team Colleague

Try using intval($args[2]) instead of just $args[2]

ShawnCplus 456 Code Monkey Team Colleague

guys i know about 3 architecture.

i m using smarty in my projects to keep presentation logic different from application logic. but that is 2 tier-architecture.

now i want to do work on 3 tier architecture without frameworks?

can we achieve this if yes? then how?

pls give a little example.

no, you haven't showed the least bit of initiative to find answers on your own. So, no. I'm not going to give you an example.

ShawnCplus 456 Code Monkey Team Colleague

I think he has his homework done for him now :D
Business logic would be, PHP or something?

Business logic just means any logic about how the program runs like when/how something should be updated in the database, etc. (Yes, PHP)

OmniX commented: Thanks for the school lession, MR C! +3