taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
[SOLVED] Cannot redeclare function in foreach
taquitosensei replied to 1bigbear's topic in PHP Coding Help
you could declare strange at the begining of your php page then return a value. Then just call it in your loop. // this is the beginning of your page function strange($text) { // do something return $something; } then in your loop foreach($value as $each) { if($each==$verify) { $something=strange($text); } } -
your last brace in the statement should be a parenthesis. $query = "INSERT INTO subjects ( menu_name, position, visible ) VALUES ( '{$menu_name}', {$position}, {$visible} )"; and you might need quotes around position or visible if the'yre not integers
-
should be <span class="style9"><?php echo $rows['reason']; ?></span>
-
[SOLVED] Timestamps for subscription newsletter
taquitosensei replied to Irresistable's topic in PHP Coding Help
see http://www.php.net/date F j, Y, g:i = November 2, 2009, 3:30 Which isn't the best way to do it because then strtotime time can't work with it very well because you don't know am/pm. Your field in your database should be datetime. Y-m-d H:i:s = 2009-11-02 15:30:00 then you could use date and strtotime to format it in php or format it in mysql php $formatted_date=date("H:i d/m/Y", strtotime($timestampe)); mysql select date_format(date_field,'%H:%i %d/%m/%Y') as formatted_date from table -
this is your mysql loop { $categories[$row['categoryid']][]=array("subcategoryname"=>$row['sub_name'],"categoryid"=>$row['categoryid']); } then foreach($categories as $categoryname=>$category) { $categoryid=$category['categoryid']; $subcategory=$category['categoryname']; }
-
this is your mysql loop { $categories[$row['categoryname']][]=$row['cubcaegoryname']; }
-
[SOLVED] Find records from all my database with a criteria
taquitosensei replied to mattyvx's topic in PHP Coding Help
select * from table1 where featured='y' UNION select * from table2 where featured='y' UNION select * from table3 where featured='y' etc.. etc.. -
[SOLVED] MySQL LIMIT error
taquitosensei replied to salman_ahad@yahoo.com's topic in PHP Coding Help
set your sql to a variable and then echo it to make sure it looks like it should. $VarCount=mysql_real_escape_string($_POST['limit']); $sql="SELECT * FROM test WHERE id NOT IN (SELECT id FROM test1) AND LIMIT $VarCount ORDER BY datetime DESC " echo $sql; $query=mysql_query($sql); -
foreach($_POST['product'] as $product) { // do whatever with each product selected }
-
[SOLVED] Trying to script for 2 different outcomes
taquitosensei replied to Leveecius's topic in PHP Coding Help
close it's double equals and you need opening and closing braces and instead of closing the php you just need to concatenate and your quotes needed to be redon. <tr> <td width="150" height="18" bgcolor="#000066" class="menu_header2"><div align="center"><span class="style1"><strong>.::</strong>Rank<strong>::.</strong></span></div></td> </tr> <? if ($userlevel==1) { echo "<td bgcolor='#333333'><div align='center'>".$rows['rank']."</td><br>"; } if ($userlevel >=2) { echo "<td bgcolor='#333333'><div align='center'>".$rows['rank2']."<td><br>"; } ?> <br> <br> </div></td> </tr> -
[SOLVED] How do I generate a static HTML page with PHP?
taquitosensei replied to CBI Web's topic in PHP Coding Help
the resulting page is HTML well it could be html and javascript. PHP processes on the server and then spits out the HTML that the browser then displays. Two separate things. Server side and client side. Server side - PHP Client Side - HTML / Javascript -
change the field data type to mediumtext alter table `yourtable` change column `yourcolumn` `yourcolumn` mediumtext;
-
$timestamp=strtotime("2009-10-29TO6L54:56.000Z");
-
in your php you could do as long your day field is a datetime if(strtotime($row['day']) >= strtotime(date("Y-m-d H:i:s"))) { // html for upcoming performances } else { // html for previous }
-
you forgot a single quote after the last entry in the array.
-
you could upload a php.ini to your web root with this as the contents upload_max_filesize = 50M that should override only that setting from the regular php.ini
-
Include ("Absolute Path") of a file?
taquitosensei replied to Punk Rock Geek's topic in PHP Coding Help
Is there supposed to be another folder before plugins? I see a double slash looks like you're missing a folder. -
modify thanks.html to whatever you want that matches. That's the right syntax not sure why it wouldn't be working. header("Location: yourthankyoupage.html");
-
because it's a string. Either save it as a .php file then include it or use eval but both are evil. They leave open huge security holes.
-
if you have access to the command line php -l phpfile.php
-
[SOLVED] phpMailer will not connect using SMTP
taquitosensei replied to longtone's topic in PHP Coding Help
I gave you the wrong link. Here's the right one. http://webtools.live2support.com/nt_cport.php -
[SOLVED] phpMailer will not connect using SMTP
taquitosensei replied to longtone's topic in PHP Coding Help
go here http://www.canyouseeme.org/ and see if port 465 is blocked. If it's not blocked it might be because you're trying to use SSL -
[SOLVED] Run function every 5 mins ??
taquitosensei replied to salman_ahad@yahoo.com's topic in PHP Coding Help
It's in your hosting control panel under content. http://help.godaddy.com/article/3547 -
[SOLVED] Run function every 5 mins ??
taquitosensei replied to salman_ahad@yahoo.com's topic in PHP Coding Help
using cron. Are you using a hosted server or is this your machine? What operating system are you using? ignore the bit about drupal and this has a pretty good explanation of what cron is. http://drupal.org/cron