1,376 Posted Topics

Member Avatar for OmniX

I think what your looking for is the empty() function Below is an example. [CODE]<?php $arr=array('','a',0,NULL); echo '//empty<br>'; $i=1; foreach ($arr AS $val) { if (empty($val) { echo $i.' passed<br>'; } $i++; } echo '//isset<br>'; $i=1; foreach ($arr AS $vals) { if (isset($vals)) { echo $i.' passed<br>'; } $i++; } …

Member Avatar for diafol
0
115
Member Avatar for iqbalhosan

With the following: [CODE]ini_set('memory_limit','64M'); ini_set('max_execution_time','256'); ini_set('upload_max_filesize','60M');[/CODE]

Member Avatar for cwarn23
0
120
Member Avatar for babydol

[QUOTE=Will Gresham;1113981]This is not a PHP function. It is likely that you have an included file or code somewhere which defines this.[/QUOTE] Indeed because if you go into the official documentation and manually put the function into the url a 404 comes up and when searching the official documentation it …

Member Avatar for babydol
0
186
Member Avatar for PatrickV

[QUOTE=PatrickV;1113748]Does anyone have issue with PHP version 5.1.3. it is crap and causes cpanel and other php software issues, i cann't get the latest xammp becacuse of it. Does anyone know when is the next release to fix these problems is coming out?[/QUOTE] I agree. A few weeks ago I …

Member Avatar for PatrickV
0
104
Member Avatar for jj.amonit

I would suggest the following: [CODE]$zone=array('id'=>array(),'name'=>array()); while ($row=mysql_fetch_assoc($result)) { $zone['id'][]=$row['zone_id']; $zone['name'][]=$row['zone_name']; } //first index echo $zone['id'][0]; echo $zone['name'][0]; //second index echo $zone['id'][1]; echo $zone['name'][1]; [/CODE] How be sure that not much data is being stored in the array (>1MB) as you can make your script run out of memory.

Member Avatar for cwarn23
0
94
Member Avatar for cwarn23

I do and does anybody here really like the series or am I the only one.

Member Avatar for WaltP
0
106
Member Avatar for ShawnCplus

Well in my opinion I don't mind helping with others homework as long as they are willing to put the effort to piecing the puzzle together. So even if there was an announcement and if people read it people would still post their homework. Why? Because there aren't very many …

Member Avatar for almostbob
0
403
Member Avatar for cwarn23

Note to mods: This is in the php section as the question is mainly directed to the php gurus. I have been reading on some rather old news and discovered that the Secure Hash Algorithm (SHA1) has been cracked. Does anybody know where I can download a copy of this …

Member Avatar for ShawnCplus
0
88
Member Avatar for cwarn23

Hi and I am writing a small program but need to make a function that converts an integer to a hex. Below is an example of a similar function but need the result stored in a std::string variable. [CODE]printf("%x%x%x%x%x",h0, h1, h2, h3, h4);[/CODE] Does anybody know how to create a …

Member Avatar for Poincarre
0
419
Member Avatar for muralibobby2015

This is a quote from my website [QUOTE]On an advanced content management system, you may want to offer a feature to convert text into different languages. Well I have created a script which uses the google translator to translate your data and send the translation to your website. So first …

Member Avatar for muralibobby2015
0
2K
Member Avatar for ArtphotoasiA

[QUOTE]I do hope will help people to think where we all we humans are going.[/QUOTE] Yea, I think by year 2100 we will be like the ancients from Stargate Atlantis where we modify our DNA to make Microsoft and Google Genes and with technology being limitless. Can't wait to see …

Member Avatar for ankush.mukherje
0
132
Member Avatar for xuexue

It would require javascript but as for the basics I believe it would be something like the following. [CODE=html]<table> <tr onclick=javascript:showrow(1)><td></td><td id="1"></td></tr> <tr onclick=javascript:showrow(2)><td></td><td id="2"></td></tr>[/CODE] Then you would use css to hide the rows and a custom javascript function to show the rows. Hope that helps.

Member Avatar for xuexue
0
101
Member Avatar for Lsmjudoka

[QUOTE]The results of the three "echo" statements are as follows: Regen remainder: 57 Current time: 1264322357 1.2643223E+09[/QUOTE] This is a limitation in the computing world (64 and 32 bit processors). They can only store so many numbers before showing all weird things. Fortunately php has a way around this. When …

Member Avatar for Lsmjudoka
0
75
Member Avatar for hno

I do this a lot as my website is scattered between two web servers and the easiest way is with curl and file_get_contents(). You can retrieve contents from a database using [ICODE]file_get_contents('http://example.com/sql.php?key=asldfkjasldkfj&column=23')[/ICODE]. Then it will return the contents of that mysql request and you can use the url parameters as …

Member Avatar for kireol
0
85
Member Avatar for motters

I'm currently in the process of making a login script myself but I find that the easiest thing to do is to just write it from scratch using good security practices. As for how to separate normal users from admin, simply store in the database weather the user is admin …

Member Avatar for cwarn23
0
108
Member Avatar for sakura_fujin

[QUOTE=rch1231;1108636]The table name and fields that have spaces in the name must be inclosed in single quotes: [CODE] INSERT INTO 'employee record'('Employee ID', 'Employee type', 'First Name', 'Last name', 'Farm location', 'Farm type') VALUES('34', 'caretaker', 'Michael', 'Hipolito', 'lara', 'nursery' ) [/CODE][/QUOTE] I could be wrong but don't column names and …

Member Avatar for sakura_fujin
0
94
Member Avatar for cwarn23

Hi and I thought I would write an algorithm where the computer can learn from text being input into its database and the computer will be able to have a normal conversation with somebody. I already have my database of paragraphs but will need converting into something more complex for …

Member Avatar for cwarn23
0
160
Member Avatar for cwarn23

Hi and I have the below php-gtk script but for some reason it is reporting the error "Not enough storage is available to process this command." in the command console but the application still loads. It only happens when I try to import a 1.75MB text file for processing. Does …

Member Avatar for cwarn23
0
189
Member Avatar for veledrom

As far as I know it isn't possible to removes ones url history but perhaps you should consider $_POST. Then the user will need to confirm the post request and if they do you should then get the server to check if the same post request has been sent in …

Member Avatar for veledrom
0
3K
Member Avatar for cwarn23

I know how to make 64 bit integers but how do I make 64 megabit integers? That is a bit rate of (1024^3)*64 bits. Is this a simple job as I don't know where to begin. I thought somebody might know of a library/script that will allow custom bit rates …

Member Avatar for cwarn23
0
143
Member Avatar for talk2sachi

Now that you have downloaded mysql, next you need to install it's services so that mysqld/mysql will start on bootup. After that php should be able to recognize mysql. So try and google "how to setup mysql service on <your linux brand>" then if you have any further troubles tell …

Member Avatar for cwarn23
0
105
Member Avatar for xuexue

Try the following. [CODE]<?php $resultSN = mysql_query("SELECT * FROM table ") or die(mysql_error()); $count=mysql_num_rows($resultSN); $machineName=array(); while($row = mysql_fetch_assoc($resultSN)) { $machineName_O = $row['MachineName']; for ($i=0; $i<$count; $i++) { $machineName[] = $machineName_O; echo $i. " " . $machineName_O . "<br>"; } } ?>[/CODE]

Member Avatar for xuexue
0
126
Member Avatar for Dilbert137

Do you mean like this? [CODE]<?php echo '<xmp>'; //show pure html instead of styling echo file_get_contents('http://www.daniweb.com/'); echo '</xmp>'; ?>[/CODE]

Member Avatar for Dilbert137
0
139
Member Avatar for cwarn23

Does anybody know what happened to Bill Gates as it would be interesting to see what happened to Bill after Microsoft? Bill was a Legend who changed the world. But now he has left Microsoft his hardly spoken of. So what does he do today and what do you think …

Member Avatar for jonsca
0
154
Member Avatar for cwarn23

Hi and sorry if this is the wrong forum but didn't know where to place my question. I need to know the answer of a+b=23. So how would I calculate the values of a and b and the same would apply for a^b=16. So basically I need to know the …

Member Avatar for mrnutty
0
137
Member Avatar for ashiqin88

Could you explain further please. It is hard to know what you are asking. I do know that for to get the square root you can just use the sqrt() function but I don't have a clue what the others mean.

Member Avatar for cwarn23
0
48
Member Avatar for cwarn23

I thought I would ask while this thread is active "What is the best Ubuntu c++ compiler that allows VC++ code?" I really like Visual C++ as it has great debugging features that Dev-c++ could never match. But how do I compile my VC++ projects to run on Ubuntu?

Member Avatar for Stefano Mtangoo
0
424
Member Avatar for takeshi

For starters try replacing line 20 with the following. [CODE]mysql_query('UPDATE `candidate` SET `votes`=`votes`+1 where `can_id`="'.mysql_real_escape_string($val).'"' );[/CODE]

Member Avatar for cwarn23
0
135
Member Avatar for Reliable

The old mail function bug. The smtp only works if you have a localhost mail server. The reason, there is no password provided anywhere for php to read so access is denied to the remote smtp although you could try the [URL="http://au.php.net/manual/en/function.imap-mail.php"]imap_mail()[/URL] function to see if it makes a difference. …

Member Avatar for Reliable
0
139
Member Avatar for cwarn23

I have been asking for some time to move [URL="http://www.daniweb.com/forums/forum28.html"]forum28[/URL] to it's own main forum in web development instead of being a subforum of web design but it seems everybody has been confused about what I am talking about. So I've now started my own thread... Anyways, it seems that …

Member Avatar for jbennet
3
216
Member Avatar for thekashyap

Also while this topic is active could somebody mention why there isn't a forum for 3d modelling and digital artworks other then the web development multimedia. Would it be possible to create such a forum or perhaps move the multimedia forum to somewhere where it is more accessible by the …

Member Avatar for jbennet
0
135
Member Avatar for Ancient Dragon

Is this thread about the Unix timestamp 2038 bug when 32-bit integers run out of numbers. If they used the php bcmath library for the timestamp then they could have infinite numbers. Imagine the possibilities if they made a type of integer which could hold infinite numbers. That would be …

Member Avatar for jbennet
0
134
Member Avatar for SamiBH

Try making this your query and see what error mysql reports back. [CODE]$qry = "SELECT `userid`, COUNT(*) as `cnt` FROM table1, table2 WHERE userid = id GROUP BY userid ORDER BY cnt DESC LIMIT 0,10";[/CODE]

Member Avatar for SamiBH
0
111
Member Avatar for nejix

I agree. Storing a timestamp in a int field would be by far better as more functions would be available for the the job. Then after having the timestamp you can perform math operations to check dates and everything since a timestamp is number of seconds since 1980.

Member Avatar for Will Gresham
0
73
Member Avatar for disc

Well first of all place the following at the top of every php file but not the files which are being included (eg not include.php). [CODE]<?php session_start();[/CODE] After that make sure you have cookies enabled. If you have cookies disabled then sessions won't work. Why? Sessions send a single cookie …

Member Avatar for cwarn23
0
188
Member Avatar for ayesha789

The best way is to just on login, send a session cookie to the user or a cookie that expires when the user leaves the website. Then when the user accesses a page with the cookie then a `online` column in the mysql user database will turn into the current …

Member Avatar for elisha24
0
1K
Member Avatar for Ancient Dragon

[QUOTE=ithelp;1095485]Energy cannot be destroyed , it can only change forms, so universe was there before concept of time came in and it will continue to be there after concept of time vanishes.[/QUOTE] While energy cannot be created or destroyed, there is nothing to say energy can't be transfered. What if …

Member Avatar for WaltP
1
325
Member Avatar for cwarn23

Hi and I have a database with over 32 million entries and whenever I try the below mysql query or simular it crashes the sql server unless I use phpmyadmin. I have 4 columns all indexed and all are the char() type with a fixed length. Below is an example …

Member Avatar for cwarn23
0
1K
Member Avatar for chienee

hi and welcome to daniweb. Next time please start a new topic instead of bumping a really old topic. As for the problem, there is probably a bug in your query. So try replacing line 201 and 202 with the following [CODE]$query = mysql_query($sql) or die(mysql_error()); $nume = mysql_num_rows($query); // …

Member Avatar for cwarn23
0
304
Member Avatar for Dani

[QUOTE=cscgal;1003990]I have gotten soooo many mixed opinions lately, and I was wondering what you guys thought of the current style. Please be brutally honest. I'm not talking about "It's missing a link in a convenient place" or little functional things that can easily be changed/added/removed. I'm talking about the color …

Member Avatar for feoperro
3
941
Member Avatar for mrnutty

I would say you know your a computer geek when you have done over 1000 posts on daniweb. lol That's me alright. Btw, how do you calculate to the power without a calculator? eg. 1024^50 using only addition, subtraction, multiplication and division. Just wondering as it would have been handy …

Member Avatar for mrnutty
1
329
Member Avatar for xuexue

In php this could be kinda hard to do at first but there is an [URL="http://code.google.com/apis/chart/"]api by google[/URL] you can use and is very handy. I've used this api myself and it seems pretty good with little or no limitations.

Member Avatar for xuexue
0
143
Member Avatar for dan_ord

[QUOTE=Wraithmanilian;1095897]It looks like the cron is getting the php file raw, before it is actually processed by the php interpreter. Not familiar enough with cron to know how to fix. Any thoughts?[/QUOTE] The usual method of setting a cron job is a simple command line like the following: [CODE=Plain]php /home/<user>/public_html/cron.php[/CODE] …

Member Avatar for cwarn23
0
157
Member Avatar for dazlerd

Perhaps something like this. [CODE=html]onclick="javascript: document.form.currency.value='euro'; document.form.action=\"index.php?currency=euro\"; document.form.submit();"[/CODE] Then in php [CODE]<?php session_start(); if (isset($_GET['currency']) && !empty($_GET['currency'])) { $_SESSION['currency']=$_GET['currency']; $v=explode('?','http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],2); $v[1]=str_replace('currency='.$_GET['currency'],'',$v[1]); $v[1]=trim(str_replace('&&','&',$v[1]),'&?'); $j=$v[0]; $j.=(empty($v[1]))?'':'?'.$v[1]; header('Location: '.$j); exit; }[/CODE] That should assign the session it's value on submit then redirect back.

Member Avatar for FlashCreations
0
174
Member Avatar for sneekula

From the list I would say Java as it is so easy to use with the Netbeans compiler. But my favourite which isn't on the list is php/php-gtk.

Member Avatar for gelgin2k
3
593
Member Avatar for happygeek

The countdown is on until time 1262257200 seconds from 1980 GMT+13. That's how I read time. Hope everybody enjoyed their christmass holidays and that last years resolutions came true.

Member Avatar for The Dude
7
180
Member Avatar for Midnite007

Could you explain exactly what you are trying to achieve. Perhaps php can do the job without the need for shell access. I noticed something about bc and saw some numbers on the same line. So are you just trying to use the bc math library because php has a …

Member Avatar for Midnite007
0
97
Member Avatar for ronaldpaul

Try replacing line 59 with the following. [CODE]$result=mysql_query($qry) or die(mysql_error());[/CODE]

Member Avatar for cwarn23
0
233
Member Avatar for nats01282

[QUOTE=ardav;1097214]Sounds like you've got something like cPanel? See screenshot. You can probably get your heart server address from inserting something like: [CODE]<?php echo "Server address: " . $_SERVER['SERVER_ADDR'];?>[/CODE] into one of your pages. Now take the address and place it into your cpanel. I'm no expert on this - I'm …

Member Avatar for nats01282
0
369
Member Avatar for ruwanaru

There is a nice [URL="http://www.tizag.com/phpT/fileupload.php"]tizag tutorial[/URL] I would suggest following. Basically all you need to do is set a html form which will post files to the server. Then after uploading the server can validate. That is [U]after[/U] uploading the server validates as many people get confused with this. And …

Member Avatar for cwarn23
1
333

The End.