2,113 Posted Topics
Re: So, if you write [icode]$_POST['order_of_products_by_values'][/icode] you don't get anything? if you select [i]Pret crescator[/i] you should get 1. Ops, I see that [b]form[/b] and [b]select[/b] are using the same id and name. Each element can use only a unique id per page, each form element can share the same name … | |
Re: Just an example: [code]<style type="text/css" media="screen"> body { font: 14px/20px Arial, Verdana, sans-serif; } h3 { font-weight: normal; margin: 0; padding: 0; font-size: 20px; } label { font-weight: bold; display: block; } input[type=text], input[type=password] { border: 1px solid black; padding: .2em; width: 465px; } .button { padding: .2em .5em; float: … | |
Re: Use $_SESSION, session_register() is deprecated. For the second problem you should report the error that you get. But try to run: [code]echo extension_loaded('gd');[/code] 1 equals to true, so gd is loaded and working, 0 to false. ![]() | |
Re: Unless is specified by localtime(), time_zone cookies and so on, PHP works with the server time, not with client time, if you want to use GMT then use gmdate(): [code]<?php echo gmdate('c'); echo date('c'); ?>[/code][url]http://www.php.net/manual/en/function.gmdate.php[/url] | |
Re: exec() won't give you TRUE or FALSE on the command executed, will simply return an output, and only if you add a second parameter. For example: [code]<?php echo exec('ls',&$ot) . "\n"; print_r($ot) . "\n"; ?>[/code] So, you need to see what is going on during the conversion. Try to use … | |
Re: Where is the form? And why you wrote this: [code]<td><a href='tcninja_update.php?ID=".$rows['ID']."'>submit</a></td>[/code] This will generate a GET, to read ID you need to write $_GET['ID'], but you won't get Status, to get that you need to add it to the link [icode]&Status=value[/icode] To submit a form like yours you need the … | |
Re: Useful documentation: [url]http://www.ffmpeg.org/ffmpeg.html[/url] You can increase upload timeout in your php.ini, check it. | |
Re: I don't know your database structure, so here's an example: [code=mysql]# tables structure mysql> explain users; +---------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+----------------+ | id | int(9) | NO | PRI | NULL | auto_increment | | fname | varchar(50) | NO … | |
Re: Together with chrishea suggestion use .htaccess: [code]order allow,deny deny from all[/code] Save this in the same directory that contains mysql connection data. This will avoid direct access through the browser. On Windows you can use [b]cacls[/b], it's a command line tool: [url]http://technet.microsoft.com/en-us/library/bb490872.aspx[/url] | |
Re: You need a form, get data from the form and send it to the database, you can use odbc_exec(): [url]http://www.php.net/manual/en/function.odbc-exec.php[/url] After that you just need to display result. Bye :) | |
Re: For each group of radio buttons you need to set the same [b]name[/b], they are alternatives so the scripts will get one of those options. The [b]id[/b], instead, is unique, so: [code] # question 1 <ul> <li><input type="radio" name="q1" value="1" id="ans1A" />Answer 1</li> <li><input type="radio" name="q1" value="2" id="ans1B" />Answer 2</li> … | |
Re: Try this: [code]echo "<div class='posterdecoration'><img src='$row[scr1]' width='640' alt='$row[name]' /></div>"; echo (isset($row['scr2'])) ? "<div class='posterdecoration'><img src='$row[scr2]' width='640' alt='$row[name]' /></div>" : NULL;[/code] bye :) | |
Re: The same problem pritaeas wrote affects also [icode]$like_box_xfbml = "[/icode] | |
Re: I don't understand. You need to create a view between two databaes tables or you just need to display different data from the same database table? Can you provide more information? | |
Re: You need double quotes, otherwise $x won't be processed. An alternative is this: [code]'SELECT * FROM ...WHERE field="blah blah" HAVING field2<'.$x[/code] | |
Re: Explain better. You need to connect to the same page consecutively? | |
Re: Yes, but your question is too generic to make an example. You should explain better your problem. | |
Re: Use EOF: [code]<?php echo <<<EOF <?php echo 'test'; ?> EOF; ?>[/code] | |
Re: Try PHP DOM, I gave a suggestion here: [url]http://www.daniweb.com/web-development/php/threads/376665[/url] But instead of using getElementsByTagName you can use getElementById: [url]http://www.php.net/manual/en/domdocument.getelementbyid.php[/url] | |
Re: To me the wrong part are on line 35 an 42: <?=$url='item1.php'?> Once the page is loaded, PHP won't change the value echoed on line 11: action="<?=$url?>" Instead of using two different urls, you should send everything to the same script and use the value that you get: item1/item2 to … | |
Re: Hi :) For what I know, you can't. Those are the same operations done by a browser. You can make a black list of user agents not allowed to cross your website, but a bot can be configured to use a well known user agent browser. | |
Re: You can use the PHP Document Object Model (DOM), an example: [code]<?php $f = ' <html> <head> <title>test</title> </head> <body> <div id="aaa">apples</div> <div id="bbb">oranges</div> </body> </html> '; $dom = new domDocument; $dom->loadHTML($f); $dom->preserveWhiteSpace = false; $t = $dom->getElementsByTagName('div'); $newElement = $t->item(0)->nodeValue; // 0 to display #aaa, 1 for #bbb echo … | |
Re: This should work: [icode]GROUP BY referrer[/icode] not by userID, so: [code]"SELECT t1.fname, t1.lname, t1.userID, COALESCE(t2.referrals, 0) AS referrals FROM users as t1 LEFT OUTER JOIN (SELECT referrer, COUNT(*) AS referrals FROM users GROUP BY referrer) AS t2 ON t1.userID = t2.referrer WHERE referrals > 0 "[/code] userID is always one, … | |
Re: This is not related to php, search for [b]html5 offline[/b] or [b]adobe air[/b] on google, you will find some tutorials. | |
Re: Try: [code]RewriteRule ^([0-9a-zA-Z.\-\_]+)$ ./profil.php?user=$1[/code] But the rule seems ok to me, and you should use \. as you already tried. Which error gives you? Concerning the spaces, you should prevent spaces at the moment of signup. You can add a field in the table for example url, where you remove/replace … | |
Re: Check sendmail logs. And try to send a simple mail from terminal, just to see if it works: [code]echo "subject: test" | sendmail -v you@email.tld[/code] | |
Re: Use switch(): [code]<?php $a = 'about'; # replace with $_GET['page'] switch($a) { case 'about': echo 'about page'; #instead of echo you can include break; case 'contacts': echo 'contact page'; break; default: echo 'home page'; break; } ?>[/code] name the page index.php and make these links: [url]http://your.website/index.php?page=about[/url] [url]http://your.website/index.php?page=contact[/url] If you write … | |
Re: Can you provide an example of the array you have and that you want at the end? Just few entries to get an idea. | |
Re: Check example #4: [url]http://php.net/manual/en/function.mail.php[/url] | |
Re: Build an array from the XML feed and then use shuffle(): [code]<?php $a = array( 'a' => array('a1','a2','a3'), 'b' => array('b1','b2','b3'), 'c' => array('c1','c2','c3'), 'd' => array('d1','d2','d3'), 'e' => array('e1','e2','e3') ); shuffle($a); echo $a[0][0]; # will print randomly a1, b1, c1, d1, e1 echo $a[0][1]; # will print randomly a2, … | |
Re: Maybe you can. On linux the command [b]lp[/b] permits you to print to a remote printer. So if the php script runs on a linux box and makes use of system() or exec() you can print, an example: [code]<?php exec('lp -h 123.123.123.123 filename.txt'); ?>[/code] where 123.123.123.123 is the remote ip … | |
Re: Example: [code] $string = 'barrack obama'; $a = str_replace(' ','',$string); if($ctype_alpha($a)) { echo $string; } else { echo 'error'; } [/code] If data is coming from a form I suggest you to look at the User Guide, you can set up a callback: [code] # validation rule $this->form_validation->set_rules('name', 'Name', 'callback_check_string'); … | |
Re: You need to install a mail server, usually on linux is sendmail, if you want to try there is a porting for Windows: [url]http://glob.com.au/sendmail/[/url] Or just search for a mail server that works in command line. | |
Re: @ivan3510 I think it's better to store friend's id on separate rows, it's easier to maintain, count and so on: [code=mysql] user_id | friend_id ------------------- 1 | 23 1 | 90 2 | 37[/code] :) | |
Re: Just an idea: if you don't need to store those information and your website is not using an SSL Certificate, then it's better to use javascript, so the users can fill the form, display and print it without sending anything to the server. | |
![]() | Re: Try to add video/x-flv to the conditional statement. |
Re: You need session, otherwise the array will become empty after each loop. This should work: [code]<?php session_start(); while loop { $blnk = ($_SESSION['numRows'] == NULL) array() : $_SESSION['numRows']; $val=mysql_num_rows($result14); array_push($blnk,$val); if($_SESSION['numRows'] == NULL) { $_SESSION['numRows'] = $blnk; } # start session } #$blnkarraysum=array_sum($blnk); $blnkarraysum = $blnk; ?> [/code] | |
Re: You need to use ajax to do that. Ajax will send the request to a PHP script that will do the work without refreshing the entire page. | |
Re: Without details it's hard to help. What does the script and how, which OS are you running? | |
Re: If you need bold and colors, then you have to use HTML e-mail. There's an example on the mail() page, look at #example 4: [url]http://php.net/manual/en/function.mail.php[/url] There are some tips to apply CSS and make them work on mail clients, like inline CSS instead of using external or style element. Search … | |
Re: This code should be on modify_data.php not in the first file, because there is no query to do: [code]$connect=mysql_connect('localhost','root',''); mysql_select_db('bank',$connect);[/code] | |
Re: Man, dum da dum, read your private messages! :D | |
Re: You should write more information, you get the data from the form? You still display the correct data after you do str_replace()? Have you tried to get response code? Right after r->send(); write: [code]try { $r->send(); echo $r->getResponseCode(); # so you know if the request reaches the gateway echo "<div … | |
Re: If you need authentication use PEAR Mail: [url]http://pear.php.net/package/Mail[/url] [url]http://www.php.net/manual/en/function.mail.php#39305[/url] <- example otherwise use just mail() | |
Re: As you wrote this is not simple. Yours is a requested feature, check this link: [url]http://code.google.com/p/gdata-issues/issues/detail?id=300[/url] If users submit their own YouTube username on your website, you could use the API to check each single user subscriptions: - [url]http://code.google.com/apis/youtube/2.0/developers_guide_protocol_subscriptions.html#Retrieving_subscriptions[/url] Or you could just make a list of subscribers from this … | |
Re: Two questions: 1) can you show the html part? 2) the script is saving the image to the path? | |
Re: If you need to change this for all php files in that directory use: [code]RewriteRule ^(.*)\.html$ $1.php [L][/code] | |
Re: $_SERVER['HTTP_REFERER'] not $SERVER['HTTP_REFERER'] maybe is just this? | |
Re: Let say you have a table for your blog (with id, title and post fields): [code] <?php $id = $_GET['id']; if(ctype_digit($id)) { $query = mysql_query("SELECT * FROM blog WHERE id = '$id' limit 1"); if(mysql_num_rows($query) == 1) { while($row = mysql_fetch_assoc($query)) { echo $row['title']; echo $row['post']; echo $row['id']; } } … | |
Re: The upload path (line 147) is not the website url but the DOCUMENT_ROOT, use this command to get the path: [code]echo $_SERVER['DOCUMENT_ROOT'][/code] it will give you something like /var/www/yourwebiste.tld/ so an example is this: [code] $upload = $_SERVER['DOCUMENT_ROOT'] . 'images/' . $path;[/code] I see you set $path from the database, … |
The End.