-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
[SOLVED] Newbie needs help Im going crazy with this error code.
MadTechie replied to pnkgirl25's topic in PHP Coding Help
use this <?php $host="p41mysql63.secureserver.net"; // Host name ? $username="CourtneyBlacher"; // Mysql username ? $password="######"; // Mysql password ? $db_name="temp_members_db"; // Database name ???//Connect to server and select database.? mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); ? mysql_select_db("$db_name")or die("cannot select DB"); ?> replaced ###### with password -
welcome can you please click topic solved (bottom left) save other reading this trying to help when its been solved and welcome to the board
-
[SOLVED] Passing variables to an image creating php file
MadTechie replied to Kurrel's topic in PHP Coding Help
not really.. i wouldn't dump a 100mb image resource to one LOL, i kinda look at them like cookies but more secure but remeber the sessions timeout..by the server, cookie timeout by the client i didn't bring up AJAX as your pass the variables just like a _GET.. i would probably choose MySQL and use _GET to pass the ID or something refering to a Unique Job -
this is a basic setup of using an external function <?php include "common.php"; hello(); bye("madtechie"); ?> common.php <?php function hello() { echo "hello world<br>"; } funtion bye($name) { echo "bye bye $name"; } ?>
-
[SOLVED] Passing variables to an image creating php file
MadTechie replied to Kurrel's topic in PHP Coding Help
Sessions, cookies, mysql, flat file.. their all the same.. and they wont become messy by them selfs.. as for posting to php.. yep you can do that (lol but kinda messy) without knowing exactly what your doing its hard to say what route i would take but but to sum up.. passing a small amount of into use _GET, if private, temporary or a little larger use _SESSION (or _COOKIE's if not private), if much larger and you dont have SQL and its just a dump of data then flatfile, other than that use SQL -
How To Display An Image From A MySQL Table
MadTechie replied to JustinK101's topic in PHP Coding Help
updated (forgot some and too late to edit last post! <?php $ID = (int)$_GET['id']; if( $ID == 0 ) { return; } require_once("db_config.php"); require_once("db_connect.php"); $sql = "SELECT product_images.image_thumb FROM product_images WHERE product_images.id = $ID"; $result = mysql_query($sql) or die(mysql_error()); $row = @mysql_fetch_object($result); $img = $row->image_thumb; header("Content-type: image/jpeg"); //echo $img; imagejpeg($img); exit; ?> -
ok remove that line, and do this var_dump($row->Category); if ($row->Category == 1) { echo "test 1"; }
-
do this just before the if add this echo "<pre>";print_r($row);die; whats displayed
-
in a word .. NO,
-
How to use a "URL-encoded regex" to strip away any image
MadTechie replied to ghurty's topic in Regex Help
an example would help -
How To Display An Image From A MySQL Table
MadTechie replied to JustinK101's topic in PHP Coding Help
try this <?php $ID = (int)$_GET['id']; if( $ID == 0 ) { return; } require_once("db_config.php"); require_once("db_connect.php"); $sql = "SELECT product_images.image_thumb FROM product_images WHERE product_images.id = $ID" $result = mysql_query($sql) or die(mysql_error()); $row = @mysql_fetch_object($result); $img = $row->image_thumb; header("Content-type: image/jpeg"); //echo $img; imagejpeg($img); exit -
image.php will not work we're come back to that for now test imageDisplay.php directly
-
without knowing the class its hard to say but from what you posted $delete = $db->delete($glob['dbprefix']."CubeCart_inventory", $where, "0,1"); should work
-
try if ($datemade >= ($datemade+(2*24*60*60) )){
-
as Daniel0 said. so ImagePNG($im,'image1.png') should be ok
-
humm its running 4 times.. thats not right.. change $delete = $db->delete($glob['dbprefix']."CubeCart_inventory", $where); to $delete = $db->delete($glob['dbprefix']."CubeCart_inventory", $where, "0,1"); edit: updated
-
close, try echo $query; mysql_query($query, $this->db); this should display DELETE blar blar blar blar blar blar can you post that, it may provide some insight
-
imagejpeg — Output image to browser or file bool imagejpeg ( resource $image [, string $filename [, int $quality]] )
-
can you please click topic solved (save other clicking here to help, only to find its solved)
-
your see some statements like DELETE FROM table where X =1 normally in or near a mysql_query( in your included file (class) your see function delete( you need to echo the string being passed to mysql_query(
-
PHP explode -> all characters before the first dot
MadTechie replied to elpaisa's topic in PHP Coding Help
$data = "statistics.STATUS "; $result = preg_replace('/.*\.(.*)/sim', '$1', $data); -
well as its handled by your class check from their.. echo the statements etc
-
i assume you mean the URL of the current view page.. simpler code if so then <?php $cPage = $_SERVER["PHP_SELF"]; $parts = explode("/",$cPage); $page = $parts[count($parts)-1]; $path = $parts[count($parts)-2]; echo $path."~~".$page; ?>
-
view source and check that the {PRODUCT_ID}&cat_id={CAT_ID} are set correctly (ie being the numbers and not static text)
-
Cool, can you please click topic solved bottom left i'm glade it up and running