AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
What debugging steps have you taken?
-
Use XAMPP to test scripts.
-
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.
-
Double check and make sure that the script can access the image with the path provided.
-
Checking Update Data If It Does Not Exist In The Database
AyKay47 replied to 50r's topic in PHP Coding Help
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? -
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.
-
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.
-
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.
-
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.
-
Before I look at the code, show the errors that are being triggered.
-
post all of the relevant code that you are using now.
-
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')
-
glad it worked for you, please mark this topic as solved.
-
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.
-
Hi Am New To This Forum Pls I Will Like Someone To Help Me Out On This
AyKay47 replied to stutego's topic in PHP Coding Help
stutego, this link will help you understand the concept of concatenation better.- 23 replies
-
- new
- error running my code
- (and 2 more)
-
Psycho, enough with the little jabs please. I respect you, which is why I stopped the banter.
-
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);
-
Hi Am New To This Forum Pls I Will Like Someone To Help Me Out On This
AyKay47 replied to stutego's topic in PHP Coding Help
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.- 23 replies
-
- new
- error running my code
- (and 2 more)
-
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?
-
I believe wildcard subdomains is what you are looking for.
-
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.
-
If you could, post a sample string where the regex would need to search for these patterns.
-
completely missed that..
-
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>"; } ?>
-
My first post answered his question. I was trying to help him further. Apparently that is frowned upon here.