
sasa
-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Posts posted by sasa
-
-
hee
line 29 ($i = 0;) move after if statemans to line 36.
and before foreach loop insert $i = 1;
-
1
-
-
in MySL you can use 'ORDER BY RAND(N)' where N is seed for generate random numbers.
If you use same N order is been same
-
-
you can use
<button type="submit"><img src="img_url"></button>
-
change line 40 to
('$_POST[name1]','$_POST[age2]','$pic[0]')";
-
in line 21 define new variable for checkin is form valid
<?php include("include/left_bar.php"); $chk = TRUE; ?>
in line 27 - 28 add
<?php if (isset($_POST["submit"])&&(empty($fname))) { echo"<center><em><div id='form'>Please Your Frist Name Is Required<br></div></em></center>"; $chk = FALSE;}?>
same for another fields
and in line 21 of 2nd file add
if($chk) $submit=mysql_query("INSERT INTO users(fname,lname,username,email,password,phone,gender)VALUES('$fname','$lname','$username','$email','$password','$phone','$gender')") or die("REGISTRATION NOT COMPLETED Thanks");
-
move submit line inside form and close form tag
somet6hing like this
{ echo "<tr>"; echo "<td align='center' width=40>". $row['Art']. "</td>"; echo "<td align='center' width=80>". $row['d']. "</td>"; echo "<td align='center' width=80>". $row['De']. "</td>"; echo "<td align='center' width=80>". $row['Lo']. "</td>"; echo "<td align='center' width=80>". $row['R']. "</td>"; echo "<td align='center' width=80>". $row['nt']. "</td>"; echo "<td align='center' width=80>". $row['Ln']. "</td>"; echo "<td align='center' width=80>". $row['sn']. "</td>"; echo "<td align='center' width=80>". $row['Fn']. "</td>"; echo "<td align='center' width=80>". $row['rdj']. "</td>"; echo "<td align='center' width=80>". $row['stanje']. "</td>"; echo "<td align='center' width=80>". $row['cena']. "</td>"; echo "<td align='center' width=80>". $row['artnr']. "</td>"; // echo '<td><button type="submit" src="shopping-cart-icon-614x460.png" width="30" height="30" id="btn_9" class="Button3" ></button></div> <form id="form_'.$row["artnr"] .'" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_self" style="margin:0;position:absolute;left:279px;top:1146px;width:220px;height:96px;"> <input type="hidden" name="bn" value="shoping.cart"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="[email protected]"> <input type="hidden" name="item_name" value="Druckfedern"> <input type="hidden" name="item_number" value="' . $row["artnr"] . '"> <input type="hidden" name="currency_code" value="EUR"> <input type="hidden" name="amount" value="1.00"> <input type="hidden" name="add" value="1"> <input type="hidden" name="quantity" value="1"> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="1">'; echo '<td><button type="submit" src="shopping-cart-icon-614x460.png" width="30" height="30" id="btn_9" class="Button3" ></button>'; echo '</form>'; echo "</tr>"; } echo "</table>"; } mysql_close($db_con); ?>
i change form id to. it's must bi uniq
-
or
$count = 0; for($i = 10; $i < 55; $i++){ if($_POST['event'.$i] != '') $count++; } echo $count * 5000;
-
it is HTML
use
<a href="http://www.apartment...webcam.php">< img src='.webcam2.jpg' ></a>
remove php tag
-
use google docs
-
He
You don't count how many record is echoed.
Put counter to zero before while loop
incrise counter in loop (just in start of it)
This counter compare with $maxCount
in second if statement return counter to zero
if ($productCount > 0) { $cnt = 0; while($row = mysql_fetch_array($sql4)){ $cnt++; $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $category = $row["category"]; $details = $row['details']; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $maxCount = 5; if ($cnt != $maxCount) { $dynamicList .= '<td width="150"><a href="inventory_images/'.$id.'.jpg" target="_blank"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '_small.jpg" alt="' . $product_name . '" border="1" width="150"/></a> '.$details.'£'.$price.' <form id="form1" name="form1" method="post" action="cart.php"><input type="hidden" name="pid" id="pid" value='.$id.' /><input type="submit" value="" name="button" id="button" class="cardbutton" /></form></td>'; } else if ($cnt == $maxCount) { $cnt = 0; $dynamicList .= '<td width="150"><a href="inventory_images/'.$id.'.jpg" target="_blank"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '_small.jpg" alt="' . $product_name . '" border="1" width="150"/></a> '.$details.'£'.$price.' <form id="form1" name="form1" method="post" action="cart.php"><input type="hidden" name="pid" id="pid" value='.$id.' /><input type="submit" value="" name="button" id="button" class="cardbutton" /></form></td></tr><tr>'; }
-
He
change name of variable $res in this part of code
while ($rows=mysql_fetch_assoc($res)) { $sql = "UPDATE spammers SET abc='". 5252 ."' WHERE spamID ='".$rows['spamID']."';"; $res = mysql_query($sql); // change to something diferent if(!$res) { // and in this line die(" Could not query the database: <br/>". mysql_error() ); }
-
he
in your code try to replace
if($page+4 >= $pages) $pagex=$pages; else $pagex = (($page != 5) ? $page+4 : $page+1); echo $page-4; for($i=$page-4 ; $i<=$pagex ; $i++) {
with
if($page+2 >= $pages) $pagex=$pages; else $pagex = $page+2); if($page > $pagex - 2) $pagein = $pagex - 4; else $pagein = $page - 2; if($pagein < 1) $pagein = 1; for($i = $pagein; $i <= $pagex; $i++) {
-
change
$sum = $sum + ($cell[$i][$row][$ctr] * $cell[$i+1][$ctr][$row]);
to
$sum = $sum + ($cell[$i][$row][$ctr] * $cell[$i+1][$ctr][$column]);
-
you can use or tooPika, you may be interested to learn that the && can be used as a quick shorthand IF:
strpos($off, ';') !== FALSE && $off = substr( $off, strpos( $off, ";" ) + 1 );
It's sloppy and perl-like and will cause any code reviewers to punch you, but it's valid. I think it's fun.
strpos($off, ';') == FALSE || $off = substr( $off, strpos( $off, ";" ) + 1 );
-
change line
start_date= $start_date,
to
start_date= str_to_date('$start_date_pre', '%d/%m/%Y'),
-
try
<?php include_once "connect_to_mysql.php"; $cols = 3; $result = mysql_query("SELECT plantID, botanicalName FROM plants ORDER BY botanicalName"); $numrows = mysql_num_rows($result); $rows_per_col = ceil($numrows / $cols); $c = 1; $r = 1; while ($row = mysql_fetch_array($result)) { $plantID[$r][$c] = $row["plantID"]; $botanicalName[$r][$c] = $row["botanicalName"]; if ($r == $rows_per_col) { $c++; $r = 1; } else { $r++; } } $dyn_table = '<table width="750" cellpadding="0" cellspacing="0" border="0">'; for ($r = 1; $r <= $rows_per_col; $r++) { $dyn_table .= '<tr>'; for ($c = 1; $c <= $cols; $c++) { $dyn_table .= '<td><a href="plant_details.php?plantID = ' . $plantID[$r][$c] . '" id="plantLink">' . $botanicalName[$r][$c] . '</a></td>'; } $dyn_table .= '</tr>'; } $dyn_table .= '</table>'; ?>
-
if you need this for MySQL jou can use str_to_date() and date_format() functions in query
-
try
<?php $cost_1st_level= 3; $level_cost_diff = 10; $total_money = 40; $tmp = 2 * $cost_1st_level - $level_cost_diff; $number_of_level_can_by = floor((-$tmp + sqrt($tmp * $tmp + 8 * $total_money * $level_cost_diff) ) / (2 * $level_cost_diff)); echo $number_of_level_can_by; ?>
-
if you chane many to 90 that will output 5 levels for 90 bucks.I don't think there is a function for that, but a simple while loop will solve that for you.
<?php $level = 1; $cost = 10; $money = 100; while($money > $cost) { $money -= $cost; //remove cost from money left $cost += 5; //increase base cost ++$level; //increment your level } echo $level;
That will output 5 levels for 100 bucks.
Edit:: Removed a pointless step.
-
Ara you sure that your comp is free of malicious software?
-
just do
<?php //numbers of combination for w/x + y/z $num1=1; $den1=1; $num2=1; $den2=1; $row=1; for($num1=1; $num1<=9; $num1++){ for($den1=1; $den1<=9; $den1++){ for($num2=1; $num2<=9; $num2++){ for($den2=1; $den2<=9; $den2++){ echo $row.'. ) '; $row=$row+1; echo $num1.'/'.$den1.' + '.$num2.'/'.$den2.'<br>'; } } } } ?>
-
try
SELECT * FROM ads LEFT JOIN features ON FIND_IN_SET(features.f_id,ads.features) WHERE ads.id='$id2'[/ code]on phpMyAdmin
-
something like this
SELECT latest_post.person, profile.avatar_img FROM latest_post LEFTV JOIN profile ON latest_post.id = profile.id
Encryption
in PHP Coding Help
Posted
change
$_POST["SHA1('pass')"] to SHA1($_POST['pass'])