Jump to content

equipment

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

equipment's Achievements

Member

Member (2/5)

0

Reputation

  1. I remember in the past it used to be done with Firefox add-ons, how does it look like now?
  2. Thanks a lot, I have to say that putting the space before the vertical pipe will work better because it will keep the vertical pipe with the tag together, they can both break apart at the breaking point if the space will be after the vertical pipe.
  3. I already posted it, do look at the link in the post above yours.
  4. I thought of it as not an HTML or CSS problem, that is the reason why I suspected the while loop for this case. Take a look at the live example here: http://www.emoticonsymbols.net/model/contribution/knuffix_list.php?cat=All The two series of tags above and below are in the exact same div with the exact same id="labels", though the lower one which is being printed off the while loop does break out. Developer tools can be used for the HTML or CSS.
  5. <?php # This database request does get included into the file: knuffix_list_category_sort_automatic_1.php # for the sake of printing the tags list. # Printing of the tag names in ascending order by tag_id $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $sql_get = "SELECT DISTINCT tag_id, tag_name FROM tags ORDER BY tag_id ASC"; $sql_run = mysqli_query($db_connect, $sql_get); # $sql_assoc_tag_id = mysqli_fetch_assoc($sql_run); ?> <div id="labels"> <a href="?cat=All">all</a> <?php while($sql_assoc = mysqli_fetch_assoc($sql_run)){ echo '<u>|</u>' . '<a href="?cat=' . $sql_assoc['tag_id'] . '">' . $sql_assoc['tag_name'] . '</a>'; } ?> </div> The list created in the while loop is breaking out of the div wrapper, even though it should not. It should break into new lines at the side of the div wrapper. What is causing it to not break at the side of the div wrapper? And how can I solve it?
  6. I outlined the rules clearly in the first post: And then I wrote an example like this, before xyph would post: To make you understand that in marketers terms, I want to build a tag system which should only accept this: example-string And that is enough one needs to know, simply enough to know, simply enough to know, simply enough to know, simply enough to know, simply enough to know.
  7. xyph, that is a good starting point, how can I now add the following conditions to only have? 1. only lower case letters are possible 2. no other special characters, including white space are possible 3. and only one hyphen is possible
  8. Well it is just like that, it is for inputted data through an input field, simply a literal string with maximum one hyphen should be allowed not more, solely alphabetic with no special characters. I just have problems wrapping my head around preg_match example-string
  9. How could this be achieved with preg_match? It should be solely alphabetic (lower case) with no special characters and only one hyphen should be allowed.
  10. I just checked it, it indeed is the line-break in the text area, even when it is a short text-string with spaces, as soon as the string breaks at the side of the textarea field it will not work anymore. By the way I simply want alphabetic characters to be entered with no special characters. Is there a way to achieve it with the line-breaks or an alternative you would suggest? What do you mean by that?
  11. <?php # This script does get included into the document create_new_tag_from.php if(isset($_POST['tag_name_submit'])){ $tag_name_submit = $_POST['tag_name_submit']; } if(!empty($_POST['tag_name'])){ $tag_name = strip_tags($_POST['tag_name']); } if(!empty($_POST['tag_description'])){ $tag_description = strip_tags($_POST['tag_description']); } if(isset($tag_name_submit)){ # The Validation of User Entered Data # Do validate for solely alphabetic characters with ctype_alpha # ctype_alpha($tag_name) && if(ctype_alpha($tag_description)){ $tag_name = strtolower($tag_name); $tag_description = strtolower($tag_description); # The Insertion Into the Database $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); # Do research if SQL query has to be modified into a PHP comform query $sql_query = sprintf( "set @newid = convert( ( select max(convert( (substring(tag_id, 2)) , unsigned integer))+1 from tags), char(10) ); set @newid = if(length(@newid) = 1, concat('0', @newid), @newid); set @newid = concat('c', @newid); INSERT INTO tags (tag_id, tag_name, tag_description, added_by_user_id, creation_date, last_edited) VALUES (@newid, '%s', '%s', 7, now(), '0')", mysqli_real_escape_string($db_connect, $tag_name), mysqli_real_escape_string($db_connect, $tag_description) ); $sql_query_run = mysqli_multi_query($db_connect, $sql_query); # Print Test to See If It Works echo "works_ "; echo $tag_name . "_ "; echo $tag_description . "_ "; } else { # End of the Validation echo "The entered data must be in alphabetic characters."; } } ?> Here is the form: <?php include_once('../../header.php'); include_once('../../model/contribution/create_new_tag_script.php'); ?> <form action="" method="post"> <input type="text" name="tag_name" value="" /> <textarea maxlength="60" type="text" name="tag_description" value=""></textarea> <input type="submit" name="tag_name_submit" value="Submit the New Tag" /> </form> <?php include_once('../../footer.php'); ?> By the script as given above the conditional check will skip to the error message. Though I have to say that ctype_alpha does return TRUE when I do try it with "tag_name" which is entered data from the input field, while the other is from the textarea. I simply cannot see the reason for the returned FALSE.
  12. Thanks a lot, worked like a charm. It can be that easy as well.
  13. This is something I put together, I would like to know, how does it have to be rewritten to be PHP comform? # The Insertion Into the Database $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $sql_query = sprintf( "set @newid = convert( ( select max(convert( (substring(tag_id, 2)) , unsigned integer))+1 from tags), char(10) ); set @newid = if(length(@newid) = 1, concat('0', @newid), @newid); set @newid = concat('c', @newid); INSERT INTO tags (tag_id, tag_name, tag_description, added_by_user_id, creation_date, last_edited) VALUES (@newid, '%s', '%s', 7, now(), '0')", mysqli_real_escape_string($db_connect, $tag_name), mysqli_real_escape_string($db_connect, $tag_description) ); $sql_query_run = mysqli_query($db_connect, $sql_query); As of yet I could execute the script and would not get error messages, though also no data would be entered into the table.
×
×
  • 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.