Squidge 101 Newbie Poster

hi everyone.

been a while since i have been on here, alot has changed.

I am in the middle of amending/adding features to an installer using python.

I have the dropbox API (for business) set up and working, upload and downloading without issue.

The potential issue i see is during the progress of either up/down the CLI sits, does nothing.

So my question is (as i am still finding my way with all that is Python), how can i add a progress bar?

For download and can use the API call to get the metadata file_size if that helps?

PS, I am not sure if i oisted this in the right thread

Squidge 101 Newbie Poster

As Gerbil has suggested, use the administrator account to reverse it

you will need to have an administration-rights account

Squidge 101 Newbie Poster

Try

cacls virus /t /g Everyone:f

Removing the /e switch will replace the ACL instead of editing it, else try loading a WinPE env, and running CACLS from there

Squidge 101 Newbie Poster

80gb is ample for Win7. Typically W7 x86 will use just under 8GB, x64 i beleive from memory is about 13/14GB

Squidge 101 Newbie Poster

Here is a script that you could try:

http://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days

Or you could opt for powershell

Squidge 101 Newbie Poster

i would suggest you scheduled tasks

Squidge 101 Newbie Poster

After much head banging. I changed approach and used my working VB Script and the unattend.xml FirstLogonCommand.

Squidge 101 Newbie Poster

Hi all, its been a while since i have been on DW.

I have started tasking MDT deployment.

The issue i have is i need to capture a user input, for example a custom serial number.

This will then be passed into the registry hive for OEM'ing.

I have a VBS file that does all of this, the only thing is a standard VBS file cannot be used in the MDT Wizard.

Any ideas how this can be done?

I have looked at the Wizard editor, but there is no supporting documentation what so ever.

Squidge 101 Newbie Poster

your missing "PHP" from your tag:

echo ?> <a href="form.html">Click here</a> to try again. <? ;
Should be:

echo ?> <a href="form.html">Click here</a> to try again.
<?php

Or change the line completely:

echo "<a href='form.html'>Click here</a> to try again";

Squidge 101 Newbie Poster

Check your ENV path.

Squidge 101 Newbie Poster

show what code you have.

Squidge 101 Newbie Poster

I am a little confused.

Why would you display info from the database, to then copy it back to the database???

Am i missing something here? :)

Also you have a mix of MySQLi and MySQL.

Squidge 101 Newbie Poster

It is also stated in the forum rules as well :)

albanclesh commented: sorry! i didn't read the forum rules before +0
Squidge 101 Newbie Poster

That is because your code is upper casing the first letter, then making them all lower case

Swap these around:

ucwords(strtolower(

to be:

strtolower(ucwords(

http://php.net/manual/en/function.ucwords.php

Squidge 101 Newbie Poster
while($row = mysql_fetch_array($result))
{
    $txtname = ucwords(strtolower($row['First.Name'])) . '-' . ucwords(strtolower($row['Last.Name'])); 
    $newstring = str_replace(" ", "-", $txtname);

    echo'<div class="cat-post-desc"><h3>
        <a href="' . $newstring . '.php">' . $row['First.Name'] . ' ' . $row['Last.Name'] . '</a>
        </h3><p></p></div>';

} /** <-- You need to close your while loop

And include the $txtname & $new string in your loop

Squidge 101 Newbie Poster

This line:

$txtname = "'. ucwords(strtolower($row ['First.Name'])) . '-'. ucwords(strtolower($row ['Last.Name'])) . "; 

should be:

$txtname = ucwords(strtolower($row['First.Name'])) . '-' . ucwords(strtolower($row['Last.Name'])); 
Squidge 101 Newbie Poster

you have a mix of $_GET and $_POST in the same scripts! One or the other fella :)

Here is a simple gallery tutorial, identical to what you are trying to do :
http://www.sitepoint.com/php-gallery-system-minutes/

Squidge 101 Newbie Poster

if you dont have PHP in your env variables, you need to use the full path to PHP

Squidge 101 Newbie Poster

Are you sure your POST data is populated?
try dumping the content of POST: var_dump($_POST);

Squidge 101 Newbie Poster

post the code

Squidge 101 Newbie Poster

PM'd

Squidge 101 Newbie Poster

@cmps,

Sorry i think i had miss undrstood what you were after ^_^.

Squidge 101 Newbie Poster

prestashop is good for ecommerce - in my opion :)

Squidge 101 Newbie Poster

@JorgeM,

Backticks are requied when the naming is a reserved MySQL word.

http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html

Squidge 101 Newbie Poster

have you set your DB column for the Username as UNIQUE?

you will also need to compare $username to an array of stored usernames from the DB

Squidge 101 Newbie Poster

could you not use a pop out window?

Squidge 101 Newbie Poster

have a look at the upload file from line 75 onwards, this is well documented on how this works, if you read the comments.

Use $dir_dest to set your upload directory

eg:

$dir_dest = "my_path_to\my_destination\Folder\";

// ---------- SIMPLE UPLOAD ----------

    // we create an instance of the class, giving as argument the PHP object
    // corresponding to the file field from the form
    // All the uploads are accessible from the PHP object $_FILES
    $handle = new Upload($_FILES['my_field']);

    // then we check if the file has been uploaded properly
    // in its *temporary* location in the server (often, it is /tmp)
    if ($handle->uploaded) {

        // yes, the file is on the server
        // now, we start the upload 'process'. That is, to copy the uploaded file
        // from its temporary location to the wanted location
        // It could be something like $handle->Process('/home/www/my_uploads/');
        $handle->Process($dir_dest);

        // we check if everything went OK
        if ($handle->processed) {
            // everything was fine !
            echo '<p class="result">';
            echo '  <b>File uploaded with success</b><br />';
            echo '  File: <a href="'.$dir_pics.'/' . $handle->file_dst_name . '">' . $handle->file_dst_name . '</a>';
            echo '   (' . round(filesize($handle->file_dst_pathname)/256)/4 . 'KB)';
            echo '</p>';
        } else {
            // one error occured
            echo '<p class="result">';
            echo '  <b>File not uploaded to the wanted location</b><br />';
            echo '  Error: ' . $handle->error . '';
            echo '</p>';
        }

        // we delete the temporary files
        $handle-> Clean();

    } else {
        // if we're here, the upload file failed for some reasons
        // i.e. the server didn't receive the …
Squidge 101 Newbie Poster

the above coding is from the sample of the download, and runs fine for me, so have you changed something in the sample?

Looking at the script it is from 2010, and aklot has changed since then.

May i ask what part of the script are you wanting to use? single upload? Multi upload? etc

Squidge 101 Newbie Poster

Any hints on the error/bunch of code??

Any hints on how you are trying to use this script?

Squidge 101 Newbie Poster

Are you trying to use http://nohs instead of http://localhost ?

If that is what you aretrying to do, you need to create virtual hosts and edit the local host file

Squidge 101 Newbie Poster

Where is your database connection?

Squidge 101 Newbie Poster

Also be aware of the curve of the earth, as this will come into play and distances like this.

Squidge 101 Newbie Poster

@yachile,

Really???

I have never in 15 years seen an email address that looks like this!!!

Squidge 101 Newbie Poster

If you have a script that will inform, you could use CRON to run the script every week to send emails notification.

That assumes you have access to CRON (linux platrfom)

Squidge 101 Newbie Poster

Or include the file that has the function :)

Squidge 101 Newbie Poster

PUT THE CODE IN THE POST!!!

Squidge 101 Newbie Poster

Whats in the header.php?

Please post the code using the CODE part of the post syntax

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

Has your first Parse error gone?

Did you change, as has been advised, the short tags?

<td width="10%"><? echo $rows['id']; ?></td>
<td width="30%"><? echo $rows['name']; ?></td>
<td width="30%"><? echo $rows['lastname']; ?></td>
<td width="30%"><? echo $rows['email']; ?></td>

To be:

<td width="10%"><?php echo $rows['id']; ?></td>
<td width="30%"><?php echo $rows['name']; ?></td>
<td width="30%"><?php echo $rows['lastname']; ?></td>
<td width="30%"><?php echo $rows['email']; ?></td>

Does the user you are using in the DB connection have access to the database? Is the table created?

Also change your lines:

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

to:

mysql_connect($host, $username, $password)or die("cannot connect");
mysql_select_db($db_name)or die("cannot select DB");
Squidge 101 Newbie Poster

Also move line 53 out side of your php tag to line 56.

Or change it to

echo "</table>";
Squidge 101 Newbie Poster

Is there away of updating PHP in XAMPP?

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

Should this line:

$this->stmt =execute(array('$this->getName()','$this->getNO()','$this->clocation()'));

Be:

$this->stmt =execute(array($this->getName(),$this->getNO(),$this->clocation()));
Squidge 101 Newbie Poster

Change these to protected or public:

private $name;
private $cno;
private $clocation;

Having them set to private means they cannot be overwritten (if i remember)

EDIT
Also check that you DB is connecting

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

stay away from projects until you have a good understanding of the code that you are doing, or using from other places.

Squidge 101 Newbie Poster

try using the FQDN and image.

Example : http://www.example.com/images/email_header.jpg

Squidge 101 Newbie Poster

Is Outlook set to receive HTML emails?

This is not the default setting, normally it is plain text

Squidge 101 Newbie Poster

http://www.php.net/manual/en/image.installation.php

GD would have to have been installed during PHP compile.

If you use PHPINFO() it will tell you if GD is installed.

<?php
    phpinfo();
?>

Save it as a page, upload the file, and use your browser, it will show you loads of info, use browser find function to see if GD is there

Squidge 101 Newbie Poster

@Pritaeas,

You are a legend.

I carried on testing and resolved the issue with the __construct:

The class:

include 'crud.php';

class navigation {

    public function __construct($username, $password, $tableConfig) {
        $this->username = $username;
        $this->password = $password;
        $this->tableConfig = $tableConfig;
    }

    public function nav($table, $live, $loc) {
        /**
         * nav returns multiple records from the specified table with conditions
         * @param string $table Table name
         * @param array $live Set in DB condition to show page 1 = Live, 0 = Not Live
         * @return array $loc Set in DB shows location of page in Nav 1 = Top, 0 = Side
         */

        $dsn = new crud($this->username, $this->password, $this->tableConfig);
        $nav = $dsn->getRecords($table, array('live' => $live, 'loc' => $loc));
        $result = count($nav);
        $cnt = 0;
        $navKey = '<nav><ul>';
        while ($cnt < $result) {
            foreach ($nav[$cnt] AS $key => $value) {
                if (is_numeric($key)) {
                    unset($key, $value);
                } else {

                    if ($key != 'id' && $key != 'content' && $key != 'live' && $key != 'keywords' && $key != 'metaDesc') {
                        if ($key == 'title') {
                            $navKey .= '<li><a href="#">' . $value . '</a></li>';
                        }
                    }
                    unset($key, $value);
                }
            }
            $cnt++;
        }
        // Facebook include and G+1 code -> see main code page -> put into sep include files for ease of modification
        $navKey .= '</ul></nav>';
        unset($dsn);

        return $navKey;
    }
}

And the call:

$navigat = new navigation('XXXXXXXXuser', 'XXXXXXXXXX', $tableConfig);

$top = $navigat->nav('content', 1, 1);

print_r($top);