Jump to content

ckrudelux

Members
  • Posts

    565
  • Joined

  • Last visited

Everything posted by ckrudelux

  1. ckrudelux

    printf function?

    I thought so too in the beginning but just look at the examples supplied on the page. If you have a function you don't know what it does just write php.net/functionnameexample:php.net/printf
  2. It could be what IE doesn't allow files which are local to the computer too be reached. So putting them on a server would probably solve the problem.
  3. You could use rgbabackground: rgba(0,0,0,0.5);
  4. Would be wonderful if someone know how MS Access works I got some problems with open form with a filter.So far I only created a button and in the wizard I you could chose to filter from the current table row in the form to what rows to display in the new form. Does not work I get all results anyway.. What struck me as hard in this program is what everything is wizards.. so I have no idea how to change things manually. I have done some searches but end up with wizards what doesn't do the job. If I could chose I would just do this with mysql and php.. but not an option for this task.
  5. ckrudelux

    searchform.php?

    What doesn't tell us more then your first post. Could you be more specific on what you need help with? Continuing on my guess from before: Then making a from in HTML you have a action attribute action should be pointing at searchform.phpThe data from the form is collected in the searchform.php with the $_GET and $_POST variables. Where the index key is the name of the input field in your html. example:<input type="text" name="searchquery" /> $_GET['searchquery']
  6. ckrudelux

    searchform.php?

    Based on the file name you chose, I would guess you want to use it then getting specific data from the database based on the query given from the search box. But really if you don't know what you want to do with the file you created why create it at all?
  7. I guess this is a matter of taste but I would say that this makes the code harder to read. Using the {} makes it better but still messy. $mainNameLine = "$username $maidenname $lastname"; Why? Well then you start mixing other content in this string the variables gets harder to find by using the concatenate you make a clear mark on there data is located. Example: "Hello $username nice to see you again, you have $numMessages messages in you inbox latest one from $from do you want to view it?" "Hello ". $username ." nice to see you again, you have ". $numMessages ." messages in you inbox latest one from ". $from ." do you want to view it?" In the case of the this particular operation you are right in that your use case is more readable but in longer more complected once I prefer the one I used like the one in the example.
  8. To start with you can't use end of line like this. Should be like this.$mainNameLine = $username . $maidenname . $lastname; Also you maybe want some space between them? $mainNameLine = $username ." ". $maidenname ." ". $lastname; This is how you could add everything to one variable: //If firstname is not null set firstname else set usernameif($firstname)$mainNameLine = $firstname;else$mainNameLine = $username; //If maidenname is not null add maidennameif($maidenname)$mainNameLine .= " ".$maidenname; //If lastname is not null add lastnameif($lastname)$mainNameLine .= " ".$lastname; //If firstname is not null add usernameif($firstname)$mainNameLine .= " (".$username.")"; " .= " adds to the current value while " = " set the value.
  9. Great um.. I think we got off topic and I think I got what I needed anyway.
  10. Yes I know it's strict which one of the reasons I'm starting to like it more then php... I like the idea to predefine type like int, char, string and array to my functions and variables. So how do I get the list of the standard libraries?
  11. It wasn't a direct question this was more like multiple statements of thoughts and I appreciate the answer you gave. So a question to your answer, in c++ the includes you do in the beginning are to libraries? but as you said is that something I need to add to the compiler and the include just points to which components I used in the script?
  12. I don't want you to tell me what I should do it's just what I'm trying to get an idea of what it would be like. Some times I think I just put too much pressure on my self thinking I need too know more before I can get out there. I guess I'm looking for some indication what I have the skills to do this kind of work. I know I have to look into TDD. I have write and read about c++ and java which both are quite easy to understand except I get stuck at what libraries I should include or not include and why (it's like magic). I have a project coming up where I'm going to write a site for a company what delivers educations on human communication styles. They have an old page already and haven't had the time or the money to update it (quite dead atm) so I have quite a lot of room to maneuver since time isn't much of a concern. Might put it up here as a blog build, could be fun for the members on this forum and I maybe learn something. I just have something to do before I can start the project. Sounds like a plan at least in some direction
  13. User log in was an example, I just have second thoughts about what I should do with my programming skills. Like what I'm heading for if I started working with it or if I should do something else?
  14. Ofc but what type of programming task like improve the code for user log in.
  15. From what I can tell you have nested your loops this will result in an error. They need to be separated for it to work.
  16. What would typical task be then working on a company as a php programmer?
  17. ckrudelux

    parent::

    Hm.. didn't see that in my example, have an other larger code with this problem but I thought I would save you the trouble of looking it through. But then I got it confirmed what miss type was the problem, and yes it was the same in the real deal but damn hard to see what it was... cause this miss type was caused of not using the uppercase in the beginning of the property name. Thanks anyway
  18. ckrudelux

    parent::

    <?phpclass test { private $messages = array(); public function addMessage($message){ $this->message[] = $message; } public function getMessages(){ return $this->messages; } } class test2 extends test{ public function getMessages(){ $this->addMessage("Last message."); return parent::getMessages(); }} $test2 = new test2();$test2->addMessage("Hello World");print_r($test2->getMessages()); In my world of understanding this should return an array with 2 entries but I get an empty array back, anyone know what's wrong? What the code does is what class test2 overwrites getMessages and adds a message and calls back to the parent method to do the original script of the function. odd is this work: class test2 extends test{ public function getMessages(){ $this->addMessage("Last message."); return $this->messages; }}
  19. Study,Study,Study,Study,Study...

  20. Study,Study,Study,Study,Study...

  21. Should look more into SQL query.

  22. ckrudelux

    PHP Tutorial

    This was so fun I wrote a script for it I know it's not the best script in the world but does the job <form method="post" action=""> <textarea name="message"></textarea> <input type="submit" value="Generate" /></form><?php if(isset($_POST['message'])){ $message = htmlspecialchars($_POST['message']); $newMessage = ""; $splitSpace = explode(" ", $message); foreach($splitSpace as $key => $value){ $lenght = strlen($value) - 1; if($lenght > 3){ $last = substr($value, $lenght); if($last == "," or $last == "." or $last == ":" or $last == ";" or $last == "'" or $last == "!" or $last == "%" or $last == "?" or $last == "}" or $last == ")" or $last == "]" or $last == '"'){ $first = substr($value, 0,1); if($first == "'" or $first == '"' or $first == "(" or $first == "{" or $first == "["){ } $word = substr($value, 1, $lenght-1); $first = $first.substr($word, 0,1); $lenght = strlen($word) - 1; $last = substr($word, $lenght).$last; $word = substr($word, 1, $lenght-1); $newWord = ""; while($word != ""){ $lenght = strlen($word) - 1; $num = rand(0, $lenght); $newWord = $newWord.substr($word, $num, 1); $word = substr_replace($word, "", $num, 1); } $newWord = $first.$newWord.$last; }else{ $first = substr($value, 0,1); $lenght = strlen($value) - 1; $last = substr($value, $lenght); $word = substr($value, 1, $lenght-1); $newWord = ""; while($word != ""){ $lenght = strlen($word) - 1; $num = rand(0, $lenght); $newWord = $newWord.substr($word, $num, 1); $word = substr_replace($word, "", $num, 1); } $newWord = $first.$newWord.$last; } }else{ $newWord = $value; } $newMessage = $newMessage.$newWord." "; } echo $newMessage; }?>
  23. Why not write some rows of text to the one I wait for the answer to my quest.

    Thanks for being here making things possible.

×
×
  • Create New...