
BobcatM
Members-
Posts
92 -
Joined
-
Last visited
Never
Everything posted by BobcatM
-
'M')" Why do you have this?
-
mysql_query causing unexpected T_ENCAPSED_AND_WHITESPACE
BobcatM replied to heckler0077's topic in PHP Coding Help
Try this.. Also post the rest of your code please. mysql_query("INSERT INTO crashReport (application, appVersion, osVersion, comments, time, date, mailaddress, rapport) VALUES ('$_POST[application]', '$_POST[appVersion]', '$_POST[osVersion]', '$_POST[comments]', '$_POST[time]', '$_POST[date]', '$_POST[mailaddress]', '$_POST[rapport]')"); -
[SOLVED] Add item to a .txt file [Newby here]
BobcatM replied to dennisvdz's topic in PHP Coding Help
<?php $filename = "test01.txt"; //the name of our file. $content = "This is our test file"; //what we will be writing to our file. $strlength = strlen($content); //gets the length of our $content string. $create = fopen($filename, "w"); //uses fopen to create our file. $write = fwrite($create, $content, $strlength); //writes our string to our file. $close = fclose($create); //closes our file echo("File Created, Click <a href='$filename'> Here </a> to view it."); ?> -
Make sure there are no lines above <?php - what was wrong with mine one time.
-
Not sure, just tried your code and it work's fine.
-
haha... Crayon you are awsome.
-
How about trying to run it and see what you get?
-
Here is an example of the one I use for flash sites, so customers can update the regular stuff as needed like news. A little form - <form action="news.php" method="POST"> <input type="hidden" name="action" value="login"> <p align="center">UPDATE NEWS:<br /> <textarea rows="30" name="textbox" cols="80"> <?php include("news.txt") ?> </textarea><br /> <input type="submit" value=" Save Changes " class="button"> </p></form> And how I process it - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Untitled Document</title> <script language="php"> $textbox = stripslashes($textbox); $search = array ('@[\r]+@'); $replace = array (''); $textbox = preg_replace($search, $replace, $textbox); $txt = ''; $output = $textbox; $fp = fopen('news.txt','w'); $txt = "$output"; fputs($fp, $txt); fclose($fp); </script> <style type="text/css"> <!-- .style1 { font-size: 24px; color: #000066; } .style2 {font-size: 24px; color: #000066; font-weight: bold; } --> </style> </head> <body bgcolor="#FFFFFF"> <p align="center" class="style1"> </p> <p align="center" class="style2">UPDATES COMPLETE, THANK YOU.</p> <p align="center" class="style2"><input name="Submit" type="submit" ONCLICK="window.location.href='updates.php'" value=" Back To Updates Page " /> </p> </body> </html> Hope that helps, if you need anymore info let me know. Heading to bed, can't see straight.
-
Not sure I understand what you are asking. But why not use PHP and write to a text file and use Flash to read the txt file. That's what I do, but you may need something else.
-
[SOLVED] Displaying Results on Same Page in PHP & MySQL
BobcatM replied to waqaslone's topic in PHP Coding Help
$SQLstring ="SELECT * FROM $Table1 WHERE $select LIKE' $srch'"; Is $Table1 suppose to be just $Table? -
$row = mysql_fetch_assoc($query)); You have an extra ) on the right I believe.
-
Just run a check every 5 minutes like Russell mentioned to check if they are active. Something like setup a php script that will retrieve your count() and echo it. Then if you wanted have a JavaScript call that php script in whatever time you designate. By using AJAX you would be able to retrieve the value echoed from your php script in the JavaScript variable. Hope that makes sense.
-
Go to the link MadTechie provided and it will explain it better.
-
$remotefile = '[url=http://ws.audioscrobbler.com/1.0/user/StevenFX/recenttracks.xml%27;]http://ws.audioscrobbler.com/1.0/user/StevenFX/recenttracks.xml';[/url] $src = imagecreatefrompng('[url=http://www.l33tsig.net/sig/1/Tagged.png%27]http://www.l33tsig.net/sig/1/Tagged.png'[/url]); Don't suppose [/url] not being inside the brackets has anything to do with it?
-
$query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'"); Is it the comma after emails?
-
If you want to do it dirty like you say, after you insert the data into table one, run a query right after that and see what the last one was you inserted. Like this - $sql = "SELECT num FROM table ORDER BY num desc limit 1"; $result = mysql_query($sql); Then turn around and insert that back into to table 2.
-
$result2 = mysql_query($query2) or die (mysql_error()); I do not see a $query2 in your code?
-
[SOLVED] Best way to create an invoice after submit..
BobcatM replied to A JM's topic in PHP Coding Help
Also if you want to destroy the session after you have displayed the page this would work. <?php session_destroy(); ?> -
[SOLVED] Best way to create an invoice after submit..
BobcatM replied to A JM's topic in PHP Coding Help
That is correct. -
Control the organization of data table by headers
BobcatM replied to Kay1021's topic in PHP Coding Help
Thanks Ken, forgot to mention that. $col = (isset($_GET['col']) ? $_GET['col'] : 'name'); -
Control the organization of data table by headers
BobcatM replied to Kay1021's topic in PHP Coding Help
Something like.. $query="SELECT * FROM whatever ORDER BY $col DESC"; In your table <th scope="col"><h2><a href="pagename.php?col=name">Name</a></h2></th> <th scope="col"><h2><a href="pagename.php?col=phone">Phone Number</a></h2></th> etc..