I'm slightly confused, do you mean the boxes on the right, or the left.
No the less, they are standard divs. Maybe post a wire frame of what you want or something?
I'm slightly confused, do you mean the boxes on the right, or the left.
No the less, they are standard divs. Maybe post a wire frame of what you want or something?
I agree this is going to cause serious problems allowing users to be any level they wish!!!! The site will not last more than a week online with that security!!!
As a web developer, you do not need to know about the actual coding of the backend of a website. However you must be fluent in especially jQuery json, it really helps to know back end scripting, such as php and so on.
However the most important aspect is to know all the bugs with each version of each browser compared to the html and css. I can't stress that point the most.
What about some sort of distributed storage system, that uses IP tables to locate and map drives. Going along the samba line.
I don't understand what you want help with?
The first thing to do would to design and build a database, as all this would be ran on top of it. As for a link to something the same, I would not know where to start.
So build the database -> then build user objects / scripts -> then web pages : test it
Then build the voting system on top of this
Firstly your queries don't make sense, because your selecting an admin where there is admin, surely you want to test to see if the user who has just logged in is admin or not. Secondly you need to get the details of the user currently logged in, which you are doing, then admin should be in the information from that result.
Then you would want to use an IF statement to see if admin is '1', if that is the case then use a redirect to the admin page. ELSE redirect to the welcome page
This is the basic idea, not the actual code.
$queryGetUser = "SELECT * FROM usertable WHERE email = '$email' AND password = '$password' " ;
$queryGetUser = mysql_query ( $queryGetUser ) ;
$queryGetUser = mysql_fetch_assoc($queryGetUser)
if ( $userInformation )
{
if ( $userInformation['admin'] )
{
// redirect to admin page;
}
else
{
// redirect to welcome page;
}
}
else
{
// redirect to login page;
}
Hi my problem is that I have a slider that is triggered on an onlick event, on document ready. In all other browsers this works great. However in IE, you click the link and it turns to visited, then click it again and it works. After this it works first time all the time, it only seems to do this on first view of a the page, hence refreshing the page causes the problem again. I am really stuck on this one :(
This is the jQuery:
$(document).ready(function() {
$('#bottomright a').click(function() {
var $left = $('#content .inner2');
$left.animate({
marginLeft: parseInt($left.css('marginLeft'),10) == 0 ?
$left.outerWidth() :
0
});
});
return true;
});
Hi i have made a site and it looks great in FF and Chrome. However it look really bad in IE and some things just do not work. And being not much of a front end developer I am truly stumped.
There are three main problems:
The website is currently hosted on my home machine which here is a link, if you view it in both IE and another browser you will see what I have mentioned above.
I have had alot of trouble with this, and would like some help or even just tips on what to do, as tutorials and google was not able to help me with these problems. While the making …
@simplypixie be me to it :D
This is a repost, could you then close the other post, as that is not out of date as the code has changed?
Please close this post then : http://www.daniweb.com/web-development/php/threads/406083
Thanks
Have you made sure that '/tmp/' exists and your apache has the permissions to write to the folder? Also if your writing the output to an image, the lines after $graph->img->Stream('$fileName');
would not be needed.
At the end of the PHP have this line just to test, <img src='/tmp/imagefile.png'>
Ok that is great to hear, could you please mark the thread as solved, and give rep to the people whom helped. Glad we could help :)
Thanks
Ok the port section check if there is a port variable, so for example.com:80 or something, but checks that if there is a port, then it must be a valid number. The user and password is if your using apache auth through the URL, this just checks that the username and password are in the correct format. While the HOST IP checks that if the hostname is of a valid type or if just an IP is given this follows IP convention.
I would keep all the of the reg in there, I lifted this from my applications, I keep this as a common function, and I find it is good practise, as you might want to support other url's later on.
The reason it is on sperate lines is because its much easier to read, it could all be on one line, all it is doing adding them together to make one large expression. Each line is split into separate sections of the expression.
Also I find you can't overkill validation. But that is my opinion.
Hope this helps :)
I dont have a solution sorry... but put your email input type as email.
<input type="email" name="emailmalling" id="emailmalling"/>
Sorry I don't have a solution atm, will look at it later, however do not change your text input to email like suggested above, this is html5, and this input type is not supported by IE or Safari.
Hi
Yeah this can be really horrible at times!!!!
This is a snippet, I would recommend changing this into a function of some sort, just returning true or false.
$regex = "((https?|ftp)\:\/\/)?"; // SCHEME
$regex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?"; // User and Pass
$regex .= "([a-z0-9-.]*)\.([a-z]{2,3})"; // Host or IP
$regex .= "(\:[0-9]{2,5})?"; // Port
$regex .= "(\/([a-z0-9+\$_-]\.?)+)*\/?"; // Path
$regex .= "(\?[a-z+&\$_.-][a-z0-9;:@&%=+\/\$_.-]*)?"; // GET Query
$regex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?"; // Anchor
$url = 'http://www.domain.dk/seo/friendly/url';
if(preg_match("/^$regex$/", $url))
{
print 'true';
}
well here is an example of an advance four level php application
Database
PHP CMS
PHP Template
HTML Template Renders
To start developing in PHP you need a webserver, a text editor, and some knowledge of html in order to provide controls such as building a form, to submit data to php to insert into a database for example.
What you could do is start little projects yourself, on your home machine, for example little problems at home. I remember when i was smaller, i made little programs to make shopping lists, with favorites all of and so on, little programs can help like that.
I know it might sound silly, but it will teach you about requirements, breaking problems down, programming from the ground up without any guidance, along with testing and optimisation.
you want source code, or do you want to just see one in action?
stultuske is right we would not want to advise you without knowing the points stated
you told us nothing about your course, what you've learned, what (if any) limitations you were given, ..
Would really need to know your discipline, because the project choice can change vastly between Computer Science, Software Engineering and Computer Forensics.
Hi,
I have managed to solve this, it was to do with the apache environment, so had to write rewrite rules. Which first loaded the php environment, then this alled for the templates and so on.
sorry if i am disgusting you plzz dn't mind and help me.
Don't worry we can't all know everything, although it would be nice :)
Here is it briefly:
Well if the user has logged in then they are active? At the time of activating the member login, update the table in the database. Then when they log out they are not active so update the database table to reflect this.
What is it you do not specifically understand? And we can do each step at a time.
If they have to login, then you can store that user in a session. If you want an overview of all the people online, you may want to store that in the database.
What pritaeas means is when you user logs in, then there would be an extra column in your table for your users called for example active. When the user logs in then your log in script will update this field to 1, then when the user logs out it could change it to a 0.
Even better would to be to have another column as well as the above which has an expire time, so when the user logs in it is set to active, and the expire time is set to the same as the death of the cookie. This means that you can have another script that checks this table updating all the statuses of the users who are marked as active however the expire time has passed.
Well that is a bit more detail, but all credit goes to @pritaeas for solution.
Yeah I realise that yOur a student. But you don't seem to grasp the basics. And you should not need help at every step. You should solve problems yourself, the major part of being a programmer is to problem solve. Not to ask for help as soon as your stuck.
Are you talking about DNA HEX or Programming HEX?
Erm just HEX (The number System) dumps of hard drive images, why would I be looking at DNA for computer forensics. Unless synthetic silicon DNA has made leaps in the past year?? :D
begining you test $_POST and if it is accept do what you need for accept and vice versa
This would be the best way to do it.
Is this your code? And do you mean like a javascript thing as you type is searches? Bring back results as you type, I'm confused by what you want?
The errors are all about your mysql connection, there must be something wrong with the connection in your included file at the top. Plus your using Undefined constants, the errors are telling you whats wrong and where the errors are.
But first sort out the connection problems.
Well what you could do, where I am searching for '>' you could turn it to search for '</'. Then use this number for the offset then search again for '>'. Then once you have that then concatenate <!--nextpage--> to the end of that value?
As for loosing the final part of the text, sorry I didn't test for that but it was late lol. What you could do, you could do a stringLenght check on each section of the array as it loops round. Then add this together, to get a total length. Once you have this, then create a new string based on original string, then use the number you have as the start, till the end of the original string. This will give you the remaining part of the text. Then push this into a new element of the array.
Well I hope that helps :)
Working on creating a PHP environment, which hooks up to my own CMS. Then building my own template system, that just uses plain html, but the environment knows what to do with and what data to enter. Its going ok atm :)
Ok first, have you made sure that there is a session_start();
at the top of the script?
If this is the whole script, where is this query your doing, there might be something wrong with that?
On this IF Statement your missing a bracket at the end. It should be:
if ($_SESSION['SESS_rank']==employee.rank("admin"))
Also what is this??? employee.rank("admin")
Also you have extra brackets in your IF/ELSE blocks so this will mess things up. Also I think you need to read the manual on IF control statements, as you have one conditional and all the rest are ELSE, which means that only the first ELSE will ever get triggered. Here is the manual for it PHP.net Surprise!
The next problem is that the code formatting is a mess, I hope your IDE is creating this, if so, then get a new IDE.
Finally.......
I hate to sound negative, but this seems to be on a similar theme
You seem to be programming way above your ability, hence the simple mistakes of control statements. Along with the fact that you only past your problem, saying solve this or debug it for me. You hardly ever seem to provide errors, and all the code snippets you do provide seem to be to make a whole application. I hope your not charging someone for this application.
This should push the result into an image on the web server for later use. One thing to note, you might want to do something more complicated to determine the filename, such as random number or something like that, as this will overwrite the file with the same name.
Once the image of the graph is on your web server you can then use javascript functions to show, hide or do whatever with as it would be a standard image.
$graph = new Graph(400,300);
// ... code to generate a graph ...
// Get the handler to prevent the library from sending the
// image to the browser
$gdImgHandler = $graph->Stroke(_IMG_HANDLER);
// Stroke image to a file and browser
// Default is PNG so use ".png" as suffix
$fileName = "/tmp/imagefile.png";
$graph->img->Stream($fileName);
// Send it back to browser
$graph->img->Headers();
$graph->img->Stream();
Also from your code, I have noticed that your not actually out puting your graph, you need to use the Stream() function in order to display.
All macs have VNC, in the mac work this is called screen sharing. On the windows machine install a VNC client, enter the connection information username and password and so on. Then you will be able to use your mac full screen on your windows computer.
Here is a link to a Windows VNC Client
Have a column in the employee table which say the type of employee they are, for example, doctor, nurse, domestic and so on.
Then when they log in see what type they are and do a switch statement for each on with a header redirect to the page that you want them to go to.
Hi, I am attempting to build a PHP based CMS, and a custom template system, these items I do not believe I would have a problem with. However its about the server environment.
For example
I would want to place instructions in the html code, in the form of html comments, with a php script that runs and creates the data, then inserts it into the html page. However I do not want to do it in the usual smarty or other template ways, which is to have a template file, and a php file that are coupled together, I wish to build an environment.
So going to www.something.com/business/article/11232/myarticle.html
would really start a php script on the server that starts the environment, that I can then use to read the template html is really in the url there.
I believe that this is a rewrite rule of some sort, however all previous attempts of writing them have failed badly :D
I hope I have made sense.
Would anyone be able to offer any advice or generate a rewrite rule, or .conf file? Really any help would be great. Thank You
Well php will store the images on the file system somewhere. If you write your C++ program, you could then use the PHP script to call the C++ program. Then when the C++ program is done, if give back a report of some sort and saves the processed pictures to the same place if unedited, or else where if the images were edited in some way. You can't pass things around using sockets.
If you would like to get into image processing using C++ and php, have a look at imagemagick.
Hmm I would need to see your code, also does JpGraph create a jpeg of the graph on the server? If that is the case, then the src= would just be a path to the created jpeg. If this is the case, then have the graph show in a div, that is hidden by default, the have a button linked to a javascript function that shows the div.
Have you though about using a flash graph generator such as fusion, they are really good, and take XML as the data, along with loads of options to style, only problem they are not free, and of course they are flash which you normally want to avoid.
Hope this helps :)
Where do you want to transfer images from, and where to?
I understand your point of view, but I wasn't referring to start learning programming using Assembly. When I said at the beginning of your career, I meant a first job. Also, I personally think that knowing a little bit about hardware can help become a better programmer.
Oh sorry for miss reading your post, yeah learning hardware can help, importantly memory management.
I have been neck high in HEX and horrible computer forensics :( , can't wait till tomorrow when its over :D
What you really have to ask yourself is what do you want to do, not what the job market says. Take me for example. I'm currently on track for my career of working for government then do PhD and become a lecturer. This dream well lets say path has not changed since I was 14 Years old. Still done loads of web based development, and requirements engineering for other projects that I have no interest in, however as Narue said:
When your belly is empty, you'll do what needs to be done to fill it.
So do what you want to do, and consider anything else to be a fork that runs alongside, giving you experience and adding to your background for you to nail that job you really want.
As for learning what you want to do, Open Source work is great for this, as you do it in your spare time, and help others to normally create great things, if you dont like it then you know that you dont want to do it.
I personally think that low-level programming is the best thing to do when you're at the beginning of your career.
Sorry I would have to disagree there, however I can see where your coming from, I believe as a new programmer, you should learn from the top down, learn about the tools, and different methodologies, learn to see everything as an object and so on. This way as you get further …
thanks.. actually you understand what i want.. can you please explain to me what this code mean??
Ok you have a form, that the user fills in, but if you have not been told or found out the hard way, it is that you can never trust a user :).
When you submit a form it is Posted to you script that handles the data and does what you want with it. So this is the reason for the $_POST[]
with the name of the drop down we make in the form between the brakets, this means that we want this section of the posted data.
Now we know what data we want and where to get it, like I said before we can't trust users, so we want to clean the data up before we place it into the database, this is incase the data has been tampered with. So we use the mysql_real_escape_string ()
passing it the data from $_POST[]
, this will then produce clean data. Then the end result is passed into the variable on the left, remember normally with programming things happen from right to left.
However if this is purely for profiles I would suggest that you follow the guidence of with the following :
If this is the case, you need to change your DB structure to have just one table for profiles.
As the method that your using can cause data redundancy problems later on.
Do you …
All you would have to do is like your doing already, if you have a value that states the users type, then if not admin then echo something with a link. Or if the user account as you are only searching for admin users, then if the user is not found based on the credentials that have been passed to you then have a common redirect. Stating that your login failed, please try again.
Hmm, I don't really understand it however I will have a stab in the dark:
Ok in your search form just create a list to choose from for this example I will call the three programs your on about ( thinking they are like teaching programs) like so :
<select name="programs">
<option value="program1">course 1</option>
<option value="program2">course 2</option>
<option value="program3">course 3</option>
</select>
When this form is posted, to look for their profile or something like that do the following, which is a very simple example, as I do not know your database structure, and I am assuming that your program tables are numbed as the following ('program1','program2','program3') :
$tableName = mysql_real_escape_string ( $_POST['programs'] ) ;
$query = sprintf ( "SELECT * FROM %s WHERE something = 'something' " , $tableName ) ;
The above creates a query that will search a table that was defined by the user. That is all I can help you with considering the amount of information provided. Well I hope it helps :)
Ok the code needs to be tidied up. Instead of using loads of "echo statements", mixed with variables use printf like below. Only use echo for constant strings that you don't want to change. However you should not really mix php with html, or other sorts of design, as it can get really messy and easily break a page.
$result = mysql_query ("SELECT * FROM cal WHERE data = '(2012-01-01)' " ) ;
$events = mysql_num_rows($result) ;
if ( $events )
{
echo "<td class = 'date_has_event'> <div class='events'> <ul> " ;
while ( $row = mysql_fetch_array ( $result ) )
{
printf("<li><span class='title'>%s</span><span class='desc'>%s</span></li>",$row['title'],$row ['event'] ) ;
}
echo " </ul> </div> </td>";
} else {
echo "<td></td>";
}
As for your second question no your not able to do this, however if there was a way to do this, I would not recommend it, as it looks like it could get really messy. You want your code to be as clear as possible incase you need to go back to it in years to come.
Well I hope that this helps. :)
Thats good, could you please mark as solved, and give rep as you feel appropriate.
Oh I'm sorry, I miss read, didn't see the curved brackets. Yeah they don't make sense.