-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
[SOLVED] addition issue on alphanumeric value
MadTechie replied to Walker33's topic in PHP Coding Help
someone didn't read my update <?php $res = "S07"; $res = substr($res,0,1).sprintf('%02s', (substr($res,1)+1)); echo $res; ?> -
[SOLVED] addition issue on alphanumeric value
MadTechie replied to Walker33's topic in PHP Coding Help
do you mean something like this <?php $res = "S19"; //$res = substr($res,0,1).(substr($res,1)+1); $res = substr($res,0,1).sprintf('%02s', (substr($res,1)+1)); //Updated echo $res; ?> that works with 1 letter then 2 numbers if you need something my complex ie unknown number of letter followed by 1 or more numbers then this maybe better <?php $res = "Something19"; if (preg_match('/([a-z]*)(\d+)/i', $res,$match)) { //$res = $match[1].($match[2]+1); $res = $match[1].sprintf('%02s', $match[2]+1)); //Updated } echo $res; ?> this will work with any letters follow by 1 or 2 numbers EDIT: oops missed something just updated to so 01 would become 02 instead of just 2 -
Please don't clear out the first post and change the subject, it kinda messes up the whole point of asking for help! when you have solved the problem click solved (bottom left)
-
okay look at the line $headers .= 'Return-path: dukerudy@cox.net\n"; Open single quotes and close with double quotes.. that can't be right! EDIT: also check the other lines (same problem) infact lets, let the forum parse it using code tags <?php $boundary = 'php-mailer'; $headers = 'From: ' . $from . "\n"; $headers .= 'Reply-To: dukerudy@cox.net\n"; $headers .= 'Return-path: dukerudy@cox.net\n"; if ($_POST['addBcc'] == 1) { $headers .= "Bcc: $bcc\n"; } $headers .= 'MIME-Version: 1.0' ."\n"; ?>
-
[SOLVED] preg_replace_callback and callback function
MadTechie replied to anarchoi's topic in PHP Coding Help
Do you mean something like this <?php /* ABC ITEM 1 : DEF xxxx GHI ITEM 1.1 : JKL zzzz MNO ITEM 2 : PQR xxxx STU ITEM 2.1 : VWX zzzz YZ ITEM 2.2 : 123 zzzz*/ $str ="ABC [NOUVEAU_CHAPITRE]DEF[/NOUVEAU_CHAPITRE] GHI [sOUS_CHAPITRE]JKL[/sOUS_CHAPITRE] MNO [NOUVEAU_CHAPITRE]PQR[/NOUVEAU_CHAPITRE] STU [sOUS_CHAPITRE]VWX[/sOUS_CHAPITRE] YZ [sOUS_CHAPITRE]123[/sOUS_CHAPITRE]"; $text = preg_replace_callback('%(\[(.*?)\])(.*?)(\[/\2\])%sim',"Clean",$str); echo $text; function Clean($matches) { static $counter, $sub; if($matches[1]=="[NOUVEAU_CHAPITRE]") { $counter++; $sub=0; $tag1 = "$counter"; $tag2 = "xxxx"; }else{ $sub++; $tag1 = "$counter.$sub"; $tag2 = "zzzz"; } return "ITEM $tag1 : {$matches[3]}: $tag\n"; } ?> -
why even redirect, why not just stay on the same page that generates the errors!
-
thats because you send the details to a HTML page not a PHP page contactformprocess3.html should be /contactformprocess3.php
-
Just add some hidden inputs <input type="hidden" name="clientId" value="2"> <input type="hidden" name="albumId" value="5">
-
Why not just use the SMTP setting from the server then ?
-
If its not including files i'm not too sure, maybe try adding this ini_set('include_path',"."); at the start! personally if your not getting any errors even with error_reporting(E_ALL); then your need to check the logs or something as your giving me nothing to work with!
-
Erm.. if you use phpinfo(); it will tell you the system its running on! I don't have tutorials, but google helps
-
[SOLVED] How do you know from where user come from.
MadTechie replied to frost20's topic in Applications
Your welcome -
On a unix server these are called cron jobs (crontab) for windows you can use windows schedules or wcron
-
for a CSV your data should look like this "data1","data2" "12","34" "56","78" can you post some data in code tags, (or attach a file) as you maybe using a tab file
-
Your very welcome.. Topic Solved? (if so button bottom left)
-
try this RewriteRule ^browse/([^/]+)/([^/]+)/ browse.php?type=$1&sort=$2 #not working
-
Doesn't talk much does he! How is one going to help he who doesn't provide details! Questions: #1 What is in the field Image (exactly) image name/path, image blob ? #2 how do you know its image type ? #3 do you want help ?
-
yes, just make sure you set the header correctly ie <?php header('Content-type: text/css'); //YOU MUST SET THIS AT THE START if($blar) { echo ".style1{width: 100px;}"; }else{ echo ".style1{width: 50px;}"; } ?> .style3{width: 500px;}
-
thats because $ needs to be escaped $eg = "\$test"; or just used single quotes $eg = '$test';
-
I'm guessing you messed up the php.ini file or something, check you php.ini to make sure its correct,
-
Then you should be using sessions
-
Nope, all you need to do is Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line) Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.
-
sounds like your includes are messed up!, either way you should be getting an error message!
-
Ahhh under that directory makes sense, when he said below that directory that's confused the nuts off me!
-
Erm.. and -r DID ?!