premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Have you tried using the full absolute path to the files?
-
The issue is going to lie within your Charset on the page. You need a charset that can handle those characters, which I do not know. But take a look into that.
-
PHP Operators Look at the Modulus Operator For every other row with for example $i as being the incrementer: for ($i=0;$i<10;$i++) { $color='black'; if (($i%2) == 0) { $color = 'red'; } echo 'The color is ' . $color . '<br />'; }
-
Linking directly to that file will do it. If they have adobe, it will display it. If not it prompts them to download it. As far as doing this through php, no. As the page would have to send the headers so the browser knows what is happening. EDIT: You can create the link to the file with php/HTML however
-
[SOLVED] Calling mysqli->prepare fails on second call :-/
premiso replied to BB's topic in PHP Coding Help
Show us the mysql file that starts the mysql connection so we can see that. -
$details = explode("<",$person); Explode may be better for that part, since it does not match patterns. To get the firstname/lastname separated, use explode and explode it by the space.
-
index page cannot be displayed
premiso replied to shadiadiph's topic in PHPFreaks.com Website Feedback
I am not complaining about it Just letting you know. It happens about once a week that I am on from home, usually during peak times. It will cut out on all pages for about 30-60 seconds then it comes back up and works great. I really think it is my end router/modem/isp not the servers. So yea, if you want to research it I can provide trace logs when it happens next. If not I do not think it is a big issue at all with the rarity of it and that this is your first time hearing about it. -
index page cannot be displayed
premiso replied to shadiadiph's topic in PHPFreaks.com Website Feedback
Weird...well my only guess is there is a network node between me (at least) and the server which has issues from time to time. It can happen, and since it does happen regularly and no one else notices it, my bet is that is the case. It could also just be my ISP and how shitty they are. -
index page cannot be displayed
premiso replied to shadiadiph's topic in PHPFreaks.com Website Feedback
It happens to me quite often at home. I think just between my Comcast Internet and the server it is missing a node or that route craps out for a minute or so. Where is this server located? Europe? If so, it is just the distance playing a factor, nothing wrong with the forums -
Debugging is really a guess and check system. There can be certain systematic approaches that help you solve the problem easier, like common sense. Probably at least 80% of the time the problem ends up being something so simple and so small, any type of debugging system out there would have passed it up and you only caught it because you were tired of trying stuff and decided to just look at the code printed on paper. There are certain tactics you can use to debug, such as printing variables, removing certain items from an equation etc. But in the end it all depends on the person and their knowledge/way of thinking. As for me, anytime I have a problem I tend to jump into the common items too fast instead of just stepping back and looking at the code as a whole. Printing it on paper and looking at it that way will generally solve any issues of bad variable names or easily mistaken items like that. If I do not see anything wrong with the code, I move forward and start to test my variable input (if there is any) and making sure the right data is being passed through etc. And I never start to debug on the original copy, I make a backup, or at least a backup of the original (if not using SVN) and go from there. Cause you could find the error in a different file, or it was soo minor you can easily go change the original and not have to remove all your debugging junk. But that is just my methodology and it seems to work pretty well for me. The more you know and the more you code the easier debugging is going to be. Just do not be so quick to jump on the bandwagon as "help me with this error" on forums. Take the time and work through the problem with a system in tact, do the research of the problem if necessary and see if it is a common problem that can easily be solved. 80% of the time you can do it just by making the effort the other 20% chances are it is lack of knowledge and asking for help may lead you down the right path. What you want, these "rules" are not very viable. Depending on where/who you code for they may have their own rules, such as variable naming and commenting on code you create. The naming schemes I love. It keeps you thinking on what the variable should contain and keeps your names consistent. But for a "generic" rule, no. There are so many different ways 1 item can be coded and re-coded and they all work. Just not viable. That is just my 2cents.
-
[SOLVED] Calling mysqli->prepare fails on second call :-/
premiso replied to BB's topic in PHP Coding Help
Well the problem is not in that section. Post more code for us to help you bud. -
You could use a for/while loop instead you know, just extra work. But as for being more efficient, doubtful.
-
array_diff may be what you are looking for.
-
Fatal error: Maximum execution time of 60 seconds exceeded
premiso replied to Roy Barten's topic in PHP Coding Help
You do realize that you have a for ($i inside of a for $i, this i is being reset each time you loop through and thus sending you into an infinite loop. Change the inner $i to something different like $x and this should help, if not solve your problem. -
Unless we are psychotic....errmmm psychic!
-
Notice how no one really replied, after 3 bumps. That should tell you something is wrong. The problem is you are not willing to do ANY leg work or research to fix your own problem you want someone to do it for you. Post in the freelance and offer to pay someone to do it for you or do the research and try it on your own. If you at least tried and some code to show for it, someone might have attempted to help you. Since you have not, the only answer you are going to get is to do it on your own, or pay someone to do it for you. No one will do it for you for free.
-
1st time done PHP and just a little stuck hahah
premiso replied to new2php09's topic in PHP Coding Help
$your_name = $_GET['Name']; $your_phone = $_GET['Phone']; $your_email = $_GET['email']; $your_message = $_GET['Message']; You were missing semi-colons after those statements. Also check the mail as you have "$recopient_emai" which should probably be "$recipient_email". EDIT: For further inquiries please use the tags around posted code. Thanks! -
[SOLVED] Wrong parameter count for mysql_result() - UPDATE MySQL DB
premiso replied to karl_009's topic in PHP Coding Help
mysql_query is what you need to use. As far as your mysql_connect I would highly suggest not using the error suppressor (@) sign. It is not good coding practice, on production you should change "Display Errors" to off instead. -
in_array Running that on the array would tell you...granted if the array still contained that number it would return a "false positive" What is your plan to do with duplicate numbers? Remove them? If so you may want to look at array_unique also array_search or array_diff may be worth while to look at as well.
-
Either escape the slash (\\) or use single quotes as \ is considered an escape character in PHP. EDIT: You should also be able to change it to a / instead \ and it should work.
-
In order to use Mail on a Windows environment you need to use SMTP, and in order to use SMTP you must have a server setup. I would suggest looking into phpGMailer and GMail for a free smtp that allows 100 emails a day to be sent.
-
I am not sure exactly what you want. http://us.php.net/array Look up the array functions. You will notice I would not use foreach for what you want, I would do a while or a for loop honestly and use each with reset etc. Really if that is not what you want, be a bit more descriptive, as I have no clue what that means, and apparently not many other people do either. Restate your questions with an example of how you want the end result to be, and try to be as descriptive as possible. Who knows, doing that may help you solve your own problem. Either way, I would take a look at the different array functions that are available to you and see if those will help you out at all.
-
My 1st PHP OOP site, the performance seems slow.
premiso replied to andygrant's topic in PHP Coding Help
What version of PHP are you working with? Also it could very well be "how" you implemented OOP. Just because you coded it and it works, does not mean you are implementing/using OOP in it's proper manner. OOP Methodology is a completely different line of thinking from traditional programming.