cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I guess the curl option it is.
Thanks for the confirmation dani.

Hopefully I can code this website together within the next 2 weeks and I'll post a topic about the site when it's available as it will feature video tutorials, text tutorials, interactive examples, member repositories, a custom opensource project cms. I think it will be a big hit.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The website that I am making is intended for the daniweb audience as it is to piece together the missing features that daniweb will never have. I'm designing the login so that each user who has access to the repository on my site (like the sourceforge repository) where the user can use their daniweb login. However for the user to be qualified to login, they will need to have least 20 posts on daniweb and at least 1 post per day on daniweb as found on their profile. I have a curl script that can do the job but I thought I would ask first to make sure there there is no api.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I thought it would be a nice and handy tool to have but if nobody is going to use it or maintain it then I suppose there isn't much point on having it. O'well. I guess this idea has too bigger costs with too fewer benefits.
Thanks for you feedback anyways. I shall mark this as solved.

PS.
While the mods are all on here could you please take the time to visit my thread here.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

thanks sir it works...but why? can you explain sir?

Well basically when checking for the value of a variable (in this case checking in the if statement) you first must check if it's defined unless you know it's defined. So in this instance the variable $_SESSION was never given a value so it triggered an error. However when the if (isset($_SESSION) was put before it, php check if the variable had a value then php found out that no it didn't so false the if statment and didn't pass on any error messages.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing line 17 with the following if statement:

if(isset($_SESSION['uid']) && $_SESSION['uid']){
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well in the case of the most posts over a given period of time it shows not so much who gave the most posts as it does that too but rather it shows when the user peaked at making new posts and stopped making new posts. Or for example if you were to have a line for positive reputation, a line for negative reputation over time then you can see when the reputation was awarded and when the user was less abusive. So there are all sorts of things you can find out with charts that are harder to find out with numbers.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It would benefit us by being able to see which members are and have been contributing the most. Currently we can only see the stats captured for one point in time where as a graph would show them for a series of points in time. And I don't know about you but I think it would be interesting to compare my posts per day to someone else's for lets say the past month on a chart. If CPU is a problem I believe Javascript is capable of generating line graphs although it's hard to do and as an alternative to Javascript, there is Java and Flash. Also Google provides an API to generate charts so the chart is being rendered on Google's servers.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

For those who are reading those post and need an answer this post has been duplicated at the below link:
http://www.daniweb.com/web-development/php/threads/387424

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<form method="post" action="Search.php">
            <table id="search">
                <tr>
                    <td>
                        Search:  <input type="text" name="search" id="search" placeholder="Search for friends"/><td><input type="image" src="graphics/search.png" id="submit"/></td>
                    </td>
                </tr>
            <table>
        </form>

That is how you have a submit button which is an image button.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Or if you live in California then just drop by the phoenix foundation and Macgyver can fix it for you. I'm sure if you provide him a pin, some duct tape, blue tack and don't steal his Swiss army knife then I'm sure he can fix it in no time. In fact I saw Macgyver fix a motherboard in season three I think it was.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

There is a simple tutorial at the below link which will explain.
http://corz.org/serv/tricks/htaccess2.php
It is along the lines of the following but you will need to modify the code to suite your needs:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [NC]

Basically what it does is create a symbolic link for the matching path where the path matches the regex and if it matches the regex then it will load the file in the second parameter.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

,the poster looking for the graphic driver is not original poster

Darn, I wish people would stop doing that as it makes it harder to solve the question(s) which are being asked.

@manoj kumar 729
Perhaps you should post a new topic in the Windows XP forum and somebody then might be able to help you if you explain your problem in detail on a new thread that you have created.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean like the following?

<?php
session_start();
for($i=5;$i<=6;$i++)
{
$_SESSION['y']=$i;
$string = '<?php
$x='.$_SESSION['y'].';
echo $x;?> ';
$fp = fopen("$i.php", "w");
fwrite($fp, $string);
fclose($fp);
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Welcome to daniweb and glad to see that you at least made an effort to try and add code tags but obviously it didn't work for you. To use code tags you simply press the button that says code when posting then paste you code between those two tags.

As per your question, c++ does not allow for dynamic arrays so for example line 5 should be double* grades[5]; . Then you will need to adjust the rest of your code to fix your array problem since unlike languages such as php, you can't append to an array simply be grades[]= or at least to my knowledge.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Welcome to Daniweb and hope you enjoy the ride to victory. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php
$x=5;
session_start();
echo $x;
$_SESSION['y']=$x;

$string = '<?php 
session_start(); 
$x=$_SESSION[\'y\'];
echo $x;?> ';
$fp = fopen("6.php", "w");
fwrite($fp, $string);
fclose($fp);
?>
aaloo commented: he really undrestood my problem very fast +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Thanks for the answer, that's definitely good to know. However, I have never seen a | being used inside a regex (in that place, I have of course seen it being used inside a pattern with the meaning this "or" that). What's the use of it behind a section?

Yes in regex it also acts as an "or" statement so you can have multiple regex patterns between the "or" statements.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Indeed. I used to have Windows 98 SE only about 8 years ago with 200MHz of CPU and it did pretty good on the internet. I know the internet has changed since meaning that the internet requires more CPU and ram to use these days. Eg. My netbook 400MHz is barely able to surf Wikipedia and you will find that new features on the web today such as Javascript, Java, Flash, CSS version 3 will slow down your processing time or will simply be too intense to enable. However judging by as you say a 1.53GHz processor (I shall assume single core as this is probably an old computer) then you should be able to execute Javascript and CSS however you may find some Java apps and Flash scripts may not load correctly. And as long as you keep on deleting files in C:\windows\temp\ which are older than 1 month you should be fine for over 3 years. Also if you were to sign up to a new ISP I would recommend one with at least 128kbps to get the maximum benefits of your processor.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing line 10 with the following:

echo '<ul style="list-style-type: circle;">';

It may be just a simple css problem which is hiding the bullets.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Ruby is a dynamic, reflective, general-purpose object-oriented programming language which combines syntax inspired by Perl with Smalltalk-like the features.

Ruby supports multiple programming paradigms, including functional, object oriented, imperative and reflective. It also has a dynamic type of system and automatic memory management; it is therefore similar in varying respects to Smalltalk, Python, Perl, Lisp, Dylan, Pike, and CLU.

So I take it that Ruby isn't the language that those in Rugby spoke. To me the name sounds like if a bunch of Rugby players decided to put their Rugby language into a computer and then you got yourself a powerful programming language. ;)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i want to download the graphics, audio drivers for mercury pi 1.0 version type motherboards

Perhaps you should get a direct link to the exe file from another computer instead of a link to the download website so that internet explorer won't need to phrase any javascript.
For example: http://example.com/downloads/get/game.exe instead of the download page in the browser address bar.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I think you would want dateTimer on the X-axis and speed on the Y-axis. Would make more sense that way. But the way you have dateTimer in the mysql database as a date type rather than an int will make it harder to plot onto the graph. I might let ardav sort that one out. But I will help out with the theoretical stuff.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php
$string='Phone 111 (111) 1112 to get this for 75% off - Call Now. Offer open to 5pm only full price after 5.';
preg_match_all('@[^a-zA-Z]{7,}@is',$string,$matches);
$matches=$matches[0];
foreach ($matches AS $key=>$match) {
$matches[$key]=preg_replace('@[^0-9]@s','',$match);
}
echo '<xmp>';
print_r($matches);
echo '</xmp>';
?>
jonesa01 commented: Perfect it was exactly what I was looking for! +1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

ow now I see. I'll work on that regex

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Took a look and my buffer size is only the normal 0x00000064 (100):(. I thought it would be like 16bit at least:( stupid Microsoft.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

if(mysql_num_rows($result)>0){
    $user = mysql_fetch_assoc($result);
    echo '<h1>Welcome, ';
    echo $user['Name'];
    echo '</h1>';  
}else{
    header("location:login.html?msg=$msg");
}

And on login.html you will need to place the javascript message instead of the page with the header redirect.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php if(!defined('CORE')) exit(0); function jspack(&$s){	$s = preg_replace(array('/\r\n/s','/\n/s'),'',$s); } ?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

When it comes to encoding php code there are two options. You can use a free php script such as pobs and it will jumble up the code in a way that will make it impossible to read then anybody trying to edit it will be facing a nightmare. There are commercial alternatives such as ioncube where it is harder to crack because you have to buy it to gain access to the encoder. However in my opinion the free pobs is just as good.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I think what he is saying is you should start off with the basics before going to the advanced. It's obvious your not ready for arrays yet nor are you ready for variable definitions yet. I would strongly suggest following the tizag tutorials and after you have completed them then you will soon realize really quickly what you have done wrong as this is the very basics of PHP.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php 
$r=mysql_query('SELECT * FROM `table` ORDER BY `num` ASC') or die(mysql_error());
$prev='';
while ($row=mysql_fetch_assoc($r)) {
if ($row['num']!=$prev) {
    $i=0;
    echo $row['num'].'-A<br />';
    } else {
    $i++;
    echo strtoupper(dechex($i+10)).'<br />';
    }
$prev=$row['num'];
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So did you want php to place the contents into a pdf or did you want crystal reports in Visual Studio to create the pdf? PHP has a pdf library which can be found at http://au2.php.net/manual/en/book.pdf.php For examples on the pdf module embedded into google I would suggest a simple google search.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Isn't a speed graph just distance over time which makes x=y making a perfectly diagonal line?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean phpmyadmin?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

> but I would like to know that I haven't been abandoned.

Maybe because those who visit the feedback section are not too much into fancy graphs and charts? Honest question: given the kind of resource investment (programming/hardware/maintenance) this requires, what does adding this/these features buy to the site as a whole?

I can't speak for others but I'm pretty happy with giving the solved thread/reputation points a passing glance. Too many details presented would be an overkill IMO for both the parties.

I'm talking about expanding this page by providing several more stats pages as we have very little insight as to what the stats of daniweb are. So the stats wouldn't be all around the site but together on a group of pages (some cached weekly) dedicated to the stats of the site so users have to actually go to the Top Members by Rank to view them. Or perhaps instead of what I suggested you could have an ajax feature on the Top Members by Rank where users can make their own line graphs by specifying specific variables over a specified time frame and a graph is produced.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php 
$r=mysql_query('SELECT * FROM `table` ORDER BY `num` ASC') or die(mysql_error());
$prev='';
while ($row=mysql_fetch_assoc($r)) {
if ($row['num']!=$prev) {
    echo $row['num'].' ';
    }
echo 'G<br />';
$prev=$row['num'];
}
?>

Don't forget the replace 'num' with the column name.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

why hasn't anybody replied to this? I understand dani is a very busy person especially with this new Panda update but I would like to know that I haven't been abandoned.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Sounds like just some Javascript errors. I would suggest upgrading to the latest version of Internet Explorer or getting another browser such as Firefox or Chrome and the errors will most likely disappear.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why not just use the following???

$str='sd;6sd,af98asd^f76asdf087%45098afsln&k257sdpk235';
$phone=preg_replace('@[^0-9]@','',$str);
echo $phone;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well one thing is for sure and that is Computer Science is theoretical and Software Engineering is absolute.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

As per the first part of the question which is setting how long until the session expires or time-outs you can use the following code to adjust when it time outs. The first setcookie function will adjust it to a specified time (1 year) and the second set cookie function will set it to infinite time or whenever the browser is closed.

$second_till_timeout=60*60*24*365; //one year
setcookie ('PHPSESSID',$_COOKIE['PHPSESSID'],time()+$seconds_till_timeout); //until specified

setcookie ('PHPSESSID',$_COOKIE['PHPSESSID'],2147483647); //forever

And yes the php session does make a cookie called PHPSESSID which is what makes the session ends and this is what we are adjusting.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I'm creating a tutorial + repository website where the tutorials are free for the public to look at but the repository is not. However I am developing a login system that I want to sync with daniwebs login system. I have developed a curl system where the user can enter in their password to my site and curl will check if it can log into daniweb but before I go ahead and use it, is there an api for daniweb to check if an account is valid? All I need to know is if the input username and password is valid and if it is valid then how many posts the user has and how many posts per day the user has. I'm not sure if daniweb already has such an api in existence so I thought I would ask.

Thankyou.

Rashakil Fol commented: I am adding positive reputation for this post to undermine the reputation system. +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<h2><center>Product Preview</center></h2>
<p></p>

<?php 

$result = mysql_query("SELECT * FROM produk AS p, kategori AS k WHERE id_produk='".mysql_real_escape_string($_REQUEST['id'])."'AND p.id_kategori = k.id_kategori") or die(mysql_error());
$dataCOMBO = mysql_fetch_array($result);


?>

<form method = "POST" enctype="multipart/formdata" action = "<?php $_SERVER['PHP_SELF']; ?>"> 
<table border="0" cellpadding="2">

        <tr>
        	<td>Nama</td>
        	<td><input name="nama" type="text" value = "<?php echo $dataCOMBO['nama_produk']; ?>" size="20" />
        </tr>
        <tr>
        	<td>Kategori</td>
         	<td><select name="kategori"><option value="<?php echo $dataCOMBO['nama_kategori']; ?>" selected><?php echo $dataCOMBO['nama_kategori']; ?></option> 
			<?php 
			$resultCOMBO = mysql_query("SELECT nama_kategori FROM kategori WHERE id_produk!='".mysql_real_escape_string($_REQUEST['id'])."' OR p.id_kategori != k.id_kategori") or die(mysql_error());
			while($dataCOMBO = mysql_fetch_array($resultCOMBO)){
		         echo "<option value={$dataCOMBO['nama_kategori']}>{$dataCOMBO['nama_kategori']}</option>";
			}?>				 
			</select>            
            </td>

       </tr>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To my knowledge another problem with that code is that the HTTP_REFERER does not always populate with a value. Sometimes it equals a blank value if the user has disabled sending that information in their browser. So it is best not to use HTTP_REFERER as some users will experience difficulties in your website due to having HTTP_REFERER disabled in their browser.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I have a 3d model (.obj) with 3 textures applied to it and it consists of just over 96,000 vertices. But I want to be able to put it into a gaming engine which is limited to 65536 vertices. I have discovered a loop hole in the gaming engine where the number of vertices that the game can process is only how many vertices are assigned to a single texture. So basically I need every texture to have less than 65536 vertices assigned to it which currently is not the case. Can somebody recommend to me a program that will convert my obj model to another obj model with many more textures but the new textures have less than 65536 vertices attached to each texture in the model?

Thankyou
cwarn23

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you have solved it then please mark this thread as solved otherwise please post the full code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Sounds like you may have overloaded a keyboard buffer.

That or Google sends how many words per minute you type in google crome to their servers as a single 8bit character and I managed to exceed the 8bit limitation.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Actually lines 21 to 23 can be deleted because those variables are assigned the same values at the start of the script.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well the error is in a piece of code you haven't posted (before line 112 not posted) and is usually caused by a missing quote after a string. For example:

$variable = "this is wrong;
//30 lines later
echo "hello world";

That is what you have done in your script and you will need to find where you forgot the quote. Unfortunately php does not report the line of the missing quote but rather the line that it causes problems which in my example would be line 3 instead of line 1.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well it is possible to do if statements in regex like the following:

RewriteRule ^/?([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/|)|)|)|)|)|)$ index.php?a=$1&b=$3&c=$5&d=$7&e=$9&f=$11&g=$13

And in that regex up the 7 forward slashes may be used with [\w]+ between them. It will dynamically match from 1 forward slash to 7 foward slashes. But keep in mind for it to work you will need it to match [\w]+.