Bob Hensley 20 Bob's Back!

Hi all,

I have a contact form. In the message text area the right border is not showing in chrome browser. It is cool in other browsers.
here is the link http://theshortstoriesonline.com/amarnamrub/

Thanks

The issue is stemming from the slideInLeft class on the label housing the textarea. Removing that class actually remedies the issue. Specifically, it's the animation, as removing the -webkit-animation-name property from the class will fix the problem.

It looks like you're using a downloaded animation stylesheet. It may be more worth your time to just apply a patch, instead of trying to locate the root of the issue. One simple patch would be to put the border on the label and remove the border from the textarea. A couple inline styles and you'll be good to go.

Bob Hensley 20 Bob's Back!

I was just thinking about all of the unsolved threads, the ones that actually are solved, and I was thinking, maybe @Dani could add a 'Please Mark as Solved' button that users could click to notify the owner of the thread that they should mark it as solved.
Obviously, this could be abused, but if we put specific limitations on it, lets say, only let the user click it once, or limit its use to Moderators only, then maybe we could all help clean up the "unsolved" threads.

Just an idea.

I think the majority of those who leave threads unanswered are people who came here for the sole purpose of asking that question. They have little to no ambition to partake in, or care about, this community or any of its nuances.

Doogledude123 commented: Exactly why I think we should 'Invite' them back by asking them to Mark the Thread as Solved. +0
Bob Hensley 20 Bob's Back!

How do you create a spritesheet?

You would use a graphics editing application. Adobe Fireworks is popular for this, Photoshop is always a viable option, GIMP would be a free option, and the list goes on.

A spritesheet is simply one single image containing multiple sprites. Within the game you would load the single spritesheet and then only display one portion at any given appropriate time. It's more efficient to load into memory the single image than dozens more. Hence why spritesheets are used.

So keeping that in consideration: I would grid out the spritesheet into equal sections and ensure no one sprite exceeds said dimensions. Or at least not in a way you cannot effectively account for within your engine.

Bob Hensley 20 Bob's Back!

Hello Community,
I'm about to start making a website for someone. So what I'd like to know is does the website creator credit themself, like have my name in the footer of the page.

What is the right way to go about doing this?

Simple question is: are you being paid (be it salary or agreed-upon fee per-project) for this web site? If you are then you're likely giving whoever is paying you the right to use your code without any branding. Mileage will vary here, as it's possible to collect payment but still retain all rights and reservations, but that's less common.

Bob Hensley 20 Bob's Back!

I am about to make website, where explain my skills (if any), kind of portfolio.
I'd like to make two seperate choices in menu,
one for the client-side work (HTML, CSS, JS) and
one for the server-side work (PHP, SQL) seperately.

I thought of word "Coding" for client-side work.
But which word could I use for server-side work,
assuming visitor has no idea what the difference is.

I suppose you could use "design" and "development" for client and server, respectively.

Bob Hensley 20 Bob's Back!

Hi, i working on a profile system, each users has their public profile and its directory is in http://website.com/username but the proble is that my root is gonna get a bit messy if all folders of each user is created ther, so i want to put all users folder in a folder name users, but then the url be like http://website.com/users/username

Is it posible to some how when enter http://website.com/username still get the content of http://website.com/users/username

Thanks and sorry for my bad english

This is a good scenario for using Apache's mod_rewrite module. With it you can manipulate the URL and where it actually goes.

In this case you want to redirect everything to the users directory. Below is an example of how to do that. It checks to make sure the request isn't an actual file or directory first. If it is then you'll serve that and not a file in the users directory.

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*) /users/$1
</IfModule>

If the URL entered is (for example) http://domain.tld/someusername, this rewrite rule will actually serve http://domain.tld/users/someusername. The end-user will be none-the-wiser that their request is being modified internally.

Bob Hensley 20 Bob's Back!

Hi all,how do i link lets say thankyou.html page to my conatct.html page,so the idea is after submiting the page,by pressing the
submit button,the confirmation page should pop up. Thank you.

You would set the action attribute of the form element to "thankyou.html", if that's where you wish the form to submit to.

contact.html

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Form Example</title>
    </head>

    <body>
        <form action="thankyou.html">
            <input type="email" name="email" placeholder="Enter your email address." />
            <input type="text" name="subject" placeholder="Email Subject" />
            <textarea name="body" placeholder="Say something..."></textarea>
            <button type="submit">Send</button>
        </form>
    </body>
</html>

Part two - how to set up php so the request/submited page is sent to my email

There are many ways this can be done. I'll demonstrate one simple way:

Edit your contact form so that it points to the right file (thankyou.php, not thankyou.html- assuming a conventional web server configuration) and make it use HTTP POST instead of HTTP GET.

<form action="thankyou.php" method="post">

Then, in thankyou.php:

<?php

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $returnEmail = (!empty($_POST['email']) ? htmlentities($_POST['email']) : '');
    $subject = (!empty($_POST['subject']) ? htmlentities($_POST['subject']) : null);
    $body = (!empty($_POST['body']) ? htmlentities($_POST['body']) : null);

    if ($subject && $body) {
        mail('you@yourdomain.tld', $subject, "{$body}\n\nReturn email: {$returnEmail}");
    }
}

?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Form Example</title>
    </head>

    <body>
        <p>Thank you</p>
    </body>
</html>

What we're doing is checking to see if the page has been requested via HTTP POST (it will have been if the form was submitted). We then go through the fields we have …

Bob Hensley 20 Bob's Back!

Wow to Assembly!!

Yeah, ASM is rather cryptic to look at. And the simplist of tasks requires more work than you'd think.

Bob Hensley 20 Bob's Back!

If you really need these variables set in JavaScript then you might do the following:

var today = new Date(),
  nextMonth = new Date();

nextMonth.setDate(nextMonth.getDate() + 30);
Bob Hensley 20 Bob's Back!

Using mysqli_error () won't solve the problem. Rather, it'll aid in diagnosing it. What is the output received when you kill on mysqli_error? The PHP error you're receiving is due to a bad query, so the output of mysqli_error is critical.

Bob Hensley 20 Bob's Back!

Dear all, I would really appreciate your help and assistance with a bug i'm facing in myphpadmin Mysql table.

I have a table which is named as total amount. I also have a front end php. interface where i do my data entry from. When I enter for example (100000) it displays as its is, but I'm facing difficulty when i have to check my totals because i want when ever i eneter (100000) it should automatically display or store my data as (100,000) or if im entering an amount ( 54600) fifty four thousand six hundred it should diplay it ( 54,600) so the confusion doesn't occur in reading the amounts. I'm going to paste the coding of my php page and if you think there is anything i need to make changes from dreamweaver i will do that accordingly. thank you ! i really appreciate the effort. Thanks!

So you're asking how to format numbers (100000 to 100,000) with MySQL? If that's the case then this isn't an issue for your database. Number formatting should be handled at the application level. MySQL doesn't, and shouldn't, care how data is going to be interpreted or displayed. It's merely concerned with accurate and safe storage and retrieval of said data.

Given you're using PHP you can easily format your output via its number_format () function. Use that upon output of the number.

Also, there are far too many issues in your code for me to bother …

Bob Hensley 20 Bob's Back!

that seem to be a good plan. just one question what is ext?

$ext is referring to the file extension (.jpeg, .png, etc.).

Bob Hensley 20 Bob's Back!

Apple devices have unique user agents, all with their device name within it. For example, an iPhone 5 may have a user agent of Apple-iPhone5C2 (which, by the way, will be most USA-based iPhone 5 users). This can be taken advantage in detecting whether a visitor is using an Apple device. The following script will do just that:

<script>
//<![CDATA[

iosReg = '/apple-[ipod|iphone|ipad]/i';

if (navigator.userAgent.search (iosReg))
{
  // What do you want to do with the Apple device?
}

//]]>
</script>

Fortunately (or unfortunately, in this case) I am an Android user so I cannot test the validity of my RegEx pattern. But it should be fine.

Bob Hensley 20 Bob's Back!

$result = mysql_query($query) or die (mysql_error ());

Append the or die (mysql_error ()) clause to your query. This will print any errors stemming from MySQL. If you receive any then post what it is here. If you do not receive any errors then it's a logic error within your application flow or variable definitions.

Bob Hensley 20 Bob's Back!

thanks for the try =)
what i want is 1 value per column not two separated in any delimeter

So if one column contained 'hot' and the other contained 'dog' you'd want 'hotdog', correct? If that's the case then blocblue's solution is correct. Merely remove the delimiter from the CONCAT function.

SELECT
  CONCAT(a.col1, b.col1) AS fused
FROM table1 AS a
LEFT JOIN table2 AS b
  ON a.id = b.table_a_id
Bob Hensley 20 Bob's Back!

Are you constantly receiving this error or only after submitting the form? If it's constant then the problem lies with you not checking for form submission. Otherwise are you using the correct enctype attribute on the FORM element?

Make sure form submission has taken place prior to working with superglobals such as $_GET, $_POST and $_FILES

if ('POST' === $_SERVER['REQUEST_METHOD'])
{
  // work with the upload
}

Using multipart/form-data enctype

<form method="post" enctype="multipart/form-data">
Bob Hensley 20 Bob's Back!

I agree with radow here. There's nothing syntactically wrong with your rewrite conditions or rule. The HTTP 500 error you're receiving is likely because mod_rewrite is not enabled. Do you have any other configuration details in your .htaccess file that may be causing the 500 error? If not, I would change your rewrite body to this:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]
</IfModule>

If the 500 error stops occuring then you've confirmed mod_rewrite is not enabled. Either enable it in your Apache configuration or contact your host to do it for you.

Bob Hensley 20 Bob's Back!

Assuming $main_category_p is being set to $_POST['main_category']:

The problem is:

if($main_category_p == "Choose...")

The value attribute of the OPTION is what is sent via HTTP POST. Not the actual display text you're showing the client. That's arbitrary and has no implications beyond presentation. So, given your default value is actually "Choose one", that't what you'd want to be checking for in that IF statement.

Unfortunately, HTML5 doesn't support a placeholder element for SELECT statements. So avoiding this problem entirely is not possible. What I prefer to do, however, is to give the placeholder OPTION an empty value. Then, in PHP, check for a non-empty value. If it's empty, then the user chose the placeholder.

The HTML

<select name="main_cat">
  <option value="">Choose...</option>
  <option value="Apparel">Apparel</option>
  <option value="Home Decor">Home Deco</option>
  <option value="Beauty">Beauty</option>
</select>

PHP

$selected = $_POST['main_cat'];

if ( ! empty ($selected))
  echo $selected;
Bob Hensley 20 Bob's Back!

Break down exactly what you're doing and see if you can spot the logic problem.

if ( ! $email_p) 
{
  $forgot_error .= 'Error - Enter your email address';
}
else if (filter_var ($email_p, FILTER_VALIDATE_EMAIL))
{
  $forgot_error .= "Invalid e-mail address";
}

Your first statement is checking to see if $email_p is not defined; if it isn't, you shoot off the error message.

The second statement is checking to see if $email_p is a valid email address (by format, anyways). If it is, you shoot off an error message.

Do you see the problem now? Your logic doesn't line up with what you're trying to accomplish.

else if ( ! filter_var ($email_p, FILTER_VALIDATE_EMAIL))

Or

else if ( FALSE === filter_var ($email_p, FILTER_VALIDATE_EMAIL))

Whichever style you prefer.