Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. The way they use to do it, is create the functions in php, save all the results as xml.  Pass it to flash's built in xml processor, parse it, cut the information up, use it, package it back as xml, and send it back to php, where you have another xml parser to parse it and do what's necessary.  Called "remote flashing" or "flashing remote" one or the other don't remember which.  In flash there is a function called GetAndLoad() that does all the internal stuff for you, but it doesn't seem to do what he wants.  I need to figure out, does php have something, like passing variables from php, to javascript and back, the same with flash
  2. Very funny:S I meant he is hiring me to do the php functions.  I need to make it to where he can call the php functions in flash.  And them do what they need to do.?
  3. I found out what I needed to find out, I have a quick question.  I am doing something called "flash remoting" in php, but a little different. What is the best method(he knows actionscript, I don't I only know php).  Here is the thing, I am creating the functions in php.  I create them using php, he is wanting to be able to call those functions from directly inside actionscript.  Like if I set up a function to add new users into a database, in the middle of his actionscript programming logic he wants to be able to call the funciton out of nowhere, and for it to work, and do what it's suppose to do, w hat is the best way to get him to be able to do this.???
  4. Here is the database information and functions he asked me to create to give you a better idea of what he wants [quote]Users ·        userID: (key) a unique integer that identifies each user ·        position: an integer that determines the user's position (1 = student, 2 = parent, 3 = tutor, 4 = admin) ·        firstName: user's first name ·        lastName: user's last name ·        login: user's login ·        password: user's password ·        email: user's email address students_tutors: this table assigns a tutor to each student ·        studentID:  userID of the student ·        tutorID: userID of the tutor Assignments: ·        assignmentID:  (key) a unique integer that identifies each homework assignment ·        studentID:  the userID of the student to whom the assignment was assigned ·        tutorID:  the userID of the tutor who assigned the assignment ·        assignmentDate: the date and time when the tutor assigned the homework ·        dueDate:  the date and time when the assignment is due ·        complete:  a Boolean to keep track of whether the assignment has been completed ·        score: (null until the student submits the assignment) Problems: ·        problemID:  (key) a unique integer that identifies each problem ·        subjectID:  an integer that represents the subject (1 = math, 2 = reading, 3 = writing) ·        answer:  the correct answer to the problem ·        difficulty:  and integer representing the difficulty of the problem (0-9) assignments_problems:  this table associates each assignment with multiple problems ·        assignmentID: The assignmentID of the assignment in which the problem is being included ·        problemID:  The problemID of the problem that is being included in the assignment ·        order:  and integer that represents the position of the problem within the assignment ·        answerChosen: the answer that the student chooses (remains null until the student submits the completed assignment) keywords: ·        keywordID: (key) a unique integer that identifies each of the keywords that will be used to classify (and search for) the problems. ·        Keyword: the actual keywords that will appear in the search strings Problems_keywords: ·        problemID: a problemID from the problems table ·        keywordID: a keywordID from the keywords table Below are the functions that I need written in php so I can call them from flash.  I've included the parameters that I'd like them to take, the actions they need to perform, and the data they need to return. getMatchingProblems( ) I think this is going to be the most complicated of the functions.  The idea is to get a ranked list of problems (like search results from a search engine).  Ideally, the ranking would be based on how many of the keywords in the search string (passed as a perameter) match keywords associated with each problem.  The more matches – the higher the ranking. Parameters ·        Some standard search string (like you would enter into a search engine) ·        SubjectID (must match the SubjectID of a problem for the problem to be included in the results) ·        A minimum problem difficulty level (an integer 0-9) ·        A maximum problem difficulty level (an integer 0-9) ·        A boolean that would indicate whether or not to include problems in the results that have already been assigned to the student on a previous homework assignment. ·        A userID number so the Boolean above references the correct student ·        The number of results to return (an integer) Ideally, the function could return a multidimensional array as follows: [ 0 ][0] = problemID [ 0 ][1] = section [ 0 ][2] = difficulty [ 0 ][3] = been used? [ 0 ][4][0] = first keyword [ 0 ][4][1] = second keyword …etc. [ 1 ][0] = problemID (of the next problem) … newAssignment( ) Parameters: Student's user id Tutor's user id timeAllowed:Integer (I'll pass it minutes) problemIdNumbers:Array (I'll pass an array of all the problemID numbers in the order I want them) due date Function: Record all the information in the database Returns: Something to tell me that the assignment was successfully recorded getAssignment( ) Parameters: assignmentID Returns an Array: [0][0] = first problemID [0][1] = second problemID… [1] = time allowed [2] = assignment date [3] = due date getAssignments( ) Parameters: studentID Returns an Array: [0][0] = assignmentID [0][1] = assignmentDate [0][3] = due date [0][4] = Is Completed? (Boolean) [0][5] = Number answered correctly (0 if not completed yet) [0][6] = total number of problems [0][7] = time allowed …. [1][0] = assignmentID submitAssignment(  ) Parameters: assignmentID array of students answers (any unanswered question will be null) Function: Record the students answers in the database Record the students score in the database Return and array: [0] = result of the first problem (1 if answered correctly, 0 if answered incorrectly, null if not answered) [1] = result of the second problem… newUser( ) Parameters: login password position first name last name email address Function: Adds the user to the users table Returns: The user's userID number if the user was added correctly False if the user was not added correctly verifyUser( ) Parameters: Login password Returns: The user's userID if the login and pw are correct False if they aren't correct getUser( ) Parameters: userID Returns: [0] first name [1] last name [2] position [3] email[/quote]
  5. Ok this isn't really a question necessarily, well sort of, it's more of a preporatory discussion to help me make sure I am on the right track.  I ran across a client, who needed something done, I wasn't sure what all it entailed, so I priced him up to around 615.00 actually for just 7 custom created php functions.  The functions themselves are no big deal, in fact with my current level they are easy.  Just some basic user authentification, and some other simple stuff, not that big of a deal, not that hard.  There is only one that concerns me, it'll require putting forth quite a good chunk of programming logic behind the code to make it do what he is wanting.  As far as what he's wanting, let me give you some foreground information before I ask what I was going to ask.  Here are the functions he asked me to create, all pretty simple except for one. By the way I have full server, and database access, and permission to change the database some if I find it necessary.  This will all be pretty simple. Well actually I can't get my damn email open for some reason so I won't be able to post the functions he wanted.  But obviously there all basic functions, like he wanted a user authentification.  He said something about he's not using sessions or cookies, so I am just  pulling it from the database, and checking to make sure the username and password are correct, some basic stuff.  he had a lot of ones based on logic, like he is a tutor, so it's going ot have a lot of classroom related stuff, some of it simple, some of it advanced calculations, but I Doubt anythign I couldn't handle as far as creating, and preparing the functions.  It doesn't seem like anything advanced, but some are based on heavy stuff, like an integer, 1-3 based on the type which is math, english or science, or something, then an integer 1-3 for problems 1 for correct, 2 for incorrect, and 3 for something, and at the end it tallies result's it's all pretty deep programming, when I get to the deeper programs.  I have until like friday of this week or monday of next to get all of htis done, so the timeline isn't exactly heavenly.  As for the part that I am afraid of, that I am wondering about is, he is using flash for the site.  He is a programmer like me, he is good in flash/actionscript, I know little to nothing about it "yet", and he is beginner with php it seems at best.  Now this is where I have to ask some questions.  The thing he is wanting to use is called PHPObject [url=http://ghostwire.com/go/28]http://ghostwire.com/go/28[/url] That is the website, and I don't know how well it's going to go, i have been looking at it, it seems I just need to create these functions in php, to return the results or the results as an array so he can handle, and do whatever with the data in flash.  Now am I heading down the right track I create these functions like normal php functions, and save them all in a file, then he should be able to do the rest, or do I have to keep something else in mind, or do I have to use classes, or objects or what, I am a little confused on where to go, if it was just functions I could just jump on it and get it started.  I just don't understand how I can help him get it to work with this phpObject or whatever, is this phpObject something I could do myself without a problem, I normally do everything from scratch, or will my lack of knowledge in flash keep me from achieving this??
  6. And it looks very similiar to a template I was looking at awhile back from OSWD,org there is nothing wrong with using templates but as someone told me on this site, atleast give credit were credit is due.  With me being such a fan of clean code, and clean css, even though I normally use a template to do my sites, I ALWAYS rewrite the html/css code so it looks a lot neater, and you really should remove all the warnings, and errors from the CSS.  That alone would give the site a better feel.
  7. perfect, it'll be a little while before I overhall the site again, when I do, I will be correcting a lot of these issues, and ask here again for more advice, I will fix everything that was brought up here when I have enough time to work on it again.  Thanks
  8. I said to hell with it, it worked,  then a few months later it stops working.  Server's were changes, so I got tired of it, I learnt a few new techniques about setting the domain name so I set that up this time, and changed that around and it works.  I think the php max int has something to do with the way php.ini is set, with that being the case, It is not something that is very safe.  ESPECIALLY if you are trying to write code that can go from server to server.  I have to figure out something. [code]$expire = time() + (1000000*30); setcookie("username", $username, $expire, "/administration/", ".funnyemailforwards.com",); setcookie("password", $password, $expire, "/administration/", ".funnyemailforwards.com",);[/code] Actually you can even take that 1 million mark and change that to 2-5 million or somethign I am unsure how much time that is, but it'll probably last quite a bit of the average humans lifespan, it's a simpler way to do it.
  9. setcookie("username", $username, PHP_INT_MAX); setcookie("password", $password, PHP_INT_MAX); those are returning errors and they were not before.  I am using cookies instead of sessions for 2 reasons, it's simply for 1 persons admin page, he wanted cookies, and i don't have php.ini access.  It use to accept that last parameter, to make it a permanent cookie, but now it's not.
  10. I am not trying to disable it from running necessarily, well I am, but I can't break the code.  I want a universal way to do it, are there any xhtml, or php tags to do it.  FOr instance, if you go to w3schools, they ahve tutorials in every language, ado, php, asp, javascritp, xhtml, xml.  For those languages they always have code snippets, and code examples, showing what the code looks like behind the scenes, what tags do they use to do that??
  11. I don't think xhtml has the potential to do this, but I was thinking php might.
  12. It didn't work, it still runs the script.  I mean like if I wanted to write a tutorial for javascript, ajax, php, sql, mysql, or something like asp, or even jsp, or xhtml, or something, I would want to be able to display the code. Like on php freaks if you put in code block it preserves the code for php, and xhtml language, without running it, like a way to show an example like [code]<?php echo "Hello World!"; ?>[/code] instead of outputing hello world, it says the actual code, I need a way to do this with any language, but I can't figure out anything.
  13. I need some very quick help.  I need to just figure out how to make text show, no matter what language.  It hink this is xhtml.  I want to be able to display code in a browser, no matter what language, asp, jsp, html, php, javascript, whatever TO where when I write tutorials I can have code examples, and I want the code to print out to the screen without actually parsing, or running.  Advice anybody? The reason I posted it in php, because I couldn't find anything relating to xhtml, that could do this, in php there is something called highlight so an entire page displays, but I don't know how to get code to display to the browser wherever I need for example code purposes.  I also may need to do this with asp, javascript or whatever else, and if I can find one way to output whatever to the browser, and ignoring it as a language it would be helpful.
  14. Is there a maximum amount of seconds you can set that too though?
  15. ahh good idea, 1 year, I will do that, it's not for all users however only me, I will be the only one to ever login, it's just admin on my own site.  but 1 year, would be great, thanks, by the way for informational purposes, if you ever need to figure out how long, put down 1 year in second or 10 hours in seconds or something similar into google, and it calculates it for you. The same with definitions define: word and other stuff, you can also calculate distances a little bit, if there not too far apart.
  16. I also found this [code]session.cookie_lifetime integer session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed." Defaults to 0. See also session_get_cookie_params() and session_set_cookie_params(). [/code] That was from php.net. When that parameter is set to 0 A cookie is sent to the browser, and it passes the session id, using that cookie, when the browser is closed, then it destroyes the cookie, but it is indeed a cookie.  THen if you set the maxlifetime up to say an hour, it sends a cookie for one hour, the cookie is deleted after 1 hour, even if they are in the middle of something, I picked 4 hours as a decent range, but I am looking around to see if there is a permanent mode, to keep the cookie permanently active, passing it something other than a number.
  17. INSERT INTO table (field) VALUES ($value) WHERE $value1 NOT IN ($old)); after old you have an extra ) that doesn't seem to be needed, and I am not familiar with using NOT IN, but either way that ) at the very end should be removed.
  18. There is a way to prevent it from sending a cookie, but you have to set the session id's in  your url's and that by what I read is a security flaw, and is open to an easier form of attack.  when you set it to cookies(it's like that by default), then it automatically, pulls the session id from the cookie each visit, and invisibly strings the session id in the url, where you can't see it with your normal eye.
  19. [code]As the session is automatically destoryed when the user closes the browser, with or without a session.cookie_lifetime.[/code] That might sound logical, but run this test.  Set the area of php.ini I told you to 14400 That is 4 hours. Now create your login page, your session calls set like $_SESSION['username'] = $username or however you run your sessions, just create a regular login page.  Don't touch your ini file, close the browser, come back and you are logged out.  Now, go into your php.ini and change that line of code I showed above to 14400, which as I said was 4 hours.  Now go and upload it, go back to your site, login, and close the browser.  Come back and you are still logged in, for a time period of 4 hours, period, it uses a cookie, even when you have it to 0, it still set's  a cookie, with a session id on your server, unless you do custom session handling.  I can make a cookie stay for 4 hours, I can make one stay for 8, 16 42 hours, if I calculated the amount of itme, but I wanted to check to see if there was some text that makes it permanent.
  20. That's what I dislike, I moved it from 0 to the number I showed to give it a 4 hours time period.  I want it to stay active forever though, meaning not just 4 hours, not just 6 hours, but indefinitely.
  21. You are starting off getting bad habits, it's ALWAYS safer to run your query's through a variable, and allows for easier changes and error handling. Learning sql this way is good but you will NEVER have a purpose to use something like this in a live application, creating tables on the fly in an application can be dangerous, and after awhile you get enough tables it starts to kill the database.  If you are wanting to learn sql syntax, use a program, so it can tell you where your syntax errors are located when you are in sql prompt.
  22. This is still primarily a php question.  Php has it's power, it does what it does, it has it's limits but it can do quite a bit, is ruby on rails something I could use WITH php or something that would REPLACE php.  I am always out to possibly learn new languages, but I still don't need to learn anything that will replace something I already use unless it's better, I don't think ruby on rails is a server side language.  I am just wondering how can I use ruby on rails with php, what can it do that php can't
  23. [quote]http://hitech.lead2gold.org/community/[/quote] also you could skin that page to look almost exactly like the rest of your site, that shouldn't take you too long either, just another suggestion.
  24. My advice, you may not believe me, but it would be simple to remove all those warnings too, without even affecting your site, just set the background as whatever you have the background on the rest.  I make it a habit to try and remove all warnings, after you do it on like 2 sites, or 3 you start to realize it's almost always caused by colors without background colors or vice versa, and that is very simple to fix, it would look a LOT better when it comes up saying NO errors OR warnings found. THat is perfect css, and it's not that hard to get it, it'll just take you 10 minutes.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.