
Joshua4550
Members-
Posts
148 -
Joined
-
Last visited
Never
Everything posted by Joshua4550
-
Hey, something isn't right with my styles. They work perfect with Firefox, as I want them to, but when It comes to IE - they mess up sometimes. I think this is the part in question. width:765px; text-align:left; position:relative; margin:10px auto; Is there something here that would be effective on Firefox and not on IE?
-
Quick & Simple question. [PHP with Javascript]
Joshua4550 replied to Joshua4550's topic in PHP Coding Help
Nope because I've got to make a more complex Javascript code before I can make the one to write another textbox in. Thank you. -
Hey. Just wondering, if I loop through textboxes with PHP, and insert query for each - that if I added a new textbox with javascript, when submitted - would PHP read that one too? I'll write some code, maybe it'll explain with more ease. PHP code (When form submitted) $connection = mysql_connect('***', '***', '***'); $database = mysql_select_db('***'); for ($i = $_POST['txtboxNum']; $i >= 1; $i--) { echo $i; } $number = 0; $query = mysql_query("SELECT * FROM field"); while ($array = mysql_fetch_array($query)) { $number++; echo '<input type="text" name="txtbox'.$number.'" value="hello '.$number.'" />'; } echo '<input type="hidden" name="txtboxNum" value="'.$number.'" />'; If I were to make a Javascript code to add another textbox into the code with a name of the next number, when submitted - would PHP be able to read that? I'm only asking because Javascript is client-side and not sure if PHP reads frfom browser or what. I'm just not 100%, so need reassurance. PS: Ignore any logic errors with the PHP code, if there are any. I just wrote this up in the thread body field, my version of this works fine. Just need the question answered (: Thanks alot.
-
Amazing, thanks alot. When you say It allows <img /> - It will allow any tag which includes a closing element inside itself too, right? IE: <anytag /> Edit: Read the code thouroughly and I see it will work, thanks alot again!
-
You didn't read the thread. Anyone actually know?
-
Anyone know?
-
Sadly, both fail. Could we use something like this for the pattern? |[[\/\!]*?[^\[\]]*?]|si This is obviously what they use to replace BB tags, but can't we just disect this pattern and use it for html tags?
-
Anyone see the error that's causing this?
-
Ooh, it would seem otherwise: $data = 'lol <a dd="/"> <div> <gflool> </gflool> </div> </a> </lol>'; preg_match_all("/<.*?>/", $data, $starttags); preg_match_all("/<\/.*?>/", $data, $endtags); print_r($starttags[0]); print_r($endtags[0]); Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => ) Array ( [0] => [1] => [2] => [3] => )
-
<?php $data = 'lol <a dd="/"> <div> <gflool> </gflool> </div> </a> </lol>'; preg_match_all("/<.*?>/", $data, $starttags); preg_match_all("/<\/.*?>/", $data, $endtags); $countstart = count($starttags[0]); $countend = count($endtags[0]); $output = ""; if($countstart > 0 || $countend > 0) { if($countstart > $countend) { $output = "Theres more opening tags than closing tags"; } else if($countstart < $countend) { $output = "Theres more closing tags than opening tags"; } else { $output = "Your code is fine!"; } } echo $output; ?> Seems that it doesn't work, because it always says: "Theres more opening tags than closing tags", but theres actually more closing tags? I made the last closing tag an opening tag, but he output remained the same. I also tried using elseif rather than else if, but still no workie! Anything i'm doing wrong?
-
What he said. But also like he said, you may want to make it a date - best in milliseconds, so when you insert into mySQL: microtime()
-
tar
-
PHP does NOT execute register_shutdown_function()?
Joshua4550 replied to B0b's topic in PHP Coding Help
I'm not sure if anything similar would happen in PHP, but once encountered this problem in Java - Is there any kind of timeout limit? -
No problemo. Please mark the topic as solved.
-
So maybe instead of it adding tags where needed, notifies the user theres a problem, and tells them how many more of {<tag> || </tag>} than the other there is?
-
= Syntax errors if ($beha == "true") { echo $rows['beha']; else if ($omraede == "true") { echo $rows[' omraede ']; else if ($pr== "true") { echo $rows[' pr ']; } else {} This is what you wanted, I think? Although this will print the $row['w/e'], you would need to put it into the table.
-
But surely, just like you used .*?, theres something to specify anything. Infact if .*? means anything, couldn't we use anything like: preg_match_all("/<.*?>/", $data, $starttags); preg_match_all("/<\/.*?>/", $data, $endtags); ? Also, maybe one for a tag that ends itself (eg: <div />)?
-
Like so? $query = "select * from videos LIMIT 4";
-
Seems logical, and looks like it'd work - but what about other tags? i'm guessing theres something you can do - like your code says .*?, so instead of div, something that represents "anything", but maybe anything except a / My sentence may not make sense, but bare with me because i'm sleepy But do you get what I mean?
-
Need to get data, process it from a different website...
Joshua4550 replied to gaogier's topic in PHP Coding Help
A Runescape fan! Funny I should see you on here But yeah, I think you are looking for what Muddy mentioned. -
Either way, this is the forum for PHP Help, generally ou post if you need help, not to drive traffic here. But like I said, what you originally said would only be as effective as a tutorial because you have the answer.
-
Wouldn't it be more logic to create your own website? I mean, if they post the excercise with the answer, you're not going to learn any more than you would if it were as a tutorial.
-
Funny, when I said an application for a HTML code checker - that's EXACTLY what I had in mind. Thing is, there must be a way in php to ask if they use <"anything here"> or </"anything here"> or <"anything here" />, right? If so, it wouldn't be that hard to make, I suppose.
-
I don't want to strip tags, because the template i'm ACTUALLY using has almost every tag they'd want to use. I want them to still be available to use any tag, but for them to not intefere with the rest of the page. If only php/html had a way to print it as a "new page" inside this one, kind of like a tag. Any other answers, or is this just not possible?
-
Hey, it's me again - YES! ;o From the title, you may be thinking "HTML? This is the PHP section!", but please read on... I have created (finally) a basic dynamic page which users can edit using forms, and I have allowed HTML - because I want HTML! But I just don't want them to be allowed to inject to mess up the default-code of the template - only their own code. I was thinking of maybe making an application to check the HTML code, and if error-full, give them an error message and not proceed with the submission, but hey - this would probably be timely to create. This in mind, I decided to post here for you experts' advice/answers Okay, so basically I need to know if, and the most logic way, to make it so they cannot inject to the default page. What I mean is: Template: <?php /* * $input would be defined here, grabbing content from * a database, but after knowing this - you should understand what I mean. */ echo ' <div id="class1"> Hello there ' . $input . ' </div> '; ?> Okay, so if this was the case - what i'm asking is for the most logic/efficient way to let the $input be printed, but not interfere with the other code, so if $input = "</div>" then it shouldn't end the <div="class1">. Get it? Hope theres an answer, and looking forward to what you think