-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
If you write the session after you read it, it will stay active until 24 of inactivity ie very basic <?php function SecChk() { session_start(); if($_session['sec'] = true) { $_session['sec'] = true; }else{ $_session['sec'] = false; die("please login"); } } ?>
-
as a note i am not sure if this is the correct section for this, as its not a "problem"
-
Use GD Lib, php creates a random code and uses GD lib to write to an image
-
define "Security Check" i assume you mean payment ie CC check, yep your need to register for that service, as far as i am aware
-
<?php $selecttrans = "SELECT * FROM transactions WHERE userid = '" . $_SESSION['cymember'] . "' AND status <> 'Pending' ORDER BY submitted DESC;"; $querytrans = mysql_query($selecttrans); $color = true; while ($rowtrans = mysql_fetch_array($querytrans)) { ?> <tr <?php if ($color) { echo 'bgcolor="#eeeeee"'; $color = !$color; }?>> <td>10/30/06</td> <td>cy52860231015</td> <td>Deposit</td> <td> </td> <td>$500.00</td> <td><b>$1,677.65</b></td> </tr> <?php } ?>
-
Ahhh Old Header problem,, well we live and we learn Oh can you click solved please (bottom left)
-
well if imagecreatefromstring isn't working then maybe try building a string from the array ie <?php $newimage = ""; foreach ($imageBytes as $b) { $newimage .= $b; } $img = imagecreatefromstring($newimage); ?> this is a pure guess
-
Its starting to be fun. I'm just getting past the ??? :'( WTF Huh.. and approaching the
-
[SOLVED] Al the "enters" are gone, results show on the same line !!!
MadTechie replied to npsari's topic in PHP Coding Help
without seeing any code i would guess you did something thing wrong try nl2br($data) -
Can you show the jpeg to bytes array code, as it would be a simple matter of reversing it
-
i assume you mean (?:\d+g?[-\/\\])?\d+g *It works well except only gets the g when i would like it to get the letter or word after the digit (excluding p or P) i tried tweeking your RegEx and ended up with this (?:[\d.,]+[^pP\ \d]?[-\/\\])?[\d.,]+[^pP\ \d]+ Seams to work well About ?:, Ahhh So its nothing todo with making it optional.. OK cool that makes more sence (unless i'm wrong) *Funny thing tried the regex and it worked but not exacly how i wanted it to so i played with it but couldn't get it to work, so i started writing this post and when i wrote whats wrong with it, i read what i wrote and add that rule to the regex and it "seams to work" lol Thanks you WildIbug & c4onastick you both have been a BIG help If no more suggections i'll click solved (as it pretty much is)
-
Hummm i always use localhost, whats the error your getting? can you supply some code ?
-
Thanks for helping c4onastick, i think i have a working model i used some of yours and some of mine, Yes my version is long and your version worked but i wanted the values like 100-200g to be pulled in as one, was mainly trail & error but heres my end result ([\d,.]+[^pP\ \d]+)+(([-/\/])[\d,.]+[^pP\ \d])? test data i'm the second chapter but had a small handle on them already the book was for a push.. while this is getting complex (i think maybe too complex for what i am doing) thanx for your help, just reading the process helped alot Oh whats the ?: do again ? i remember reading it but don't think i grasped it
-
Checking if image is not broken from external site
MadTechie replied to LanceT's topic in PHP Coding Help
what about this, if the image fails it will display an image saying "Error loading $imgname" use <img src = "testimage.php?file=http://www.yahoo.com/image.jpg"> create script below filename = testimage.php <?php function LoadJpeg($imgname) { $im = @imagecreatefromjpeg($imgname); /* Attempt to open */ if (!$im) { /* See if it failed */ $im = imagecreatetruecolor(150, 30); /* Create a black image */ $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an errmsg */ imagestring($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; } header("Content-Type: image/jpeg"); $img = LoadJpeg($_GET['file']); imagejpeg($img); ?> Hope it helps --MadTechie EDIT you may need to use urlencode & urldecode for passing the URL 4:22am here, i'm off to bed -
Ok i have got a good book but i have only read the two chapters and currently i am stumped on this (not in the book), i have a sentance that i need to pull the weight out of, now the weight can be 100g, 3kg 77tons etc now i have assumed that the weight will not end in p or P (i hope) anyways heres the example text i have used and this is the RegEx i have used ([ ]+(\d+[^ pP]+))+([-\//]+\d+[^ pP])? Now it seams to half work but group 2 still finds 100 and 99 in the line below if anyone could help me here i would really appreciate it, also if its not too much to ask a little explanation on how you got it to work i am trying to learn this but this is alittle above me at the moment if this doesn't make sence just say i'll try a re-write Thanks in advance --MadTechie
-
Servers rule (simple terms) if i connecting via (whatever):// then i am connecting to the outside world (well kinda) this will connect out then loop back either way the server see it as outside so for secuirty reasons its a no no (unless you override via php.ini)
-
[SOLVED] Select Statement with changing tables base on user selection
MadTechie replied to telsiin's topic in PHP Coding Help
try <?php sql = "SELECT * FROM "'.$_POST['Tableselection'].'" WHERE "'.$_POST['userid'].'" ='1'"; ?> better looking still <?php sql = "SELECT * FROM `{$_POST['Tableselection']}` WHERE `{$_POST['userid']}` ='1';"; ?> EDIT: Updated 2nd one -
Congrats 448191 PS Not it
-
erm the "Change Password" option! in cPanel! http://domain:port/frontend/x/passwd/index.html
-
only thing i could think of is find something incommon with the files to check for :-\ ie is the first 4k always the same (excluding a few bytes in fixed positions)
-
Which always makes you wonder why you see statments like
-
looks like a GET Array! thorpe code will work fine
-
"PARTLY|MOSTLY+CLOUDY|SUNNY+THUNDERSTORM" = string plain and simple so the array $vws_icon has a key called "PARTLY|MOSTLY+CLOUDY|SUNNY+THUNDERSTORM" (kinda long) with a value of "./icons/" . "$daynight" . "_tstorm.$image_format" $daynight & $image_format will have values that will be pulled inn
-
what are (s)ppf files ? what program uses them ?