Jump to content

gdfhghjdfghgfhf

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by gdfhghjdfghgfhf

  1. hmm i dont have direct access to the server - only ftp or cpanel - so i cant have access to that php.ini file anyway im pretty sure this isnt the problem since i am uploading 10k images bump!
  2. btw, my image is 10kb so i boubt this is the problem
  3. where do i see the current memory allowed in phpinfo? PHP Logo PHP Version 4.4.6 System Linux server.supersonicserver.com 2.6.18-8.1.15.el5.028stab049.1 #1 SMP Thu Nov 8 16:23:12 MSK 2007 i686 Build Date Jun 27 2007 20:02:12 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pgsql=/usr' '--enable-sockets' '--enable-track-vars' '--with-xmlrpc' '--with-zip' '--with-zlib' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20050606 Debug Build no Zend Memory Manager enabled Thread Safety disabled Registered PHP Streams php, http, ftp, https, ftps, compress.zlib Zend logo This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies PHP Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference Off Off allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_classes no value no value disable_functions no value no value display_errors Off Off display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2039 2047 expose_php On On extension_dir /usr/local/lib/php/extensions/no-debug-non-zts-20020429 /usr/local/lib/php/extensions/no-debug-non-zts-20020429 file_uploads On On gpc_order GPC GPC highlight.bg #FFFFFF #FFFFFF highlight.comment #FF8000 #FF8000 highlight.default #0000BB #0000BB highlight.html #000000 #000000 highlight.keyword #007700 #007700 highlight.string #DD0000 #DD0000 html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .:/usr/local/lib/php .:/usr/local/lib/php log_errors On On log_errors_max_len 1024 1024 magic_quotes_gpc Off Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off max_execution_time 30 30 max_input_time 60 60 open_basedir no value no value output_buffering 4096 4096 output_handler no value no value post_max_size 8M 8M precision 14 14 register_argc_argv Off Off register_globals Off Off report_memleaks On On safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from no value no value sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i serialize_precision 100 100 short_open_tag On On SMTP localhost localhost smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 2M 2M upload_tmp_dir no value no value user_dir no value no value variables_order GPCS GPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On apache APACHE_INCLUDE no value APACHE_TARGET no value Apache Version Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.6 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a Apache Release 10337100 Apache API Version 19990320 Hostname:Port quebecunderground.net:80 User/Group nobody(99)/99 Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100 Timeouts Connection: 300 - Keep-Alive: 15 Server Root /usr/local/apache Loaded Modules mod_limitipconn, mod_auth_passthrough, mod_log_bytes, mod_bwlimited, mod_php4, mod_frontpage, mod_ssl, mod_setenvif, mod_so, mod_expires, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core Directive Local Value Master Value child_terminate 0 0 engine 1 1 last_modified 0 0 xbithack 0 0 Apache Environment Variable Value DOCUMENT_ROOT /home/qcanarco/public_html HTTP_ACCEPT text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING gzip,deflate HTTP_ACCEPT_LANGUAGE fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 HTTP_CONNECTION keep-alive HTTP_COOKIE bblastvisit=1208118498; bblastactivity=0; bbsessionhash=cea77ae4a6258bb6a598938d0d664b63; bbcpsession=17a79fdd5411164a6affe8dda932ad55; bbuserid=1; bbpassword=577dd33023d5a94e58ccc3d333b6f0da HTTP_HOST quebecunderground.net HTTP_KEEP_ALIVE 300 HTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin REDIRECT_QUERY_STRING vbseourl=db/img/phpinfo.php REDIRECT_STATUS 200 REDIRECT_URL /db/img/phpinfo.php REMOTE_ADDR 216.246.226.227 REMOTE_PORT 52760 SCRIPT_FILENAME /home/qcanarco/public_html/vbseo.php SERVER_ADDR 208.110.80.27 SERVER_ADMIN webmaster@quebecunderground.net SERVER_NAME quebecunderground.net SERVER_PORT 80 SERVER_SIGNATURE <ADDRESS>Apache/1.3.37 Server at quebecunderground.net Port 80</ADDRESS> SERVER_SOFTWARE Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.6 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.1 REQUEST_METHOD GET QUERY_STRING vbseourl=db/img/phpinfo.php REQUEST_URI /db/img/phpinfo.php SCRIPT_NAME /vbseo.php HTTP Headers Information HTTP Request Headers HTTP Request GET /db/img/phpinfo.php HTTP/1.1 Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding gzip,deflate Accept-Language fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 Connection keep-alive Cookie bblastvisit=1208118498; bblastactivity=0; bbsessionhash=cea77ae4a6258bb6a598938d0d664b63; bbcpsession=17a79fdd5411164a6affe8dda932ad55; bbuserid=1; bbpassword=577dd33023d5a94e58ccc3d333b6f0da Host quebecunderground.net Keep-Alive 300 User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 HTTP Response Headers X-Powered-By PHP/4.4.6 Keep-Alive timeout=15, max=96 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html bcmath BCMath support enabled calendar Calendar support enabled ctype ctype functions enabled curl CURL support enabled CURL Information libcurl/7.15.3 OpenSSL/0.9.7a zlib/1.2.1.2 ftp FTP support enabled gd GD Support enabled GD Version bundled (2.0.28 compatible) GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled imap IMAP c-Client Version 2004 mbstring Multibyte Support enabled Japanese support enabled Simplified chinese support enabled Traditional chinese support enabled Korean support enabled Russian support enabled Multibyte (japanese) regex support enabled mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1. Directive Local Value Master Value mbstring.detect_order no value no value mbstring.encoding_translation Off Off mbstring.func_overload 0 0 mbstring.http_input pass pass mbstring.http_output pass pass mbstring.internal_encoding no value no value mbstring.language neutral neutral mbstring.substitute_character no value no value mcrypt mcrypt support enabled version >= 2.4.x Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes Supported modes cbc cfb ctr ecb ncfb nofb ofb stream Directive Local Value Master Value mcrypt.algorithms_dir no value no value mcrypt.modes_dir no value no value mhash MHASH support Enabled MHASH API Version 20020524 mysql MySQL Support enabled Active Persistent Links 1 Active Links 1 Client API version 4.1.22 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib -lmysqlclient Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off openssl OpenSSL support enabled OpenSSL Version OpenSSL 0.9.7a Feb 19 2003 overload User-Space Object Overloading Support enabled pcre PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 7.0 18-Dec-2006 pgsql PostgreSQL Support enabled PostgreSQL(libpq) Version 7.4.17 Multibyte character support enabled SSL support enabled Active Persistent Links 0 Active Links 0 Directive Local Value Master Value pgsql.allow_persistent On On pgsql.auto_reset_persistent Off Off pgsql.ignore_notice Off Off pgsql.log_notice Off Off pgsql.max_links Unlimited Unlimited pgsql.max_persistent Unlimited Unlimited posix Revision $Revision: 1.51.2.4.2.3 $ session Session Support enabled Registered save handlers files user Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 Off Off session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid Off Off sockets Sockets Support enabled standard Regex Library Bundled library enabled Dynamic Library Support enabled Path to sendmail /usr/sbin/sendmail -t -i Directive Local Value Master Value assert.active 1 1 assert.bail 0 0 assert.callback no value no value assert.quiet_eval 0 0 assert.warning 1 1 auto_detect_line_endings 0 0 default_socket_timeout 60 60 safe_mode_allowed_env_vars PHP_ PHP_ safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry user_agent no value no value tokenizer Tokenizer Support enabled xml XML Support active XML Namespace Support active EXPAT Version 1.95.6 xmlrpc core library version xmlrpc-epi v. 0.51 php extension version 0.51 author Dan Libby homepage http://xmlrpc-epi.sourceforge.net open sourced by Epinions.com zip Zip support enabled zlib ZLib Support enabled Compiled Version 1.2.1.2 Linked Version 1.2.1.2 Directive Local Value Master Value zlib.output_compression Off Off zlib.output_compression_level -1 -1 zlib.output_handler no value no value Additional Modules Module Name Environment Variable Value SELINUX_INIT YES CONSOLE /dev/null TERM linux INIT_VERSION sysvinit-2.85 PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin RUNLEVEL 3 runlevel 3 PWD / PREVLEVEL N previous N HOME / SHLVL 2 _ /usr/local/apache/bin/httpd PHP Variables Variable Value PHP_SELF /db/img/phpinfo.php _REQUEST["bblastvisit"] 1208118498 _REQUEST["bblastactivity"] 0 _REQUEST["bbsessionhash"] cea77ae4a6258bb6a598938d0d664b63 _REQUEST["bbcpsession"] 17a79fdd5411164a6affe8dda932ad55 _REQUEST["bbuserid"] 1 _REQUEST["bbpassword"] 577dd33023d5a94e58ccc3d333b6f0da _COOKIE["bblastvisit"] 1208118498 _COOKIE["bblastactivity"] 0 _COOKIE["bbsessionhash"] cea77ae4a6258bb6a598938d0d664b63 _COOKIE["bbcpsession"] 17a79fdd5411164a6affe8dda932ad55 _COOKIE["bbuserid"] 1 _COOKIE["bbpassword"] 577dd33023d5a94e58ccc3d333b6f0da _SERVER["DOCUMENT_ROOT"] /home/qcanarco/public_html _SERVER["HTTP_ACCEPT"] text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 _SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7 _SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate _SERVER["HTTP_ACCEPT_LANGUAGE"] fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 _SERVER["HTTP_CONNECTION"] keep-alive _SERVER["HTTP_COOKIE"] bblastvisit=1208118498; bblastactivity=0; bbsessionhash=cea77ae4a6258bb6a598938d0d664b63; bbcpsession=17a79fdd5411164a6affe8dda932ad55; bbuserid=1; bbpassword=577dd33023d5a94e58ccc3d333b6f0da _SERVER["HTTP_HOST"] quebecunderground.net _SERVER["HTTP_KEEP_ALIVE"] 300 _SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 _SERVER["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin _SERVER["REDIRECT_STATUS"] 200 _SERVER["REMOTE_ADDR"] 216.246.226.227 _SERVER["REMOTE_PORT"] 52760 _SERVER["SCRIPT_FILENAME"] /home/qcanarco/public_html/dbimgphpinfo.php _SERVER["SERVER_ADDR"] 208.110.80.27 _SERVER["SERVER_ADMIN"] webmaster@quebecunderground.net _SERVER["SERVER_NAME"] quebecunderground.net _SERVER["SERVER_PORT"] 80 _SERVER["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.37 Server at quebecunderground.net Port 80</ADDRESS> _SERVER["SERVER_SOFTWARE"] Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.6 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a _SERVER["GATEWAY_INTERFACE"] CGI/1.1 _SERVER["SERVER_PROTOCOL"] HTTP/1.1 _SERVER["REQUEST_METHOD"] GET _SERVER["QUERY_STRING"] vbseourl=db/img/phpinfo.php _SERVER["REQUEST_URI"] /db/img/phpinfo.php _SERVER["SCRIPT_NAME"] /db/img/phpinfo.php _SERVER["PATH_TRANSLATED"] /home/qcanarco/public_html/dbimgphpinfo.php _SERVER["PHP_SELF"] /db/img/phpinfo.php _SERVER["vbseo_fn"] phpinfo.php _SERVER["VBSEO_URI"] /db/img/phpinfo.php _SERVER["PATH_INFO"] /db/img/phpinfo.php _SERVER["argv"] Array ( [0] => ) _ENV["REQUEST_URI"] /db/img/phpinfo.php _ENV["SCRIPT_NAME"] /db/img/phpinfo.php _ENV["PHP_SELF"] /db/img/phpinfo.php _ENV["PATH_INFO"] /db/img/phpinfo.php _ENV["SCRIPT_FILENAME"] /home/qcanarco/public_html/dbimgphpinfo.php _ENV["PATH_TRANSLATED"] /home/qcanarco/public_html/dbimgphpinfo.php PHP License This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net. Modified by Daniel0 to use a code tag instead of a quote tag so it takes up less space.
  4. thanks for the explanations, i think this is leading somewhere hehe following your instructions i tryed with this code list($width, $height, $type, $attr) = getimagesize('db/img/images/".$imagepath."'); if ($type == '2') { $image = imagecreatefromjpeg($file) ; } if ($type == '4') { $image = imagecreatefromgif($file) ; } but now the upload wont work, even with jpg the image will be all black sorry for bothering again... but i'm still a newbie
  5. thanks a lot! now could anyone help me with the gifs
  6. Thanks a lot! Did exactly what i wanted only one detail: the first image i am getting is blank, it is trying to show image from "images/photo_" nothing more... there isnt even a filename after the prefix.... i have 8 images in the folder i am testing, and it is displaying 9... so its not a problem with the files or the filenames weird
  7. i have a bunch of pics in a folder of my site (called /images/), and on a page i'd like to display all pictures starting with the prefix "photo_" the files i want are all starting by photo_ but have different names, and there is too many to enter them manually how would it be possible to find all pics with that particuliar prefix, and display them?
  8. yep i just went through one of these tutorials about storing images in mysql in BLOB format i also saw a script that will do exactly what you want: take all images you have in a folder and put them in database just search on google with revealent keywords and you will find it
  9. i'm also having another problem: the script includes a function to resize the main image if it exceeds a certain width i have set it to 800 $modwidth = 800; if works fine but my problem is when the width is less than 800 : the image will be resized to 800px width anyway, thus enlarging it, and loosing quality with big nasty pixels instead of a fluid image
  10. gd GD Support enabled GD Version bundled (2.0.28 compatible) GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled i think 2.0 is a recent version??
  11. i have this basic upload script which will upload an image inside "images/" folder. It is very simple, and works with only one file the problem is that it will work only with JPEG files If i try to upload with a GIF image, the result will be a black image could anyone help me to make it work with gif files? <form action="<?php echo $_server['php-self']; ?>" method="post" enctype="multipart/form-data" id="something" class="uniForm"> <?php include("bands.php"); ?><br> <input name="new_image" id="new_image" size="30" type="file" class="fileUpload" /> <br> <button name="submit" type="submit" class="submitButton">AJOUTER L'IMAGE</button> </form> <?php $band = $_POST['band']; if(isset($_POST['submit'])){ if (isset ($_FILES['new_image'])){ $imagenamz = $_FILES['new_image']['name']; /* $numz = time(); $nums = date('dmy'); $num1 = "$nums" . $numz; $band = $_POST['band']; echo $band; echo "<hr>"; $imagename = "$band" . $num1; echo $imagename; */ echo "L'image a été ajouté dans l'album photos de <b>$band</b><hr><br>"; $originalname = $_FILES['new_image']['name']; $date = date('dmy'); $imagename = "$band" . "_" . $date . "_" . $originalname; echo $imagename; $source = $_FILES['new_image']['tmp_name']; $target = "images/".$imagename; move_uploaded_file($source, $target); $imagepath = $imagename; $save = "images/" . $imagepath; //This is the new file you saving $file = "images/" . $imagepath; //This is the original file list($width, $height) = getimagesize($file) ; $modwidth = 800; $diff = $width / $modwidth; $modheight = $height / $diff; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; $save = "images/sml_" . $imagepath; //This is the new file you saving $file = "images/" . $imagepath; //This is the original file list($width, $height) = getimagesize($file) ; $modwidth = 150; $diff = $width / $modwidth; $modheight = $height / $diff; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; echo "<img src='images/".$imagepath."'><br>"; echo "Thumbnail: <img src='images/sml_".$imagepath."'>"; } } ?>
  12. hmmm i'm getting an "unexpected end" error what part of the script am i supposed to replace with your code, just to be sure?
  13. hmmm that site you gave me won't work can you give me an example how i could randomize this query? It's currently ordered by ids $f5 = "$bbuserinfo[field5]"; $query = "SELECT * FROM quebec_userfield WHERE field5='$f5' ORDER BY userid DESC"; $res = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($res)) { $id = $row["userid"]; $query = "SELECT username, userid FROM quebec_user WHERE userid=$id ORDER BY userid DESC"; $res = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($res)) { $nom = $row["username"]; echo "<a href=\"member.php?username=$nom\">"; echo $nom; echo "</a><br>"; } }
  14. is it possible to randomize the order of a query? i want to use this to display a random entry of a table
  15. serialized version of $a: a:7:{i:1;s:18:"111111111111111111";i:2;s:18:"222222222222222222";i:3;s:13:"3333333333333";i:4;s:13:"4444444444444";i:5;s:14:"55555555555555";i:6;s:12:"666666666666";i:7;s:12:"777777777777";}
  16. hmmm it doesnt work for me, the thing to delete ($legroupe) is still here what is unset? it does the same thing i was doing with str_replace? btw, $legroupe is not serialized, but $a (row["options"]) is
  17. here's what i'm trying to do i have a field in my database (options in table quebec_calendarcustomfield) used in vbulletin for calendar custom fields. I want to allow a group of users to add and delete fields... So now i'm trying to make a page where my users are able to delete a field. All fields are serialized and stored in quebec_calendarcustomfield WHERE calendarcustomfieldid = '1' so i tryed to unserialize it, do a str_replace to delete the field i want, and serialize it back.... but i'm stuck at serializing back, i can't find out how to serialize the whole array include("db.php"); $query = "SELECT options FROM quebec_calendarcustomfield WHERE calendarcustomfieldid = '1'"; $res = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($res)) { $a = $row["options"]; $unseri = unserialize($a); foreach($unseri as $value) { $hmm = str_replace("$legroupe", "", "$value"); echo $hmm; } echo "<br><br>"; $uhh = serialize($value); echo $uhh; $cc = mysql_real_escape_string($uhh); $zxc = "UPDATE quebec_calendarcustomfield SET options = '$uhh' WHERE calendarcustomfieldid = '1'"; $res = mysql_query($zxc) or die(mysql_error()); } $legroupe is a defined $_GET value and it contains the line i want to delete $a = $row["options"]; is the serialized array of ALL the fields, including the one i want to delete
  18. $legroupe is a defined $_GET value the code of my str_replace is working, but i want it to take out an entire line say i want to replace something here: if i replace "4444444" the result will be: see? the line is still here, but it's empty i want a result like this:
  19. uh? what do you mean.... it works, it just that it will just remove the word and not the entire line (keeping a line break between 2 items)
  20. i have an array with unserialized stuff.... so it output one item per line i use this code to take out one of the item (one line) $a = $row["options"]; $unseri = unserialize($a); foreach($unseri as $value) { $hmm = str_replace("$legroupe", "", "$value"); echo $hmm."<br />\n"; } the only problem is that the line is still here, it's just empty. I want to completly remove it. I tryed with str_replace("$legroupe\n", "", "$value"); but it doesnt replace anything
  21. could you give me an example plz? i'm newbie with the syntax thing... and btw what is the difference between preg_ and str_ ?
  22. ok well i have a variable that includes a bunch of words exemple: "black cat blue fish brown dog brown horse black dog" i.e. i want to take out the words "brown dog"... these 2 words have to be next to each others and can be located anywhere in the string which one should i use? preg_replace or str_replace? could anyone give me an example how i can do that?
×
×
  • 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.