cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well normally your host would provide you with an admin panel for restarting your server but if however you have not been provided one then unfortunately the only way of turning on the server is by getting the host to use their master admin panel.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

bumpedy bump bump.
Is anybody going to reply?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Line 26 should be as follows:

echo <<<END
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You have a video game on your server!!!
Then what do you do, use remote desktop to play the game. I don't mean to be offensive but that seems rather odd. If I were you I would uninstall counter strike. But if you wish for your server to load a game without anyone playing it then you would need to use the system() function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you please add comments into your code so I can see how your code relates to your context. As it is your code looks totally different to what you are describing so please add comments into the code to make it more clear then I may be able to help.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php
$date=time();
mysql_query('INSERT INTO `table` SET `number_column`='.$date) or die(mysql_error());

$r=mysql_query('SELECT * FROM `table`') or die(mysql_error());
$data=mysql_fetch_assoc($r);
echo date('j/n/Y',$date['number_column']);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

My superstitious beliefs include the US government have a top secret Stargate program to travel distant worlds via a device called a "Stargate" made by the Ancients. Then they wrote a movie about it so no body would suspect it.
Another is if you stop dreaming of a night then your future isn't that bright. Then there is the more you cut your fingernails the shorter your fingers become.
At least that's what I think "superstitious" means.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

May I suggest to change the column type to bigint and instead of sending dates to mysql just sent the timestamp integer. Then you may use the php date function to retrieve it in any format.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Just found out the answer to the previous post... that sql didn't work due to the fact that sqlite2 doesn't accept the "IF NOT EXISTS" statement. But that leads to another question. Does sqlite accept regex? Because I am looking for a query like the following but in valid syntax.

SELECT * from sqlite_master WHERE sql LIKE /^*create table*$/i

So in that regex within the query it searches for the term "create table" case insensitive. Does anybody know how to do this as I'm new to sqlite?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

When your mobile phone is more powerful then your first computer.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I'm cooking a macgyver recipe. Here it is.
Ingredients:
* 2 cans of Coke and 3 cans of Pepsi
* A pack of ice cubes
* Some finely crushed candy

First step - turn on the BBQ and let it warm up on setting High. Put the ice on the flat plate of the BBQ then pore 2 cans of soft-drink on top. Then place the finely crushed candy on top of the ice. Then pore 2 of the remaining 3 cans on top of the ice. Now your neighbors will see a giant smoke cloud and you have one can of soft-drink to enjoy.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I see now. Ion cube appears to be a closed source encryption library which is used to encode php files. If the code you pasted above is ioncube then it looks like ioncube may be closed source. This will make it (2^128)% harder but not impossible to decode. Since how I'm the genius and algorithm freak of these forums I will see if I can get an algorithm done soon to decode ioncube code.

[edit]
I went to download the ioncube encoder and it costs $199 to buy. I bet I could make a better encoder for free. At that price I won't be able to write the algorithm to decode.
So why do you need this code decoded? Isn't it possible to just rewrite it from the html?
[/edit]

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Where abouts did you download it because I can't find any download link, official documentation or anything. And in fact this thread is the number one result in google.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then post the ion cube encryption function and I shall try and write a decryption function for you if possible.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and welcome to daniweb. Have you read the documentation for AWM menu because I'm sure all of your questions will be answered in the starters guide. So I would suggest reading the manual and if you still can't find the answer then post your attempted code here. And also please post a link to the api documentation and download. But keep in mind read the manual before doing this.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Or another option is to get javascript to store the information in a cookie. It is possible for javascript to make its own cookies containing up to 4KB of data.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have already read that page but its examples aren't very useful. However I have done a lot of research and is the following query a valid query with valid indexing?
Thanks

CREATE TABLE IF NOT EXISTS table_name (column_name1 INTEGER PRIMARY KEY, column_name2 TEXT UNIQUE, column_name3 INTEGER DEFAULT 0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php
if (isset($_GET['y'])) {
//do this
} elseif (isset($_GET['x'])) {
//do that
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

do you also use the pages from the books as a alternative for toilet paper :P

I never thought of that. Perhaps that's what I could do with my old books and newspapers. What a cheep free unlimited supply of toilet paper. Hope it's not too rough. :P

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is probably just an incompatibility bug because php 5.3.x is riddled with bugs. As for starters I would suggest downgrading your php version to 5.2.13 after that your bugs will most likely disappear is php 5.3.x has a few oop bugs which your error relates to.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and welcome to daniweb who's name I won't mention.
Could you please explain the question clearly and in more detail as I see more of a statement than a question in your post. So please explain in lets say 64 words minimum.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I believe it is php your wanting to use if the file is stored on the server.
There is a nice function called file_get_contents() and file_put_contents(). Below is an example of how to use them.

<?php
$file='path/to/file.txt';
$data=file_get_contents($file);
echo '<textarea name="text">';
echo $data;
echo '</textarea>';
if (isset($_POST) && !empty($_POST)) {
file_put_contents($file,$_POST['text']);
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,
Sorry if this is in the wrong forum but it appears daniweb doesn't have a category for sqlite or miscellaneous database systems. I have just started on a personal project which is an admin interface for sqlite (Like sqliteMyAdmin), similar to Phpmyadmin but for sqlite.

Anyways the question is how do I add indexes to a table when creating a table and what indexes are available for use. The only one I know of is PRIMARY KEY . Does anybody know?

Thanks
cwarn23

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I forgot about the how solved threads add to the stats. And yea I was going to leave it open for if I had more questions. I guess I'll just open another topic if I have more questions. Anyways *solved*

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Thank you times 1 million. Couldn't work out why every tutorial didn't work and of course the permissions. Glad to see somebody can always help even the most experienced.
Thanks ^_^

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To my knowledge changing the page print settings for when a user prints a page is done by javascript and css as it is client side. There isn't much that php can do to change the page printout settings other then echoing the javascript/css code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and welcome to daniweb. Could you please rephrase that in a way that directly addresses the problem your experiencing. It is hard to understand what the question is or what the problem is.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi all,
I have ubuntu and just installed sqlite then edit the php.ini file accordingly but for some reason the class named ¨SQLiteDatabase()¨ reports as undefined. The error is as follows:

Fatal error: Uncaught exception 'SQLiteException' with message 'SQLiteDatabase::__construct() [<a href='sqlitedatabase.--construct'>sqlitedatabase.--construct</a>]: unable to open database: /var/www/vhosts/cwarn23/base' in /var/www/vhosts/cwarn23/php.php:3 Stack trace: #0 /var/www/vhosts/cwarn23/php.php(3): SQLiteDatabase->__construct('base', 438, 'unable to open ...') #1 {main} thrown in /var/www/vhosts/cwarn23/php.php on line 3

And my script is

<?php
$dbname='base';
$base=new SQLiteDatabase($dbname, 0666, $err);
if ($err)
{ 
  echo "SQLite NOT supported.\n";
  exit($err);
}
else
{
  echo "SQLite supported.\n";
}

So does anyone know what would make sqlite behave in such a way? Also the tutorial I was following is at http://www.scriptol.com/sql/sqlite-getting-started.php
And yes I tried restarting apache after making changes to php.ini

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

51.2GHz on board

Yes it is a 3.2GHz 8 core with each core containing 2 threads.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you have a function named username() and a function named password()? Or is it you have variables named $username and $password? At the moment on line 68 and 69 &username = username() function and &password = password() function which I'm guessing do not exist. So try the following:

$stmt = $dbh->prepare("SELECT username, password FROM client WHERE username = :username AND password = :password");
          &stmt->bindParam(':username', $username, PDO::PARAM_STR);
          &stmt->bindParam(':password', $password, PDO::PARAM_STR, 40);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you please provide the related code and if your server has 32-bit Operating system or 64-bit. The example should be along the lines of the following.

<?php
mysql_connect('localhost','root','');
mysql_select_db('my_database');
$r=mysql_query('SELECT * FROM `table`');
$data=mysql_fetch_assoc($r);
echo $data['number'];
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I had this problem when making a search engine. The best solution is to make it run for a long period (say 8 minutes) and to schedule a cron job every 10 minutes. That way after 8 minutes your script will stop running then the server has 2 minutes of relaxation then at 10 minutes the script runs again continuing where it stoped. How to do this? There is a nice piece of software called cron. It allows you to schedule tasks which the computer starts for you one programmed in. In cpanel this is standard but on windows specialist software will need to be downloaded and/or purchased.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you please put more information into your question as it is hard to understand. Please explain further.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing line 31 with the following.

$done = $conn->prepare("INSERT INTO product_info (id, stock, brand, name, code, desc, story, cost, rrp, wt, size, top, fashion, active, lifestyle, sale) VALUES ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?')");

That is assuming all of the columns are strings. If any of the column types are integers then replace the value of the column with the number 0 and no quotes for integer columns. (By the way integer==number).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and I'm back. Now as for the solution sessions do use cookies for user identification. So if cookies are disabled then sessions are disabled. However there is a work around without changing the php.ini file at all and is as simple as changing the url of pages with sessions. Below is a example of how to setup the link url for each page in your website.

<?php session_start();

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>

Now as you see the defined variable 'SID' is inserted into the url. Then sessions will find this variable use it for user identification instead of cookies and will then be able to use sessions without cookies.

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I just come back from a long time with a broken internet and now I see a new design on daniweb. Is it just me or do you for some parts of text need to squint and other parts move to the opposite end of the room to read? I love the joke behind the new thread button making it a mile high. But as for my recommendation it is mainly the purple text that is the problem. On some pages I need to adjust the page size to 90% or 80% so that I don't need to step away from the screen to read it. So seriously could you reconsider resizing some of the text as it's really annoying.
Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I have a script which is meant to use all of my servers cpu but mysql will only use one core. I have 8 cores but only 1 core is being used. Does anybody know how to allow mysql to use multiple cores?
--------
Second question
How do I create tables in phpPgAdmin as I can only find how to create Schemes.
Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I just received my Ubuntu machine with 3.2GHz 7 core but now I need to install SQLite. Does anybody know where SQLite gets installed in Ubuntu or where itÅ› portable database files are stored as the php cms phpSQLiteAdmin requires me to copy a database file into the database directory. But I have no clue where it is and have been scanning my computer and the internet for hours. Does anybody know as any help would be greatly appreciated. Also this installation is just the regular sqlite and not sqlite3. And I am using Ubuntu 9.10
Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
RewriteEngine On
RewriteRule ^/?articles/([0-9]+)/([a-zA-Z0-9\-]+)$ /article.php?id=$1 [L]
RewriteRule ^/?articles/([0-9]+)/([0-9]+)/([a-zA-Z0-9\-]+)$ /article.php?id=$1&page=$2 [L]

RewriteRule ^/?topics/([0-9]+)/([a-zA-Z0-9\-]+)$ /topic.php?id=$1 [L]
RewriteRule ^/?topics/(.+)$ /sub-topic.php?topic=$1 [L]

RewriteRule ^/?authors/([0-9]+)/([a-zA-Z0-9\-]+)$ /author.php?id=$1 [L]
RewriteRule ^/?authors/([0-9]+)/([0-9]+)/([a-zA-Z0-9\-]+)$ /author.php?id=$1&page=$2 [L]

RewriteRule ^/?preview/([0-9]+)/([a-zA-Z0-9\-]+)$ /preview.php?id=$1 [L]
RewriteRule ^/?preview/([0-9]+)/([0-9]+)/([a-zA-Z0-9\-]+)$ /preview.php?id=$1&page=$2 [L]

ErrorDocument 400 /error?id=badrequest
ErrorDocument 401 /error?id=authreq
ErrorDocument 403 /error?id=forbidden
ErrorDocument 404 /error?id=notfound
ErrorDocument 500 /error?id=server
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That error means that you did some html or text output to the browser before the header function. So make sure there is no text output (eg echo function) before the header function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing the meta on line 10 with the following:

header('Location: '.$HTTP_SERVER_VARS['PHP_SELF'].'?id='$orderID); exit();
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this:

<html>
<head><title>My Portfolio</head>
<body bgcolor='#f1f1f1' text='#000000' link='#33cc00' alink='#33cc00' vlink='#33cc00'>

<table align='center' width='95%' bgcolor='#FFFFFF' style='border-color:#999999;border-style:solid;border-width:1px' border=0>

<tr>
<td align='center'>
<table width='100%'>
<img src='images/logo.png'>
</td>
</tr>
</table>
</table>
<br>
<table align='center' width='95%' bgcolor='#FFFFFF' style='border-color:#999999;border-style:solid;border-width:1px' border=0>

<tr>
<td align='center'>
<table width='100%'>
<font size='2' face='arial'><a href ="home.php">Home</a> | <a href ="2.php">Blog</a> | <a href ="home.php">Projects</a> | <a href ="">Contact</a></font>
</td>
</tr>
<td align='center'> <font size='2' face='arial'>
<?php
if (!isset($_GET['page'])) { $_GET['page']=''; }
$page = $_GET['page'];
if (!$page)

  $path = "inc/".$page.".php";
  if (file_exists($path))
include($path);

  else
  {
    echo "Sorry, This page does not exist, Please press the back button on your browser.";
  }
?>
</font>
</td>
</table>
</table>





</body>
</html>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
if (file_exists($path)) {

//or loop through files
foreach (glob("*.txt") as $filename) {
    echo "$filename size " . filesize($filename) . "\n";
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To limit it to 4 records then in addition to what I said before do the following sql query as well.

$query_latestJobPost = "SELECT * FROM tbljobad ORDER BY postDate DESC LIMIT 4";
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

try this:

<table>
			<?php while($assoc_latestJobPost = mysql_fetch_assoc($latestJobPost)) { ?>
			<tr>
				<td><?php echo $assoc_latestJobPost['jobTitle']; ?></td>
				<td><?php echo $assoc_latestJobPost['jobCategoryID']; ?></td>
				<td><?php echo $assoc_latestJobPost['postDate']; ?></td>
				<td><?php echo $assoc_latestJobPost['employerID']; ?></td>
			</tr>
			<?php } ?> 
</table>

where $latestJobPost being assigned by the mysql_query() function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why you don't agree with Will?

Because if the sha1 and md5 algorithms are cracked then the entire salt and encryption Will suggested can be cracked. However with my method part of the original hash has been destroyed with substr and you would need a lot of guess work before getting the decoded result. So therefore mine is more secure.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I agree with Gresham but beg to defer on the code an not concept.
Example:

function truehash($input) {
return hash('sha1',substr(hash('sha1',$input),4,-4).hash('crc32',$input));
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

PHP is a server side Pink Hypertext Preprocessor. Basically php processes content stored on the server before it is presented to the user. To get php you can google xampp or wamp and will allow you to view php files on your computer. As for dreamweaver, don't use it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why they market it as a 'decision engine' is beyond me, it doesn't appear to do anything new or any neat tricks... Unless I am missing something..

With Bling or Bing you can view the text on the links page without clicking the link just like viewing the first post of a topic on daniweb when hovering over the link.