Linux, Apache, MySQL, PHP
|
|
 |
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- 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.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- 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.
- 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.
- 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.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- 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:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- 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
|
|
|
|
 |
Message Removed
modified 2 days ago.
|
|
|
|
 |
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
|
|
|
|
 |
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 = 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.
|
|
|
|
 |
You should edit the above question, remove all the code not relevant to the issue, and show exactly where the problem occurs.
|
|
|
|
 |
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
|
|
|
|
 |
strtotime converts a date string to a Unix timestamp: http://php.net/manual/en/function.strtotime.php[^]
php.net says: The function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC)
To format the date, use the date function:
$timestamp = strtotime($_POST['dateFrom']);
$formatted_date = date("[format here]", $timestamp);
I don't know which format you want exactly, so you can take a look at the PHP manual to see how you can format your date:
http://php.net/manual/en/function.date.php[^]
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
 |
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
|
|
|
|
|
 |
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?
|
|
|
|
|
 |
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin