2,113 Posted Topics

Member Avatar for jacksantho

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 …

Member Avatar for almostbob
0
14K
Member Avatar for bishnoi

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: …

Member Avatar for bishnoi
0
465
Member Avatar for gorleone

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.

Member Avatar for diafol
0
384
Member Avatar for rakwel10

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]

Member Avatar for cereal
0
302
Member Avatar for alimziyan

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 …

Member Avatar for alimziyan
0
170
Member Avatar for agr8lemon

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 …

Member Avatar for agr8lemon
0
154
Member Avatar for Chub97

Useful documentation: [url]http://www.ffmpeg.org/ffmpeg.html[/url] You can increase upload timeout in your php.ini, check it.

Member Avatar for Chub97
0
178
Member Avatar for phaedrusGhost

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 …

Member Avatar for phaedrusGhost
0
127
Member Avatar for Nahiyan

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]

Member Avatar for eXpertPHP
0
130
Member Avatar for uselessninja

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 :)

Member Avatar for cereal
0
110
Member Avatar for dashawk

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> …

Member Avatar for cereal
0
256
Member Avatar for -==Zero==-

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 :)

Member Avatar for -==Zero==-
0
113
Member Avatar for gatomsgirl

The same problem pritaeas wrote affects also [icode]$like_box_xfbml = "[/icode]

Member Avatar for almostbob
-1
297
Member Avatar for dahi_man

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?

Member Avatar for dahi_man
0
785
Member Avatar for 54uydf

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]

Member Avatar for cereal
0
80
Member Avatar for binu_ds
Member Avatar for cereal
0
49
Member Avatar for jorjah
Re: php

Yes, but your question is too generic to make an example. You should explain better your problem.

Member Avatar for cereal
0
48
Member Avatar for Nahiyan

Use EOF: [code]<?php echo <<<EOF <?php echo 'test'; ?> EOF; ?>[/code]

Member Avatar for cereal
0
145
Member Avatar for fobos

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]

Member Avatar for cereal
0
877
Member Avatar for dashawk

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 …

Member Avatar for cereal
0
427
Member Avatar for haimz

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.

Member Avatar for cereal
0
112
Member Avatar for shobe089

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 …

Member Avatar for fobos
0
544
Member Avatar for jesyka82

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, …

Member Avatar for cereal
0
132
Member Avatar for mrhankey

This is not related to php, search for [b]html5 offline[/b] or [b]adobe air[/b] on google, you will find some tutorials.

Member Avatar for cereal
0
48
Member Avatar for cipcip

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 …

Member Avatar for vibhaJ
0
119
Member Avatar for mwenyenia07

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]

Member Avatar for cereal
0
82
Member Avatar for PixelatedKarma

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 …

Member Avatar for PixelatedKarma
0
132
Member Avatar for whiteyoh

Can you provide an example of the array you have and that you want at the end? Just few entries to get an idea.

Member Avatar for cereal
0
68
Member Avatar for topsege2007
Member Avatar for cereal
0
110
Member Avatar for demo7up

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, …

Member Avatar for cereal
0
337
Member Avatar for phorce

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 …

Member Avatar for cereal
0
109
Member Avatar for mwenyenia07

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'); …

Member Avatar for cereal
0
89
Member Avatar for vanpersie

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.

Member Avatar for vanpersie
0
361
Member Avatar for abhinav bagora

@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] :)

Member Avatar for cereal
0
152
Member Avatar for riseguim

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.

Member Avatar for riseguim
0
145
Member Avatar for megachip04
Member Avatar for jacksantho

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]

Member Avatar for cereal
0
326
Member Avatar for rahulvramesh

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.

Member Avatar for IIM
0
105
Member Avatar for zack654

Without details it's hard to help. What does the script and how, which OS are you running?

Member Avatar for zack654
0
235
Member Avatar for bubbafunk1

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 …

Member Avatar for cereal
0
143
Member Avatar for heshanm

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]

Member Avatar for rv1990
0
201
Member Avatar for erik216
Member Avatar for rayidi

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 …

Member Avatar for cereal
0
486
Member Avatar for kamalbasha.v

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()

Member Avatar for vibhaJ
0
37
Member Avatar for cali_dotcom

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 …

Member Avatar for cereal
0
182
Member Avatar for vizz

Two questions: 1) can you show the html part? 2) the script is saving the image to the path?

Member Avatar for vizz
0
5K
Member Avatar for jogesh_p

If you need to change this for all php files in that directory use: [code]RewriteRule ^(.*)\.html$ $1.php [L][/code]

Member Avatar for cereal
0
156
Member Avatar for Espenij

$_SERVER['HTTP_REFERER'] not $SERVER['HTTP_REFERER'] maybe is just this?

Member Avatar for minitauros
0
81
Member Avatar for Clanstrom

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']; } } …

Member Avatar for Clanstrom
0
597
Member Avatar for gwhite12

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, …

Member Avatar for Nahiyan
0
5K

The End.