Jump to content

c_shelswell

Members
  • Posts

    275
  • Joined

  • Last visited

    Never

Everything posted by c_shelswell

  1. sorry just saw your post properly what do you mean "don't use the deprecated PHP 4 syntax for OOP" as i said i'm pretty new to this
  2. Hi I'm very new to oop but going to give it a go. I've got a class that validates and submits a form. It's all working great except that on a successful submission i'd like it to return something to say success. I've set my var $processReturn at the top of my class which is called 'siteSession' if i try and get the data on my page by doing a print_r ($siteSession) i get all my other vars but $processReturn seems to stay empty even though i'm setting it by $this->processReturn = 'success' i can't figure out why. Here's my code: include ("form_errors.php"); include ("site_database.php"); class siteSession { var $lastPage; var $currentUrl; var $processReturn; // << this is what i want to set /* Class constructor */ function siteSession() { session_start(); /* Set referrer page */ if (isset($_SESSION['formUrl'])) { $this->lastPage = $_SESSION['formUrl']; } else { $this->lastPage = "/"; } /* Set current url */ $this->currentUrl = $_SESSION['formUrl'] = $_SERVER['PHP_SELF']; } function newsGigsUpload($data, $fileData) { global $formValidation, $siteDB; /****** i have my validation in here **********/ //form success $this->processReturn = 'success'; // << set here but not working???!! return 0; } does this all make any sense? Any help would be great Thanks
  3. Hi I've got an ajax script which when a user enters an email address it calls an iframe to deliver a file. This all works fine with firefox but ie6 just says 'invalid argument' i'm pretty sure it's to do with my iFrame but i have no idea what. I've added the code below if any one knows what might be causing it that'd be great. else if(xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") { ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "./require/promo_dl.php"); ifrm.style.width = 0+"px"; ifrm.style.height = +"px"; document.body.appendChild(ifrm); document.getElementById("ajaxResponse").innerHTML=xmlHttp.responseText; } cheers
  4. Hi thanks for your replies. I've tried using set_time_limit(0) in the script doing the resizing, to no avail. It works on a different server where the memory is set to 24mb this server is 20mb. I don't have access to the .ini file unfortunately and the provider won't turn it up. I'm going to give this a go : "ini_set("memory_limit", "16MB");" cheers samshel. I take it I just add that at the top of my script? Cheers
  5. Hi I've got a script to resize images that a user uploads. This all works fine but I've come across a problem with it on another server. If the user uploads pictures over a certain pixel size i get a 500 internal server error which i've found is caused by php not having enough memory. Does anyone know of a way to get round this? Can I temporarily set the php memory from a script? I don't think i can use a htaccess file. Any ideas would be great. Cheers
  6. Hi sorry I've been away for a while. What's an AIR application? I don't think the guy'll go for it, it sounds like a major pain in the arse. Especially to ensure it works on a whole load of different platforms/setups. Cheers
  7. Hi I'm not even sure if this is possible, i can think of lots of reasons why it wouldn't be but.... A client has asked if it would be possible to have a divx file link in a web site that when a user clicks the link it would automatically request a dvd in the drive then burn the dvd. Is this possible? I thought it would involve too many variables of different users with different software. Any ideas would be great thanks.
  8. If I think i've understood this correctly could you not make your query 'GROUP by category' instead? You could then output all your data. Cheers
  9. cheers ended up doing something similar. Thanks
  10. I'm guessing you don't have read/write privileges on the folder you're trying to write too? In your ftp client set the rights to 777
  11. Hi I'm just trying to make a simple 6 file upload. Is it possible to do an array_sum on the file size below to determine if the user is uploading too much? eg array_sum($_FILES['size']); Array ( [photo1] => Array ( [name] => bucket.jpg [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php543F.tmp [error] => 0 [size] => 308989 ) [photo2] => Array ( [name] => Haddock.gif [type] => image/gif [tmp_name] => C:\Windows\Temp\php544F.tmp [error] => 0 [size] => 46677 ) [photo3] => Array ( [name] => forest.jpg [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php5450.tmp [error] => 0 [size] => 118882 ) [photo4] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) [photo5] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) [photo6] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) ) cheers
  12. yeah that's something like what i'd have expected - thanks. Can't believe there's not a mysql thing like location='%'
  13. it's pretty simple at the moment the $_POST data comes in to a function and creates the query below: function getProperties($data) { $conn = db_connect(); $q = "select * from properties where location='".$data['location']."' and rent_pcm between '".$data['rentFrom']."' and '".$data['rentTo']."' and bedrooms between '".$data['minBeds']."' and '".$data['maxBeds']."' and furnishings='".$data['furnishings']."'and type='".$data['propType']."'"; $r = mysql_query($q) or die (mysql_error()); while($row = mysql_fetch_array($r, MYSQL_ASSOC)) { $res[] = $row; } I was just really hoping there would be a way to make a variable for the query be 'anything'. I was looking at mysql injection to see if i could search for "OR 1" but it didn't seem to work. Cheers
  14. That'll mean I'll have to create my query using php i.e. if that data contains 'any' for location don't include it in the query. I had hoped I could just make one query that would cover all bases. Cheers
  15. Hi I've got a mysql query which works fine but I'm trying to make it so i don't have to make many querys and can rely on the one. I'm sure this is really easy but i'm struggling to find anything for it. My query is select * from properties where location='2' and rent_pcm between '300' and '1000' and bedrooms between '2' and '3' and furnishings='full'and type='flat' Now providing the user selects a variable on the previous page the query is fine but there's also the option to search 'any' so the query could be changed to "location='any'" however the db doesn't hold 'any' so how do i make it just choose any location? I thought I should use % but that doesn't seem to work. Thank for any help
  16. Hi I need to start a file downloading using javascript. I had been using php's header but i'm using ajax to collect a users email and it doesn't appear to work anymore. So i was hoping after my page had been called succesfully i could use javascript to start the download? I've tried window.open() which works fine but the firefox pop up stopper blocks it first is there a way to get round this? Cheers
  17. Andy - thank you - i now feel like a total idiot that was exactly my problem, had it set to tinyint. Thanks very much
  18. I have no idea why i keep getting this error no matter wether i'm online or just using the same database locally. I've got a pretty basic table with 7 columns. I have a primary key which is 'ID' set to auto_increment however for some very very strange reason whenever i try to insert data i get 'Duplicate entry '127' for key 1' my query is insert into photos values (NULL, '1211275966', 'ghj', 'thumbMay 08 Uretiti and Horses 002.JPG', 'May 08 Uretiti and Horses 002.JPG','More Horse', '8') So i was under the impression it should add the next number in the chain... 128??? Any help would be great cheers
  19. great thanks - really couldn't remember how to do it at all
  20. Hi I know this is possible just can't remember how to do it. How do you make an input box un-editable? ie <input type='text' name='example' change='false'> That kind of thing Cheers
  21. With a bit more searching I managed to find a really useful thread. http://www.phpbuilder.com/board/showthread.php?t=10330933 hopefully this helps someone else too.
  22. Trouble is I'm allowing a user to edit what they've typed so for instance. They might type "this is a \" then if they edit it they type "this is a \\" i've added it to the db using mysql_real_escape_string now when i show the entry again it's stripped the extra backslash. Any ideas? Cheers
  23. Hi, I'm sure this must be pretty easy I just don't know how to do it. How do i stop stripbackslashes from removing backslashes that a user has actually inputted? Eg a user can enter a backslash but then on returning to the page becuase i have stripbackslashes cant see the ones that should be there. Cheers
  24. Hi i've started getting a strange error which is: Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 I've done a bit of searching but am still unsure as to what's causing it. Could it be this part of my code is the issue: $_SESSION['order'] = $_GET['od']; $_SESSION['mid'] = $_GET['mid']; $_SESSION['qty'] = $_GET['qty']; $_SESSION['thisuser'] = $_GET['user']; Cheers for any help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.