Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. What debugging steps have you taken?
  2. Use XAMPP to test scripts.
  3. AyKay47

    Using Regex

    First regex for matching: $pattern = '~^@[^@]+\n@~m'; For the second search, the pattern I already gave you for it will work. Keep in mind that the regex I am writing is very loose and is meant to get you going, not as an finite answer.
  4. Double check and make sure that the script can access the image with the path provided.
  5. So each form field is responsible for updating its respected db table field, and if a certain form field is the same as the db table field then don't update?
  6. I know it has nothing to do with the php calculations, I've been trying to steer you in the right direction for a couple of posts now.
  7. You have been given several answers to this issue already. Not much more anyone can do for you. Apply the advice that was given to you and if you are still having issues with the code after you have attempted to implement the logic given to you, post back with all relevant code and your issue.
  8. You still have failed to provide us with the actual problem that you are having. All we can do is assume that the issue is the picture position, in which case the problem is the "margin-top" and "margin-left" properties in the CSS.
  9. If the "new problem" that you are referring to is the image being out of position, please start a new thread in the CSS section since it is now out of the original problem's scope.
  10. Before I look at the code, show the errors that are being triggered.
  11. AyKay47

    Using Regex

    post all of the relevant code that you are using now.
  12. The error should be self explanatory, invalid syntax is what is causing the error. Do not wrap the entire values block in quotes. It should read: INSERT INTO `imloop` ( image1, image2, image3, image4, image5, image6) VALUES ('1352838703-1.jpg', '1352838703-2.jpg', '1352838703-4.jpg', '1352838703-5.jpg', '1352838703-6.jpg', '1352838703-5.jpg')
  13. AyKay47

    Using Regex

    glad it worked for you, please mark this topic as solved.
  14. either heredoc or end php parsing with a closing ?> tag and begin php parsing after the form. Also, instead of using so many <p> </p>, apply some CSS to the form and use a margin Edit: Also in this line: <input name="name" type="text" id="name" maxlength="30" value="<?php echo $MM_Username; ?>"> php tags are only needed if you are not already parsing php, which in this case you are.
  15. stutego, this link will help you understand the concept of concatenation better.
  16. Psycho, enough with the little jabs please. I respect you, which is why I stopped the banter.
  17. AyKay47

    Using Regex

    First, as-is the apostrophe used in images's alternative will break the string and give unexpected results, escape the apostrophe with a backslash \' I will do a couple of the regex patterns to give you the idea. $text = 'Just for test ^ sad as dasd ^sa da da sa "some text":http://google.com "متن(UTF-8 string)":http://google.com *.sometext * sometext #.some text # some text some text !http://static.php.ne...es/php.gif(This is image\'s Alternative)! @ String mystr = "test@example.com" String mystr = test@@@@::example.com; @ *some text* _some text_ -some text- Other Image !http://static.php.net/images/php.gif(This is image\'s Alternative Text)!'; $patterns = array(); $patterns[] = '~"([^"]+)":(http://[^\n]+)~i'; $patterns[] = '~!(http://[^(]+)\(([a-z\' ]+)\)!~i'; $patterns[] = '~\*(?:\.|\s)?([a-z ]+)$~im'; $patterns[] = '~_([^_]+)_~i'; $replace = array(); $replace[] = '<a href=\'$2\'>$1</a>'; $replace[] = '<img src=\'$3\' alt=\'$4\'/>'; $replace[] = '<li>$5</li>'; $replace[] = '<i>$6</i>'; echo preg_replace($patterns, $replace, $text);
  18. Using the advice that Jesi initially gave you, and with a little cleanup added, this code should work for you: $month = array("jan" => "Jan", "feb" => "Feb", "mar" => "Mar", "apr" => "Apr", "may" => "May", "jun" => "Jun", "jul" => "Jul", "aug" => "Aug", "sep" => "Sep", "oct" => "Oct", "nov" => "Nov", "dec" => "Dec"); $default = "jan"; $menu = generate_menu("month", $month, $default); function generate_menu($name, $month, $default="") { $select = "<select name='$name'>"; foreach($month as $value => $label) { $select .= "<option "; if ($value == $default) $select .= "selected='selected' "; $select .= "value='$value'>$label</option>"; } $select .= "</select>"; return $select; } echo $menu; Also, the function returned $select from the initial post.
  19. AyKay47

    Using Regex

    I understand the parameters, but are all of these sub-strings being searched for in one string or in several strings? I cannot create a regex for you unless I am given a sample string to work with. An example would be: $text = "this is a sample string with text link:http://site.com and other stuff"; In the example you provided: $text = preg_replace("/.**{2}(.+?)\*{2}.*/", "<b>$1</b>", $text); What is the string value of $text initially?
  20. I believe wildcard subdomains is what you are looking for.
  21. Two quick notes: 1. The != operator is valid in MySQL, although <> is preferred. 2. Depending on the size of your MySQL table, using ORDER BY RAND() can be very slow. If your table is not large (more than 500+ rows about), then you really do not have to worry. However, using ORDER BY RAND() is a bad habit to get into.
  22. AyKay47

    Using Regex

    If you could, post a sample string where the regex would need to search for these patterns.
  23. completely missed that..
  24. Most likely $webpage carries an invalid link that cannot be used. Hard to tell without seeing all of the relevant code. Also it doesn't seem like there is a point to displaying an empty string, shorten the condition to: <?php if ($webpage != null) { echo "<div><a href='<?php echo $webpage; ?>'>Visit Website!</a></div>"; } ?>
  25. My first post answered his question. I was trying to help him further. Apparently that is frowned upon here.
×
×
  • 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.