Jump to content

shalli

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by shalli

  1. Hi teynon, ZulfadlyAshBurn Thanks for your reply it seems it was an error with my server (according to hosting techie) - it seems to be working now Not sure what happened but thanks for your response!!!
  2. Hi There I have a simple cms system that I have built but for some reason the login script wont let me login to the cms. Strange thing is the script seems to works on the original database but when I changed the details to a new db it doesnt work. I have made the necessary changes for the connecting to the db etc but it just wont let me login. Can anyone help The url is drmonlinemarketing.com/cms2/loginadmin.php try login with username demo password test thanks shalli
  3. Hi There I used this for a site of mine http://www.evolt.org/node/60384 Hope this helps
  4. Hi there Just wanted to know what everyone here would recommend to a newbie in php about adding php code to mysql database and then retreiving it I would like to create a is a php template site that allows user to choose the template they like and once the user selects the template it takes the user to a page that shows template code. The page use php variables to display the code from the database. as an example it like dreamweaver which allow you to choose from a selection of templates when creating a website Hope this make sense thanks for you time shalli
  5. Thanks mikosiko For all your help!!
  6. thanks for your response Crayon Violent Yes it seems to do nothing I entered the following echo to check that I was passing the correct variables echo "$ProductName <br> $ProductText <br> $ProductImage <br> $ProductPrice"; Basically what the code does is display a form with the data from the database and you edit that data in the form and when you click submit it should update the database I was using this tutorial to help me create this functionality http://www.maaking.com/index.php?loadpage=tutorials hope this help
  7. Hi There I am trying to create a page that edit mysql database from a php page. I can get the edit page to show the orginal information but it wont update the data in the mysql database. I am sure I have entered everything right. If anyone could help with this I would greatly appreciated <?php include("dbconnect.php"); if(isset($_POST['submit'])) { // Set global variables to easier names // and prevent sql injection and apostrophe to break the db. $ProductName = mysql_escape_string($_POST['ProductName']); $ProductText = mysql_escape_string($_POST['ProductText']); $ProductImage = mysql_escape_string($_POST['ProductImage']); $ProductPrice = mysql_escape_string($_POST['ProductPrice']); $result = mysql_query("UPDATE Product SET ProductName='$ProductName', ProductText='$ProductText', ProductImage='$ProductImage', ProductPrice='$ProductPrice' WHERE ID='$ID' ",$dbconnect); echo "<b>Thank you! Product UPDATED Successfully!<br>You'll be redirected to View Page after (2) Seconds"; echo "<meta http-equiv=Refresh content=2;url=view.php>"; echo "$ProductName <br> $ProductText <br> $ProductImage <br> $ProductPrice"; } elseif(isset($_GET['ID'])) { $result = mysql_query("SELECT * FROM Product WHERE ID='$_GET[iD]' ",$dbconnect); while($myrow = mysql_fetch_assoc($result)) { $ProductName = $myrow["ProductName"]; $ProductText= $myrow["ProductText"]; $ProductImage = $myrow["ProductImage"]; $ProductPrice = $myrow["ProductPrice"]; ?> <br> <h3>::Edit Product</h3> <form method="post" action="<?php echo $PHP_SELF ?>"> <input type="hidden" name="ID" value="<? echo $myrow['ID']?>"> Product Name: <input name="ProductName" size="40" maxlength="255" value="<? echo $ProductName; ?>"><br> Product Text: <textarea name="ProductText" rows="7" cols="30"><? echo $ProductText; ?></textarea><br> Product Image: <textarea name="ProductImage" rows="7" cols="30"><? echo $ProductImage; ?></textarea><br> Product Price: <textarea name="ProductPrice" rows="7" cols="30"><? echo $ProductPrice; ?></textarea><br> <input type="submit" name="submit" value="Update Product"> </form> <? }//end of while loop }//end else ?>
  8. Hi there Been trying to figure this out but how do you limit charachters on a mysql query <?php //$qry="select * from news where status=1 order by date_Added DESC"; $qry="select * from wp_posts order by post_date DESC"; $sql=mysql_query($qry,$connBlog); //$news=mysql_fetch_array(); while($news=mysql_fetch_array($sql)){ $arr[]=$news['post_title', 0, 25];?> js_ar.push("<?=$news['post_title']?>"); <?php }?> thanks shalli
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.