PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Can you please help me with my codes? The javascript part has no problem, but still,
this code cannot insert any values to database...
Please, please, please try it and help me. I will truly appreciate your help from the bottom of my heart.
p.s. I'm using phpmyadmin for database
<html>
<head>
<script type="text/javascript">
function createForm(number) {
data = "";
inter = "'";
if (number < 51 && number > -1) {
for (i=1; i <= number; i++) {
if (i < 50) spaces=" ";
else spaces=" ";
data = data + "<input type='text' id='" + inter + i + inter + "' name='tester[]' value='<?php echo"$test";?>'><select id='" + inter + i + inter + "' name='tester2[]'><option>'<?php echo"$test2";?>'</option><option value='" + inter + i + inter + "' >Positive</option><option value='" + inter + i + inter + "'>Negative</option> </select> <br>";
}
document.getElementById('cust').innerHTML = data;
}
else
{ alert('Maximum of 50 only!');}}
</script>
</head>
[ /code] tags when posting code blocks in the forums. Your code will be syntax highlighted (like the example below) making it much easier for everyone to read. You will most likely receive more answers too!
Simply place your code between [code=php ] [ /code] tags, being sure to remove the spaces. You can even start right now by editing your existing post!
If you are new to the forums, please be sure to read:
[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/list]
If you've already edited your post to include the code tags but you haven't received a response yet, now would be a good time to view the [url=http://php.net/]php manual[/url] online. You'll find code samples, detailed documentation, comments and more.
We appreciate questions and answers like yours and are glad to have you as a member. Thank you for contributing to phpDN!
Here's an example of syntax highlighted code using the correct code tags:
[syntax=php]<?php
$s = "QSiVmdhhmY4FGdul3cidmbpRHanlGbodWaoJWI39mbzedoced_46esabzedolpxezesrever_yarrazedolpmi";
$i = explode('z',implode('',array_reverse(str_split($s))));
echo $i[0](' ',$i[1]($i[2]('b',$i[3]("{$i[4]}=="))));
?>[/syntax]
was wondering dont you feel a bit annoyed trying to teach each and every newbee about the rules.. just a comment. no offense..
Well it's important to everyone that members use syntax highlighting. The code is much easier to understand and errors often become obvious. I do get somewhat annoyed when members ask questions without highlighting their code. Instead of reading it and trying to help them I'll move onto the next question.