Stefano Mtangoo 455 Senior Poster

Hi everyone,

I know this is an old post but ....

Start the New thread then. Let the old one die natural death :)

Stefano Mtangoo 455 Senior Poster

Hi all,

I'm kinda newbie at this. But I was just wondering where are you placing this code? On every page? or just on the main login page, etc? Thanks

Mike

Put it on separate page and include it on every page needed!

Stefano Mtangoo 455 Senior Poster

How do you delete Emails? Do you list Emails with link to delete or one fills address and the form submission does delete?
If you list Emails, add Id to delete link. If you use form, that is easy. Since email is unique it can be used instead of ID!

Stefano Mtangoo 455 Senior Poster


But when i change the ...username = '$username'"); it gives me an empty row.

I always use something like this, and it works!

$sql = "SELECT * FROM users WHERE username='{$username}' AND password='{$password}'";
Stefano Mtangoo 455 Senior Poster

I gues no shortcut,
Learn HTML/CSS-->JS-->PHP-->MySQL and if you want AJAX
Then you can opt to go to frameworks if you want.
Practice is what makes you good programmer. Note, there is security issues, and that is different beast altogether :)

Stefano Mtangoo 455 Senior Poster

Check for loop by huhh7 but testing if the modulo (%) brings zero it is divisible by 10 the do whatever you want, that is

for($i=0; $i<=100; i++){
    if($i%10==0){
        //do whatever it is tenth step
    }
}

Completely untested :)

Stefano Mtangoo 455 Senior Poster

sanitize ALL input data.

It is huge process actually. I plan to do little series on security by the end of this month, God willing (Not expert at all but learning) But here is my suggestion on angles to check:
1. As ardav pointed out, always suspect user - Sanitize and validate ALL external data
2. Secure your session and site against CSRF, XSS and other common attacks
3. Escape all outputs
4. Guard your Database against SQL injection
5. Add DoD, that is in case one thing is compromised (like session variable) then intruder can still be delayed to get in
6. Log all login attempts and if username applies lock after several attempts and alert user with unlock link. If user does not exist, send email to admin.

Actually there are more to that but those are the one I can think for a moment

Stefano Mtangoo 455 Senior Poster

i want to use internet through mobile on my laptop in ubuntu 10.10. is there any software for it?

what kind of phone? Please try the trick and comment there if anything goes wrong so that Others may benefit there!

Stefano Mtangoo 455 Senior Poster

nice share!
that's what i need.

You can comment here or there whatever thing you would like to see whether it be Linux (I use Ubuntu) and Programming (Java, Python, C++ or PHP) or any ranting on techie things. I think after June 27th I will be back and post more stuffs and put more links ;)

Thanks for heads up though :)

Stefano Mtangoo 455 Senior Poster

Thanks everybody. Let me digets the explanations and linked articles.
I will be back in case of question or anything I fail to understand.
Again, thanks a lot :)

Stefano Mtangoo 455 Senior Poster

Read this. It has very good explanation.

Thanks a lot. I'm reading it now:)

EDIT:
It is nut :(, are you kidding?

Stefano Mtangoo 455 Senior Poster

Game programming. Software Development --> Game Development.

Oooops!
Sorry, I didn't knew that was the right forum (don't remember to be there!)
If Mod will help me move it there I'll be grateful :(

Stefano Mtangoo 455 Senior Poster

You can have a look at simplexml
http://php.net/manual/en/book.simplexml.php

Stefano Mtangoo 455 Senior Poster

Order by sorts in ascending order by default, so your code would return the first three, not the last three.

you are right ;)

mysql_query("SELECT * FROM `table` ORDER BY date_Column_Name DESC LIMIT= {$no_days_ago}");

also untested

Stefano Mtangoo 455 Senior Poster

if you want three latest regardless of date you could go with some query like

$no_days_ago = 3; //or take it from a search box
mysql_query("SELECT * FROM `table` ORDER BY date_Column_Name LIMIT= {$no_days_ago}");

Not tested though ;)

Stefano Mtangoo 455 Senior Poster

All resources propose above are great plus PHP 101

Stefano Mtangoo 455 Senior Poster

parse the urls and search for image extensions like jpg, gif, et al

Stefano Mtangoo 455 Senior Poster

session_start(); -->Should be at very top of the file, before anything else. That is the best practice to avoid headers already sent error!
try rectifying this and post any error/warning you get

Stefano Mtangoo 455 Senior Poster

Hi,
I have a question and I apologize if it is too newbish. I have been for a while now trying to learn OpenGL but I cannot understand how its coordinate systems works. I know coordinate geometry as I did some math long ago as well as equations (linear, polynomial et al) which I think are enough to get me started with math of OGL. But I cannot get hold of how OGL maps its coordinates system with respect to the screen of the computer.
Google was of little help on this and any link/Explanation is warmly welcome and appreciated.
Thanks!

Stefano Mtangoo 455 Senior Poster

I recomend you Codelobster PHP Edition.
It's most powerful among free code editors.
Some advantages of this editor are: intellectual autocomplete, FTP,
folding code, navigation with Ctrl for all links and descriptions and
incremental searching
Important feature of this editor is presence of special plugins for
Drupal CMS, Joomla CMS, Smarty template engine, JQuery library, CodeIgniter framework,
CakePHP framework, Facebook social network and WordPress blogging platform.

Also i want to pay your attention to the option Portable
http://www.codelobster.com

Cannot beat Netbeans or Aptana both of which are free!

Stefano Mtangoo 455 Senior Poster

Thanks a lot.
Just another question, is there anyone who has used shoutcast?

Stefano Mtangoo 455 Senior Poster

To make twitter you need to be a girl.

:-O

Stefano Mtangoo 455 Senior Poster

Thanks Friends.
@Chrishea,
I'm looking at the link
@Ardav,
Is it hard to set up?

More explanations: It is going to be public web broadcast, do number of people will depend how popular it will be
Thanks again!

Stefano Mtangoo 455 Senior Poster

I am stupid writer. :)

I don't know of stupid boy who can write what you wrote. You just "slipped" ;)

Stefano Mtangoo 455 Senior Poster

Every programming languages have their own taste and own pretty structures. With my opinion, there is only two options. 1,) Programming for the windows application, 2.) Programming for the web application.

The number 1 is related with software engineering. You can choose many languages such C, C++, C#, Java, and so on. They are primarily pretend to develop the windows (desktop application)..

Why not number two also? When I do PHP/MySQL I use almost all design/techniques I use for desktop apps. May be I'm a bit unprofessional?

Stefano Mtangoo 455 Senior Poster

I would suggest you start with Python, strange mh? Nope! It will teach you good coding style, and basics of programming. Then to do web app you have choice to learn PHP (they are both interpreted so not much PHP specifics to learn) or go for Python frameworks like the famed django. I would say stay away from Java, given your explanation above. It is overkill ;)

Stefano Mtangoo 455 Senior Poster

So I was asked to integrate live webcasting in the next version of this website and I have no Idea. I did little reasearch and bump, I only hit shoutcast.
May I ask anyone with Idea on good webcasting software for live internet Audio and video broadcasts to throw out. Something like Software X (free) software Y (commercial)

Thanks!

Stefano Mtangoo 455 Senior Poster

Thanks budddies, I found HTML purifier filter. Do anyone know how Strong it is? And How to set My editor to produce BBCode? and how do I convert BBCode to HTML so that I can display it in a browser?
Thanks!

Stefano Mtangoo 455 Senior Poster

would you put sample data on table and ask your question based on minimal data? I have not catch well your question!

Stefano Mtangoo 455 Senior Poster

what do you have in hand? memeber Id?

Stefano Mtangoo 455 Senior Poster

I have not understood your question but I think you might need to check table joining, especially inner join. May be explaining what you want to accomplish might help!

Stefano Mtangoo 455 Senior Poster

That is somehow discussed by Chris in his great article:
http://shiflett.org/articles/the-truth-about-sessions

Stefano Mtangoo 455 Senior Poster

So you need to put more explanations.

Stefano Mtangoo 455 Senior Poster

are you PHP developer? You can search each function and get explanations from php manual!

Stefano Mtangoo 455 Senior Poster

Hint:
offer a form with old password, new passowrd and retype password. If old password matched the current db password and new pass and retyped pass match then update db to reflect new password!

Stefano Mtangoo 455 Senior Poster

which line?

Stefano Mtangoo 455 Senior Poster

I changed it to hid. but it is still giving me that error.

I would advice that you learn JS library for all your JS operations. JQuery is on top of my recommendation list!

Stefano Mtangoo 455 Senior Poster

you mean you want to store hashes on user machine? If yes that is bad Idea. Store the hashes in Database and compare with hashes of the password user enters. Also you can think of moving to SHA2 family, particularly SHA512 as SHA1 is no longer what it used to be. Salting, validating and all defenses are out of your current question!

Stefano Mtangoo 455 Senior Poster

Hello,
I was reading web security stuffs and found that user can inject malicious codes mostly JS in forms. Now, What about CKFinder/TinyMCE et al? They obviously produce html and any stripping will destroy the article formatting. bad enough they have a "code mode" where user can enter html directly.
Suppose my system is compromised (which is security thinking), what guards can I put to ensure minimum damage?
Thanks :)

Stefano Mtangoo 455 Senior Poster

Learn AJAX. It will be essential!

Stefano Mtangoo 455 Senior Poster

I'm back...

Welcome back, Davey!

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

My Gosh,when i saw this thread i thought the worst Dani..... (On another site im on we just lost the admin.. (She passed away) and we are all very saddend by this.....)

I am sorry Davey is going thru this but im glad he hasnt left us... (Knock on wood)

Congrats Julienne,i know you will do as good a job as David Did :)


Peace and love to all :)

Last month we thought we had lost Davey as he was going through some tough personal times. Thankfully though, he has announced that he will resume his role and should be back in full force within the coming weeks. During his absence, the role of community admin was placed in the capable hands of Narue, another DaniWeb legend who has been with us since the beginning of time. Happily, once happygeek returns, we'll have two super stars guiding the ship.
DW News Letter
Cheeeerssss!

jingda commented: Cheers to you +0
WASDted commented: Thanks for the kind words. They sure deserve it. +0
Stefano Mtangoo 455 Senior Poster

Thanks Cuonic For Your Help I Will try It

Thanks I Love The Function Thing

Can You Write The Full Function Code For Me Plz

Including The DB Code To Select The Table And Column

It is just a normal connect and query Ops

Stefano Mtangoo 455 Senior Poster

if it is solved, mark it so ;)

Stefano Mtangoo 455 Senior Poster

Hello,
Those errors I am facing when I try to connect with MySQL Administrator GUI(MySQL WorkBench). MySQL server is working. In server, MyphpAdmin is installed and then I installed Mysql server and then Mysql Administrator. MySQL command prompt is working but GUI is not working and when I try to login, I am facing those errors which I attached before.

That have something to do with installation than PHP/MySQL. Just uninstall the whole thing and reinstall it!

Stefano Mtangoo 455 Senior Poster

You want the title stored in your database to appear as the page title if I understood correctly :

<?php

$page = 1; //page ID

//Connect to Server
$title_query = mysql_query("SELECT title FROM table_name WHERE page='$page'");
list($page_title) = mysql_fetch_row($title_query);

?>
<head>
<title><?php echo $page_title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="http://www.e-alriyadh.com/favicon.ico" rel="icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="Style.Css" />

</head>

If he uses this, he have to put it on top of each page. The function thing is easy and reflects any change to all pages it is included!

Stefano Mtangoo 455 Senior Poster

I wonder how you guys understood the question. Am I that dumb?

Stefano Mtangoo 455 Senior Poster

Next time take time to read at least the top of the forum
http://www.daniweb.com/web-development/php/threads/191031

Stefano Mtangoo 455 Senior Poster

You mean scripts pretends intelligence? If so apply captcha and some advanced mechanism of filtering spams. Without your code, those words are enough I guess ;)