DeathStar
-
Posts
529 -
Joined
-
Last visited
Never
Posts posted by DeathStar
-
-
Thats very useless to do.
Why would you want to do that?
-
thankyou
-
Hello I'm busy making an disk usage graph.
I know how to do the Image generation, basicly i know how to do everything, just a complication with some calculations.
Based on my knowledge:
8 bits in a byte.
1024 bytes in a kilobyte.
1024 kilobytes in a megabyte.
1024 megabytes in a gigabyte.
1024 gigabytes in a terabyte.
What would be the best formula to divide the units from eachother.
I can display and work with the total amount of bytes that php displays.
But i have a section where you can look at the mb, gb, tb.
Any help ?
-
Oh, okay.
Sorry.
you did not read my post wont work with any loop that function dont you think i would off joke lol.
-
I would rather make it check with a foreach loop.
Much less scripting and much faster.
-
It is Internet.
And how do you want to display the calender?
You can use a simple loop:
while($data = mysql_fetch_array($query)){ if ($data['blocked'] == TRUE){ echo '<p class="red">' . $data['time'] . '</p>'; } else { echo '<p class="normall">' . $data['time'] . '</p>'; } }
Or you could just edit that structure into a week and change the loop a bit:
while($data = mysql_fetch_array($query)){ echo '<tr><td>' . $data['time'] . '</td><td>' . $data['time2'] . '</td><td>' . $data['time3'] . '</td><td>' . $data['time4'] . '</td><td>' . $data['time5'] . '</td><td>' . $data['time6'] . '</td><td>' . $data['time7'] . '</td>'; }
Just put the if statements in.
-
The header tags is used for things like captcha and things you do not want the users browser to save.
The reason people do not use it on normal pages is so that the images and things get cached, and saves them valuable bandwidth.
So it really isn't secure/non-secure if you ask me.
-
Does look like it.
I really suggest you do not let any file trough.
It could be a shell they upload, and lets them alter files and execute commands.
-
Dan gee ek help.
You can simply put that code where you want to display it.
But you need to modify the query according to your database.
row - the entries of the row you want to count.
table_name - the table where the row lies in.
-
Hello.
Well it is vacation, meaning I have nothing to do.
So I am offering to do work for free.
I have 9 months of knowledge in PHP and MySQL.
I will not work if it is just a simple script you need.
I will not work if you have a 'PuNkY' attitude, I simply deal with people who know what they want.
My Contact E-Mail address is mrhapl0v9.6@gmail.com.
My MSN is narco-tic@hotmail.com, please just attach a message about this when sending invitation.
-
Firstly, No one is a 'noob' they are simply beginners.
for the counting you can do COUNT or num rows.
Example of Count:
$query = 'SELECT COUNT(row) FROM table_name WHERE cat=' . $cat; $do = mysql_query($query); echo $do['row']; // Output: 5
Example of num rows:
$query = 'SELECT row FROM table_name WHERE cat=' . $cat; $get_rows = mysql_num_rows($query); echo $get_rows;
The IP based system could be bypassed, many people use proxies these days.
Hope that helps.
-
Well, I have been trying to make an ajax loading screen, I have it working, just not automatticly loading.
I got it closing, Just need it to load.
Here is the ajax(its from a tutorial, then edited):
var LoadingScreen = { hide: function() { var div = document.getElementById('loading_message'); if (div == null || div == '' || typeof(div) != 'object') { return false; } document.body.removeChild(div); }, moving_dots: function() { var div = document.getElementById('loading_message'); if (div == null || div == '' || typeof(div) != 'object') { return false; } var html = div.innerHTML; // Add dot or start over? var num_dots = html.split('.').length-1; if (num_dots > 6) { div.innerHTML = '<b>Please wait.</b><br />Loading'; } else { div.innerHTML = html + '.'; } }, set_position: function () { var div = document.getElementById('loading_message'); if (div == null || div == '' || typeof(div) != 'object') { return false; } var scrollTop = LoadingScreen.f_scrollTop(); var scrollLeft = LoadingScreen.f_scrollLeft(); var clientWidth = LoadingScreen.f_clientWidth(); // Calculate left position var left = clientWidth - div.offsetWidth; left = scrollLeft + left; // Set position div.style.position = 'absolute'; div.style.left = left + 'px'; div.style.top = scrollTop + 'px'; }, create_div: function () { var div = document.createElement('DIV'); div.id = 'loading_message'; div.innerHTML = '<b>Please wait.</b><br />Loading'; var css = "border: 1px solid black;" css += "font-size: 10px;" css += "font-family: Tahoma;" css += "width: 100px;"; css += "padding: 10px;"; css += "background-color: #FFFFFF;"; css += "color: black;"; css += "font-weight: none;"; div.style.cssText = css; document.body.appendChild(div); return div; }, f_clientWidth: function () { return this.f_filterResults ( window.innerWidth ? window.innerWidth : 0, document.documentElement ? document.documentElement.clientWidth : 0, document.body ? document.body.clientWidth : 0 ); }, f_scrollLeft: function () { return this.f_filterResults ( window.pageXOffset ? window.pageXOffset : 0, document.documentElement ? document.documentElement.scrollLeft : 0, document.body ? document.body.scrollLeft : 0 ); }, f_scrollTop: function () { return this.f_filterResults ( window.pageYOffset ? window.pageYOffset : 0, document.documentElement ? document.documentElement.scrollTop : 0, document.body ? document.body.scrollTop : 0 ); }, f_filterResults: function (n_win, n_docel, n_body) { var n_result = n_win ? n_win : 0; if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel; return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; }, addEventHandler: function (oTarget, sEventType, fnHandler) { if (oTarget.addEventListener) { oTarget.addEventListener(sEventType, fnHandler, false); } else if (oTarget.attachEvent) { oTarget.attachEvent("on" + sEventType, fnHandler); } else { oTarget["on" + sEventType] = fnHandler; } } } function load_show(){ // Create Loading div LoadingScreen.create_div(); // Set initial position LoadingScreen.set_position(); // Attach event handler to onScroll to keep in position LoadingScreen.addEventHandler(window, 'scroll', LoadingScreen.set_position); // Start the moving dots setInterval(LoadingScreen.moving_dots, 500); }
To start I use the load_show() function.
To hide, LoadingScreen.hide()
-
Hello.
I need a way, in php to automatically run a js function when the page is entered.
I cannot use onload, because I need it to run be fore anything loads.
Any ideas?
-
Thnakyou, that seemed to work
-
Thank you, but I don't quite think you understand.
I do not want it to echo, I want it to delete the line that the id is in, like I posted.
That current script is the part I can manage to make, but I want to remove the line.
-
That just does nothing.
Just returns the same.
-
Well, currently it is just emptying the whole file.
Here is an example:
say I want to remove the string where the id is 1:
0:Name:Text 1:Name:Text 2:Name:Text
The output must be:
0:Name:Text 2:Name:Text
Any further explanation?
-
Hello there,
I am currently busy making an shoutbox.
But here is my problem.
I have the whole system working great, put in bccodes etc.
But I am now adding an future that you will be able to delete the shout/post.
Here is how it must work:
Search for a string within the text file, then remove the line that the string is in and and put back the other contents.
The text files contents is formatted like this:
1:Name:%3Cb%3EWelcome to your shoutbox!%3Cb%3E 2:Name:%3Cb%3EWelcome to your shoutbox2!%3Cb%3E
My best attempt is this:
<?php $var['id'] = addslashes($_GET['id']); /* Get Post id. */ $fc=file("chat.txt"); //open same file and use "w" to clear file $f=fopen("chat.txt","w"); //loop through array using foreach foreach($fc as $line) { list($id, $name, $message) = explode(':',$line); if ($id = $var['id']){ $string = $id . ':' . $name . ':' . $message; $do = str_replace($string,'',$line); fputs($f,$line); header('Location: chat.php'); } else{ echo 'None dound.'; } } fclose($f);
If there is a way i can edit aswell please also let me know.
Thank you.
DeathStar
-
Opps, forgot that.
Thankyou
-
wow.
Thankyou, shorter and better.
Still just need to find a way to order it.
-
No errors.
only one row with no data.
-
oh yes, sorry my mistake.
Still does not work, it doesn't limit, or show data.
Just alot of empty rows.
-
The Sort function will not work with what i have here.
As for the limit.
It displays an error.
Warning: Invalid argument supplied for foreach() in C:\**\**\**.php on line 128$lines = file('file.txt'); if(!is_array($lines)) die("File could not be opened"); $i=0; $max=20; foreach($line as $line) { list($a, $b, $c, $d, $e, $f) = explode(',', $line); $b = urldecode($b); $b = addslashes($b); while ($i < $max) { ?> <tr> <td><?php echo $f; ?></td> <td><a href="<?php echo $a; ?>.php"><?php echo $b; ?></a></td> <td><a href="">None</a></td> <td><?php echo $points; ?></td><td><?php echo $d; ?></td><td><?php echo $e; ?></td> </tr> <?php }} ?>
-
Meta tags?
PayPal IPN Help
in PHP Coding Help
Posted
https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/ipn-code-outside
It should be there.
And IPN works with your server while transaction is taking place and checks trough paypal for data.