echoCarlos
Members-
Posts
19 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
echoCarlos's Achievements
Member (2/5)
0
Reputation
-
try this mate echo '<a href=\"frontpage_delete.php?img_id=\' . $row_thumb[\'frontpage_image_id\'] . \'&image_name=\' . $row_thumb[\'frontpage_image_file_name\'] . \'\" class=\"moreLink\" onclick=\"return conform(\'testing\')\"><img src=\"grafik/delete.png\" alt=\"\" /></a>';
-
thank you I've managed to get it working
-
Guys I have a small problem I have made a shop script I am trying to pull prices from a database and add them all together to see how much has been made in total example 3.00 4.00 6.50 10.50 100.99 I want to add them all together but the decimal places are confusing me, please help this is driving me mad.
-
Just woken up, thank you very much for your reply mate I'll try that right away after I've had my coffee
-
Hi guys I'm tying to update the config.inc.php with the database info from the install.php Install.php $string = '<?php $db_host = "'. $_POST["host"]. '"; $db_user = "'. $_POST["username"]. '"; $db_pass = "'. $_POST["password"]. '"; ?>'; $fp = fopen("config.inc.php", "a"); fwrite($fp, $string); fclose($fp); config.inc.php $db_host = ''; $db_user = ''; $db_pass = ''; // connect to the server $con = mysql_connect($db_host,$db_user,$db_pass) or die('Failed to connect to the server'); // connect to the database $db = mysql_select_db('marketplace') or die('Failed to connect to the database'); can someone help me on how id do this
-
Thanks for the help but i managed to find something which did the trick on Google will post here incase anyone needs it. <?php $string = '<?php $dbhost = "'. $_POST["dbhost"]. '"; $dbuname = "'. $_POST["dbuname"]. '"; $dbpass = "'. $_POST["dbpass"]. '"; $dbname = "'. $_POST["dbname"]. '"; $prefix = "'. $_POST["prefix"]. '"; $user_prefix = "'. $_POST["user_prefix"]. '"; $dbtype = "'. $_POST["dbtype"]. '"; ?>'; $fp = fopen("config.php", "w"); fwrite($fp, $string); fclose($fp); ?>
-
thanks for the reply mate i found this would it work http://www.tizag.com/phpT/filewrite.php also how would i use this function to target chaneg1 for example thanks for your help
-
Hi guys, I have a php file called install.php and the user submits there host details, the thing is i also want to write those details to these define functions in includes/config.php with the content define('DB_HOST', 'change1'); define('DB_USER', 'change2'); define('DB_PASS', 'change3'); and overwrite change1 with host and user and pass how could this be done thanks
-
Hi guys, I have made a script which will allow people to sell there items online, but i want to make it as simple as possible for them to install the script after purchase. I want to make an install.php file which will auto create the database and table names and take an admin username and password, any idea on how i would go around doing this will be greatly appreciated. Thanks
-
anybody?
-
I'm new to php and been trying to follow along with different tutorials to try and build my own site, i followed a tutorial on making a search feature for the site and have it working perfectly, but i want to change the way how to search displays the results. I want to make it display them how there displayed on the index page. here is the index page how there displayed <div id="table"> <table> <tr class="top"> <th>Account</th> <th>Country</th> <th>Info</th> <th>Login</th> <th>Pass</th> <th>Price</th> <th>Buy</th> </tr> <?php $class = 'grey'; ?> <?php $items = getItems(); ?> <?php if(empty ($items)): ?> <h3>No Items Found</h3> <?php else: ?> <?php foreach($items as $item): ?> <?php $class = ($class == 'grey') ? 'grey2' : 'grey'; ?> <tr class="<?php echo $class; ?>"> <td><?php echo $item['item_account']; ?></td> <td><?php echo $item['item_country']; ?></td> <td><?php echo $item['item_info']; ?></td> <td><?php echo maskUser($item['item_login']); ?></td> <td><?php echo maskPass($item['item_pass']); ?></td> <td><?php echo $item['item_price']; ?> </td> <td><form method="post" action="https://sci.libertyreserve.com/"><input type="submit" name="buy" value="Buy" class="button" /></form></td> </tr> <?php endforeach; ?> <?php endif; ?> how the search is display if (strlen($search) <= 2) { echo 'Search keyword is too short.'; } else { echo "You searched for <b>$search</b><hr size='1'>"; $search_exploded = explode(" ", $search); foreach($search_exploded as $search_each) { $x++; if ($x == 1) $construct .= "item_account LIKE '%$search_each%'"; else $construct .= " OR item_account LIKE '%$search_each%'"; } $construct = "SELECT * FROM items WHERE $construct"; $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum == 0) { echo 'No results found.'; } else { echo "$foundnum results found!</p>"; while ($numrows = mysql_fetch_assoc($run)) { $item_id = $numrows['item_id']; $itemAccount = $numrows['item_account']; $itemI = $numrows['item_info']; $itemLogin = $numrows['item_login']; $itemPass = $numrows['item_pass']; $itemPrice = $numrows['item_price']; echo " <b>$itemAccount</b><br /> $itemI <br /> " . maskUser($itemLogin) . '<br />' . maskPass($itemPass, 0) . '<br />'; } } } my question is im not sure how to edit the search code to display the results in the same format as the index page thanks
-
if they have it i can't find it, could someone please point me in the right direction.
-
hey guys. I am using Liberty reserve to sell my digital items online, when the user buys the item LR posts back item_id so I can grab the id out of the database to display to the buyer and lr_amnt to check the amount against the one inside the database before displaying the result to the user. TOP: <?php include 'includes/config.inc.php'; if(isset($_POST['item_id']) && isset($_POST['lr_amnt'])) { $itemID = $_POST['item_id']; $lrAmt = $_POST['lr_amnt']; $result = mysql_query("SELECT * FROM items WHERE item_id='$itemID'"); while($row = mysql_fetch_array($result)) { $login = $row['item_login']; $pass = $row['item_pass']; $itemName = $row['item_account']; $itemDel = $row['item_del']; $price = $row['item_price']; } } ?> -------------------------------- Header: <?php if($lrAmt != $price) : ?> <h2>Fatal error in transaction: the price does not match that in the database</h2> <?php else: ?> <h2>Thank you for you're purchase of <?php echo $itemName; ?>. Please keep these details safe as they have been deleted from our database.</h2> <?php echo '<br />'; echo 'Your new Username: ' . $login; echo '<br />'; echo 'Your password: ' . $pass; ?> <?php endif; ?> but if the user views the source code and grabs the ID they could easily get it for free by making a simple html script that takes in item_id and lr_amnt and put in the values and post it to the success page. example: <fieldset> <!-- <legend>Forgot password</legend> --> <form method="post" action="http://angrypossum.org/carl/mySaleTwo/success.php"> <p> <label for="itemid">Item ID: </label> <input type="text" name="item_id" id="itemid" class="input" /> </p> <p> <label for="itemprice">Item price: </label> <input type="text" name="lr_amnt" id="itemprice" class="input" /> </p> <p> <input type="submit" name="login" value="Steal" class="button" /> </p> </form> </fieldset> how could I stop that? thanks
-
sorry to double post guys but i want to use the liberty reserve API instead of the paypal although im sure the logic behind the way of going around doing what I want to achieve will be the same.
-
hey mate im pretty new to web dev but im pretty sure this is what you're looking for http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/