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. Study,Study,Study,Study,Study...

  10. Study,Study,Study,Study,Study...

  11. Should look more into SQL query.

  12. 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; }?>
  13. 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...