Click here to Skip to main content

Linux, Apache, MySQL, PHP

 
You must Sign In to use this message board.
    Spacing  Noise  Layout  Per page   
PinnedForum Guidelines - PLEASE READ PinadminChris Maunder28-Jul-09 3:39 
When posting your question please:
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
     
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
     
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
     
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
     
  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
     
  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
     
  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
     
  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
     
  9. Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
     
  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
     
  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
     
  12. No advertising or soliciting.
     
  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
 
When answering a question please:
  1. Read the question carefully
     
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
     
  3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
     
  4. If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
 
cheers,
Chris Maunder
 
The Code Project Co-fou
QuestionMessage Removed Pinmembersamflex5-Mar-15 16:45 
Message Removed

modified 2 days ago.

QuestionCan't get ubuntu boot to recognize USB drive! Pinmemberswampwiz22-Feb-15 8:46 
I set up a bootable USB stick drive (call it Stick #1) and loaded it up with ubuntu 14.04 LTS, and then booted up with it (using the "try" option), but I can't seem to get another FAT32 formatted (call it Stick #2) recognized. All I want to do is to copy some of the files off of Stick #2 onto the system hard drive (which shows up as "main"). Thanks
QuestionHow Can I Detect Whether My Total Price Is Greater Than The Price I Inputted On Textbox [modified] PinmemberPatrick sarmiento12-Feb-15 21:49 
Hi i have a problem with my shopiing cart i hope you can help me with my problem.
I have a shopping cart which contains a session that i get when selecting values on database.
I have also a textbox which contains a desired budget.
 
My problem is I want to have a error message which can detect if the total price of the session is greater than the budget.
 
here is my code I hope you can help me
 <form method="get">
 
<table>
          <tr>
            <td style="padding:5px;">Budget:</td>
            <td style="padding:5px;"><input type="text" name="budget" class="txtfield" placeholder="Please enter your desired budget"></td>
          </tr>
          <tr>
            <td style="padding:5px;">Service Type:</td>
          <td style="padding:5px;">
              <select name="servicetype" class="txtfield">
                <option>Wedding</option>
                <option>Debut</option>
                <option>Birthday</option>
              </select>
            </td>
          </tr>
          <tr>
            <td style="padding:5px;"></td>
            <td style="padding:5px;"><input type="submit" name="search" value="Search" class="btn btn-warning"></td>
          </tr>
        </table>
        </form>
    <?php if(isset($_GET['search'])):?>
        <h3 style="background:red; color:white; width:300px; padding:5px;">Desired Amount: <?php echo $_GET['budget'] ?></h3>
    <?php endif?>
    <div class="products">
    <?php
    //current URL of the Page. cart_update.php redirects back to this URL
	$current_url = base64_encode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
    if(isset($_GET['search']))
    {
 
$servicetype = $_GET['servicetype'];
    if($_GET['budget'] =="")
    {
        echo'<div class="alert alert-warning">Please enter your desired amount</div>';
    }
    else
    {
    $servicetype = $_GET['servicetype'];
	$results = $mysqli->query("SELECT service_inclusion,price,servicetype,soid FROM service_offer 
        where servicetype='$servicetype' ORDER BY soid ASC");
    if ($results) 
    {
 
  while($obj = $results->fetch_object())
        {
 
  echo '<div class="product">'; 
            echo '<form method="get" action="cart_update.php">';
			
  echo '<div class="product-content"><h3>'.$obj->service_inclusion.'</h3>';
            echo '<div class="product-desc">Price: '.$currency.$obj->price.' </div>';
            echo '<div class="product-desc">Service Type: '.$obj->servicetype.' </div>';
            echo '<div class="product-info">';
			echo '<button style="background:#F01818; color:white;border:0;">Add Services</button>';
			echo '</div></div>';
            echo '<input type="hidden" name="service_inclusion" value="'.$obj->service_inclusion.'" />';
            echo '<input type="hidden" name="type" value="add" />';
            echo '<input type="hidden" name="soid" value="'.$obj->soid.'" />';
			echo '<input type="hidden" name="return_url" value="'.$current_url.'" />';
            echo '</form>';
            echo '</div>';
        }
      }
    }
 
 ?>
    
 </div>
    
<div class="shopping-cart">
<h2>Your Shopping Cart</h2>
<?php
if(isset($_SESSION["products"]))
{
    $total = 0;
    echo '<ol>';
    if($_GET['budget'] > $cart_itm['price'])
    {
        $message = 'error';
    }
    else
    {
    foreach ($_SESSION["products"] as $cart_itm)
    {
 
  echo '<li class="cart-itm">';
        echo '<span class="remove-itm"><a href="cart_update.php?removep='.$cart_itm["code"].'&return_url='.$current_url.'">×</a></span>';
        echo '<h3>'.$cart_itm["name"].'</h3>';
        echo '<div class="p-price">Price :'.$currency.$cart_itm["price"].'</div>';
        echo '</li>';
        $subtotal = ($cart_itm["price"]);
        $Total = ($total + $subtotal);
        
   }echo'</ol>';
    echo '<span class="check-out-txt"><strong>Total : '.$currency.$Total.'</strong> <a href="view_cart.php">Check-out!</a></span>';
	echo '<span class="empty-cart"><a href="cart_update.php?emptycart=1&return_url='.$current_url.'">Empty Cart</a></span>';
}   }
else
{
    echo 'Your Cart is empty';
 
}}
?>
 
</div>
<div style="clear:both;"></div>    
</div>
<script type="text/javascript">
    <?php 
        if(isset($message))
        {
            echo "alert('$message')";
        }
    ?>
</script>


modified 13-Feb-15 4:49am.

SuggestionRe: How Can I Detect Whether My Total Price Is Greater Than The Price I Inputted On Textbox PinprotectorRichard MacCutchan12-Feb-15 23:50 
QuestionPass datepicker value to PHP & MySQL PinmemberJassim Rahma8-Feb-15 0:28 
Hi,
 
the following file has dateFrom and dateTo datepickers:
 
http://www.mybluefile.com/new_leave.zip[^]
 
When submitting the form I don't get the correct MySQL format therefore it's throwing an error.
 
The value I get is something like this:
 
1423900800
 
that's when I try:
 
echo $timestamp = strtotime($_POST['dateFrom']);
 
can you help please...

 
Technology News @ www.JassimRahma.com

AnswerRe: Pass datepicker value to PHP & MySQL PinmemberProgramFOX8-Feb-15 3:59 
QuestionMake this Hashing in PHP PinmemberJassim Rahma28-Jan-15 22:05 
Hi,
 
I would like to ask how to convert this C# code into PHP as my office application is in WinForm C# but need to have a PHP portal for it?
 
public string HashString(string toHash)
{
    using (SHA512CryptoServiceProvider sha = new SHA512CryptoServiceProvider())
    {
        byte[] dataToHash = Encoding.UTF8.GetBytes(toHash);
        byte[] hashed = sha.ComputeHash(dataToHash);
        return Convert.ToBase64String(hashed);
    }
}
 
public string HashPassword(string password, string salt)
{
    string combined = password + salt;
    return HashString(combined);
}
 

Thanks,
Jassim

 
Technology News @ www.JassimRahma.com

AnswerRe: Make this Hashing in PHP PinprotectorRichard MacCutchan28-Jan-15 22:24 
Question$_COOKIE[session_name()] vs session_id() which one holds good? PinmemberJayapal Chandran28-Jan-15 11:11 
I am overwriting the session cookie to set different domain names with respect to the protocol(http/https)
 
i wanted to know whether the following is good comparing to the next
 
$sessname = session_name();
setcookie($sessname, $_COOKIE[$sessname], ...
 
vs
 
setcookie(session_name(), session_id(), ....
 
which one to use?

http://vikku.info/

Today's Beautiful Moments are
Tomorrow's Beautiful Memories


General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.8.150305.1 | Last Updated 5 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid