cereal 1,524 Nearly a Senior Poster Featured Poster

It's a matter of time and patience, start little (20 minutes) and slow and increase five minutes per week, in few months you can run for an hour easily :)

cereal 1,524 Nearly a Senior Poster Featured Poster

I usually do 8 miles on treadmill 4 times a week at home, when I have enough time I do cross-country on a 12-14 miles distance. Run Forrest, run!

cereal 1,524 Nearly a Senior Poster Featured Poster

Sorry, I forgot to suggest you to change permissions:

chmod 775 -R /var/www

and to run newgrp:

newgrp www

this is used to add the new group to the session, otherwise you have to relog. The second command, of the above post, is used to add the group to the user:

sudo usermod -a -G www garrett

when you are in doubt you can use man command_name to access to the manual of the specified command, in this case man usermod so you can understand what is going on. For example if you want to be sure about the success of this command you can run:

groups garrett

this will output each group for the selected user.

cereal 1,524 Nearly a Senior Poster Featured Poster

Create a new group, for example www, change the group of /var/www directory and add your username, for example garrett, to this group:

sudo groupadd www
sudo usermod -a -G www garrett
sudo chgrp -R www /var/www

from this moment you will have write permissions inside /var/www.

cereal 1,524 Nearly a Senior Poster Featured Poster

You're welcome, if we have finished here mark the thread as solved. Bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

You can handle multiple applications but you have to change the structure, this it may help: http://codeigniter.com/user_guide/general/managing_apps.html

Note: Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want.

cereal 1,524 Nearly a Senior Poster Featured Poster

If any other problem occurs I'll try to explain it better, so maybe it will be easier to catch it. Thank you all again! Wonderful support!

cereal 1,524 Nearly a Senior Poster Featured Poster

Yes, now it's perfect! :D
Many thanks!

EDIT

just out of curiosity about JQuery: which bug was?

cereal 1,524 Nearly a Senior Poster Featured Poster

I think he is referring to the PHP graphic library, if so there is no direct relation between JQuery and GD. If you're using a debian based distro then use: sudo apt-get install php5-gd to install the library, but it should be already included in your PHP installation:

Since PHP 4.3 there is a bundled version of the GD lib. This bundled version has some additional features like alpha blending, and should be used in preference to the external library since its codebase is better maintained and more stable.

source: http://www.php.net/manual/en/image.requirements.php

LastMitch commented: Thanks for explanation! +5
cereal 1,524 Nearly a Senior Poster Featured Poster

Consider also HJ-Split, it's free and cross-platform and works fine.

cereal 1,524 Nearly a Senior Poster Featured Poster

Yes, I agree and obviously I don't insist and thank you all for your patience, but this is not XML.

This is the syntax for the configuration files of Apache servers. This kind of syntax is used inside httpd.conf, apache2.conf, .htaccess and the files used to configure virtual hosts.

For me it's not a big problem, because I know what is happening and now I will make more attention. But, for example, if in the PHP/Linux/Windows/Ruby/Python/Perl forums we want to paste the contents of a .htaccess file, modify it, suggesting rewrite rules, well when another user is going to copy, he will copy something wrong, that doesn't work because the raw view is altered.

Bye! :)

cereal 1,524 Nearly a Senior Poster Featured Poster

No, please check the link, in the Apache configuration file or in .htaccess files this is the correct syntax. For example, if you want to deny web access to a specific directory, let say test, you have to write:

<Directory /test/>
    Order Deny,Allow
    Deny from All
</Directory>

with the path inside the tag. The problem is given by the trailing slash which, in the raw view, is intrepreted like a shorthand.
This problem can also happen with Location directive: http://httpd.apache.org/docs/2.2/mod/core.html#location

cereal 1,524 Nearly a Senior Poster Featured Poster

Exactly, it isn't a shorthand, it's a directory path, maybe this will help to understand: http://httpd.apache.org/docs/2.2/mod/core.html#directory

cereal 1,524 Nearly a Senior Poster Featured Poster

I think it's related to inodes: http://www.linfo.org/file_name.html

cereal 1,524 Nearly a Senior Poster Featured Poster

Ok, then mark the thread as solved. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

@Dani works fine for me :)

<?php
Class Test
{
    public $hello = "hello world";
}

$a = new Test();
echo "$a->hello";
?>

@cssweb
check the suggested solutions, you have to change your tags if you want to use ordered lists, right now you are mixing a list and a table, this is wrong:

<table>
    <ol>
        <tr>
            ...
        </tr>
    </ol>
</table>
cereal 1,524 Nearly a Senior Poster Featured Poster

Same as JorgeM.

Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.78 Safari/535.11
cereal 1,524 Nearly a Senior Poster Featured Poster

You have two solutions, the first one:

$i = 0;
while($row = mysql_fetch_object($query))
{
    $i++;
    echo "
    <tr>
        <td>$i. $row->name</td>
    </tr>
    ";
}

The second is to print the list all inside one row:

echo "<tr><td><ol>";
while($row = mysql_fetch_object($query))
{
    echo "<li>$row->name</li>\n";
}

echo "</ol></td></tr>";

EDIT

I think Dani gave the right answer.. I was including it inside the table.. Bye! :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Notice their <Directory > has an extra space, and that is never closed.

No Dani, I'm sorry I cannot explain it better, English is not my first language. I didn't posted any malformed code, double click here:

<Directory />

The normal (beautified) view is correct. The raw output is wrong and different from what I originally posted and if you check the HTML output of this thread you can see the actual code. Look at this screenshot, this is what I wrote:

this screenshot

But after posting, this is the result (in the raw view): wrong_directory

This happens also in my previous posts of this thread. Anyway, I wanted to point out the problem because I thought the user who I helped in the cited threads, maybe just copied what I wrote and, since this can be done only by double clicking on the code block, he could have copied an alterated version.

Let me know if I have to explain it better, I will try if needed :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Yes I thought the same, but a week ago I posted a similar config file (I completely forgot to mention it while writing the first post) and I'm sure I didn't add a closing tag nor it was done by my IDE, as in that particular case I used leafpad to open the file and copy the contents, which are still right.

Anyway in the normal view the code is formally correct, because:

<Directory />

it is not a self-closing tag as <br /> but an Apache directive to set the root. In both cases the problem seems to be generated by the trailing slash, as example double click on this:

<tag /var/www/>
    hello
    some lines of code
    dum da dum
</tag>

Hope it's helpful.

cereal 1,524 Nearly a Senior Poster Featured Poster

Hello. The problem is in this post. First block of code, line 5 and line 9. I see a difference between normal view and raw view (on double click). In normal view line 5 appears like:

<Directory />

in raw:

<Directory ></Directory>

and the same happens on line 9. These are the screenshots:

normal view
raw view

I'm not sure if the enclosing tags where added here by daniweb scritps or by the author's post, but a part this, the problem is that the normal view is not displaying the same content. Also, apparently, I'm not able to reproduce the issue: posting the same code didn't create this difference.

Thank you for your attention.

Dani commented: Thanks for the catch +0
cereal 1,524 Nearly a Senior Poster Featured Poster

The only problem I see here is in the raw output of the default code block (double-click on the first block of code), I'm not sure if this is a daniweb bug or if it was already like this, maybe an IDE auto-correction. I'm referring to lines 5 and 9 where I see:

<Directory ></Directory>

and

<Directory /var/www></Directory>

change them with:

<Directory />
<Directory /var/www/>

and it should work. But anyway: the directory in which you have to place the files is /var/www not /usr/share/apache2/default-site. So move phpinfo.php to /var/www as stated in the configuration file.

cereal 1,524 Nearly a Senior Poster Featured Poster

Check my previous post about Apache config: http://www.daniweb.com/hardware-and-software/linux-and-unix/threads/434267/installing-php#post1864192

Or post what you've done and your configuration file settings. A part that, just place this code inside the script:

<?php
phpinfo();
?>

this function will generate all the layout needed to display the PHP configuration.

cereal 1,524 Nearly a Senior Poster Featured Poster

The url is requesting for user and password, if this is not your domain maybe it's a counter measure for hotlinking issues. If it's yours domain then just use server path, for example:

$image  = imagecreatefromjpeg('/var/www/dev/media/images/nohomepic.jpg'); 
cereal 1,524 Nearly a Senior Poster Featured Poster

@acfchinnababu read this link, you will find all your answers: http://www.fedorafaq.org/basics/

@amraiz.kiyani Aslam o alikum. Please open a new thread and explain better your problem.

cereal 1,524 Nearly a Senior Poster Featured Poster

In addition, I asked that question because if you are using curl, just change the settings, like:

curl_setopt($ch, CURLOPT_HEADER, 0);

and you will get just the XML part. Bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

How do you retrieve data?

cereal 1,524 Nearly a Senior Poster Featured Poster

A virus inside a usb stick doesn't have any effect into a linux machine, because the autostart.inf file is not considered and the eventual malware won't start without user action.

The problem is more related to permissions or settings: https://help.ubuntu.com/community/Mount/USB

cereal 1,524 Nearly a Senior Poster Featured Poster

If you deny direct access then you need a script to display file names and to provide a download option. For example:

<?php
$files = glob('./upload/*.*');
print_r($files); # print array
?>
cereal 1,524 Nearly a Senior Poster Featured Poster

If you are using Apache web server then use an .htaccess file, with this directive:

order allow,deny
deny from all

put this inside upload directory.

cereal 1,524 Nearly a Senior Poster Featured Poster

In FB you can upload images up to 2048 pixel per side, those will be resized to 960x720, which is the max size in the lightbox. But everything depends on your target and in the usage of these images inside your application. If your app, for example, needs to handle compositions and go to print them, then you can get images over 30000 pixel per side.

cereal 1,524 Nearly a Senior Poster Featured Poster
cereal 1,524 Nearly a Senior Poster Featured Poster

Try this:

<?php

$ok = '<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>'; # this is mix of input and a tags, it's not correct
$error = '<p>This is not the page you were looking for.</p>';
$con = @mysql_connect(my login stuff);
$connection_err = false;
mysql_select_db(more stuff);
if(!$con) { $error .= "\nConnection error". mysql_error(); $connection_err = true; }

echo ($c->is_admin != 'Yes' || $connection_err === true) ? $error:$ok;
?>
cereal 1,524 Nearly a Senior Poster Featured Poster

At the moment unityshell-rotated is not supported for 12.04, check these links for more information:

regarding libnux, the latest and available version is 2.0: libnux-2.0-0

cereal 1,524 Nearly a Senior Poster Featured Poster

This is what I do, I create a directory inside /var/www:

mkdir /var/www/mysite

there I will paste all the files, then I make a copy of /etc/apache2/sites-available/default file

cd /etc/apache2/sites-available
sudo cp default mysite

and go to edit this file by:

  • adding a ServerName
  • change DocumentRoot
  • change AllowOverride from None to All otherwise the .htaccess file will be ignored
  • change <Directory /var/www> to point directly to the location of the website directory, so: <Directory /var/www/mysite>

as suggestion check apache manual to understand how to edit the config file:

http://httpd.apache.org/docs/current/mod/core.html

the entire file will be:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName mysite.local

    DocumentRoot /var/www/mysite
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/mysite>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

then save the file, and back to the terminal run this command:

sudo a2ensite mysite

this enables the site, in order to disable use sudo a2dissite mysite and go to edit **hosts* file:

sudo nano /etc/hosts

inside the hosts file paste:

127.0.0.1   mysite.local

this is going to match the ServerName variable inside the configuration file, then reload the server:

โ€ฆ
cereal 1,524 Nearly a Senior Poster Featured Poster

Ok and what happens if you run sudo apt-get update? If it doesn't work then edit the sources.list file, some information here: http://forums.linuxmint.com/viewtopic.php?p=562087

cereal 1,524 Nearly a Senior Poster Featured Poster

@Garret85 to check if PHP is installed type php -v in the terminal, you will get the version. Bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe is the $md5Key, in your code:

$md5Key="44q9dn7WCUrLHgi8bPsdiBIlLi6WaHI0"; //MD5 key

but this doesn't seem a valid hash, for two reasons:

  • it's not lower case
  • there are invalid characters, an md5 hash is composed by hexadecimal numbers only, so: 0-9 a-f.

Now I'm wondering if this key is saved in the remote service and used to check data. If yes then it is probably giving an error.

cereal 1,524 Nearly a Senior Poster Featured Poster

Try also Dabangg, English title is Fearless.

cereal 1,524 Nearly a Senior Poster Featured Poster

This should continue here: http://www.daniweb.com/web-development/php/threads/433906/php-user-datails-display

Please don't open more than one thread on the same question. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Hi, you have to use a WHERE condition in your query to select only the data related to the logged user. For example:

select * from user_details where user_id = 12;

If you paste:

  • the query used to select the data to display
  • the tables structures (just run explain tablename or show create table tablename)
  • and the relations between the table queried in the login step and data tables

then it will be easier to help you.

cereal 1,524 Nearly a Senior Poster Featured Poster

Let's start from line 20:

if ($fld=='news_added') { $check = " where `inserted_date` = '$date' AND `news_added` = '$value' ";}

the problem here is that if this condition is false and the other two conditions (line 21 and 22) are true, $check variable will print only:

AND `code` = '$value' AND `id` = '$value'

without WHERE, this will give error on line 30, because the resulting query will be:

select * from `scrapes` AND `code` = '$value' AND `id` = '$value' limit 1

you should get an error at line 30 from die(mysql_error()). A part from this, if you want to update existing rows then you have to change the query on line 35 with an UPDATE statement.

cereal 1,524 Nearly a Senior Poster Featured Poster

It seems there is no driver but at the end it is suggested a PPA to install the drivers:

https://launchpad.net/~michael-gruz/+archive/canon-trunk

as alternative there is also a thread that explains how to use the drivers for the ip 2200 and make them work with the 1300, this is old but you can try with the updated versions:

http://ubuntuforums.org/showthread.php?p=3450617

Note the link in that thread to download the driver is broken, so use this:

http://software.canon-europe.com/products/0010231.asp

good luck!

cereal 1,524 Nearly a Senior Poster Featured Poster

Explain better please, you have to create a tool? Are you going to use GD, Imagick or something else?

cereal 1,524 Nearly a Senior Poster Featured Poster

Go to Settings ยป Accounts and Imports and click on Import mail and contacts. For more information you can follow this article: http://support.google.com/mail/bin/answer.py?hl=en&answer=117173

cereal 1,524 Nearly a Senior Poster Featured Poster

Check for any log available, if you are using Apache server check for acces.log and error.log, then search and check for any uploaded file/image. In order to limit defacements you have to sanitize data, any POST, GET, COOKIE, PUT request: you have to check if you are receving the expected kind of data especially for those variables which will print the input in the pages.

Keep in mind: if you have a form from where a user can upload images or files, do you check the mime (and the sizes regarding the image)? If no, then it's simple to upload a script and replace the pages.

Read these:

As suggestion, create a copy of the current site and logs so you can study the problem offline, then, update your code and replace it. A part this, without more details it's hard to help, bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Try:

name.strip().isalpha();

.strip() will remove spaces above and at the end of the string, .isalpha() will return true/false, you will get false if there is a space in the middle, to avoid that you can add .replace:

name.strip().replace(' ','',1).isalpha();

bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

In addition to deceptikon. Supposing you have a form field named gender which sends the data with POST method:

<input type="text" name="gender" />

This can work:

if(!in_array(strtolower(trim($_POST['gender'])),array('m','male','f','female'))
{
    $errors[] = ''; # message
}

if nothing is matching the array values then it sends an error. This can work also with select or radio buttons which, in my opinion, are better solutions.

cereal 1,524 Nearly a Senior Poster Featured Poster

Line 52 you forgot ; at the end of the value: $ans = "Real Glo"; // Answer to image.

Djmann1013 commented: Thanks! It really helped! +2
cereal 1,524 Nearly a Senior Poster Featured Poster

You can use get_browser() function or $_SERVER['HTTP_USER_AGENT'] to read the user agent of the clients and if there is a match with Google bots you will not run the query, something like:

<?php

$browser = $_SERVER['HTTP_USER_AGENT'];

if(!preg_match('/Google[bot]/i',$browser))
{
    # insert query here
}
else
{
    echo 'bot';
}

?>

the else statement is optional. Here's the list of Google bots user-agents: https://developers.google.com/webmasters/control-crawl-index/docs/crawlers